Handle the situation where a `.dart` file generates a `.ng_meta.json`
file but does not register any reflective information.
An example of this would be a file that defines a const list that looks
like a directive alias. The transformer keeps track of this, and creates
a `.ng_meta.json` file but never creates a `.ng_deps.dart` file, which
can result in other files being linked to it and it not defining an
`initReflector` method.
`DeferredRewriter` depends on the presence of `.ng_deps.dart` files,
which do not yet exist in the phase where it was previously run.
Update the transformer phases to fix this and add an integration test to
prevent regression.
Link `NgDeps` & `NgMeta` data in the same phase to avoid unnecessary asset
creation & reading.
Remove `NgMeta#exports` and instead use `NgDeps#exports` to link `NgMeta` files
in `ng_meta_linker.dart`.
Previously, annotations which were const objects (as opposed to const
instance creation expressions) were incorrectly output as instance
creation expressions.
Before:
```
const override() // A const instance creation expression
```
After
```
override // A const instance
```
Closes#4481
BREAKING CHANGE:
- Removes `ChangeDetection`, use a binding for `ChangeDetectorGenConfig` instead
to configure change detection.
- `RenderElementRef.renderBoundElementIndex` was renamed to `RenderElementRef.boundElementIndex`.
- Removes `ViewLoader`, use `XHRImpl` instead.
Closes#3605
BREAKING CHANGE:
- we don't mark an element as bound any more if it only contains text bindings
E.g. <div>{{hello}}</div>
This changes the indices when using `DebugElement.componentViewChildren` / `DebugElement.children`.
- `@Directive.compileChildren` was removed,
`ng-non-bindable` is now builtin and not a directive any more
- angular no more adds the `ng-binding` class to elements with bindings
- directives are now ordered as they are listed in the View.directives regarding change detection.
Previously they had an undefined order.
- the `Renderer` interface has new methods `createProtoView` and `registerComponentTemplate`. See `DomRenderer` for default implementations.
- reprojection with `ng-content` is now all or nothing per `ng-content` element
- angular2 transformer can't be used in tests that modify directive metadata.
Use `angular2/src/transform/inliner_for_test` transformer instead.
Ensure that the transformers are properly declaring all consumed
outputs. In particular, when a transformer overwrites an output, make
sure the transformer calls `consumePrimary` followed by `addOutput` for
that file.
Prevent `DirectiveLinker` from consuming `.ng_deps.json` files. When we
do this, barback incorrectly calculates the available assets for that
phase, resulting in broken builds.
To simplify processing and testing in the future, use protobufs to
represent of `.ng_deps.dart` files rather than always dealing
directly in Dart code.
This update does not actually use the protobuf representation, but this
is a step towards moving all phases to parse and use protobufs rather than
Dart code.
By default, pipes are pure. This means that an instance of a pipe will be reused and the pipe will be called only when its arguments change.
BREAKING CHANGE
Before:
@Pipe({name: 'date'}) class DatePipe {} defines an impure pipe.
After:
@Pipe({name: 'date'}) class DatePipe {} defines a pure pipe.
@Pipe({name: 'date', pure: false}) class DatePipe {} defines an impure pipe.
Closes#3966
This change moves many APIs to the angular2/core export.
This change also automatically adds FORM_BINDINGS in
the application root injector.
BREAKING CHANGE:
Many dependencies that were previously exported from specific
APIs are now exported from angular2/core. Affected exports, which
should now be included from angular2/core include:
angular2/forms
angular2/di
angular2/directives
angular2/change_detection
angular2/bootstrap (except for dart users)
angular2/render
angular2/metadata
angular2/debug
angular2/pipes
Closes#3977
When running in Dartium without using transformers (i.e. with a normal
static web server), handle relative template URLs. This works by using
mirrors to get the URL of the library where the component class is
defined.
Closes#2771Closes#3743
BREAKING CHANGE (maybe)
Well as long as our customers use public API this should not be a
breaking change, but we have changed import structure as well as
internal names, so it could be breaking.
import:
angular2/annotations => angular2/metadata
Classes:
*Annotations => *Metadata
renderer.DirectiveMetadata => renderer.RendererDirectiveMetadata
renderer.ElementBinder => renderer.RendererElementBinder
impl.Directive => impl.DirectiveMetadata
impl.Component => impl.ComponentMetadata
impl.View => impl.ViewMetadata
Closes#3660
We have Dart code in `angular2` module that ought to be in its own
package. Examples include Dart analysis plugins, and potentially the
transformers (although transformers cannot be moved out just yet).
However, this code is Dart-only and it doesn’t make sense to use JS
directory layout for it. This commit introduces a sub-directory called
`modules_dart`. All modules in this directory are pure Dart packages
using standard pub directory layout. The code in these packages never
gets transpiled. It is directly copied to `dist` unmodified, except an
adjustment in relative paths in `pubspec.yaml` files.