4.0.0-alpha
angular
4.0.0-alpha
We are now named package:angular instead of package:angular2. As such
you cannot pub upgrade from angular2 3.x -> angular2 4.x, and you need to
manually update your dependencies instead:
dependencies:
angular: ^4.0.0-alphaNew features
- Added
exports: [ ... ]to@Component, which allows the limited use of
top-level fields and static methods/fields in a template without making an
alias getter in your class. Implements #374.
import 'dart:math' show max;
@Component(
selector: 'comp',
exports: const [
max,
],
// Should write '20'
template: '{{max(20, 10)}}',
)
class Comp {}-
Limitations:
-
Only top-level fields that are
const(notfinal) can be exported. -
As a note,
exportsare considered to always be pure functions (or
symbols) and are not change detected the same way that instance methods or
fields on the component class are.
-
-
Added
@deferredas the first "compile-time" directive (it has no specific
runtime code nor is it listed in adirectives: [ ... ]list. Implements
#406.
import 'package:angular2/angular2.dart';
import 'expensive_comp.dart' show ExpensiveComp;
@Component(
selector: 'my-comp',
directives: const [ExpensiveComp],
template: r'''
<expensive-comp @deferred></expensive-comp>
''',
)
class MyComp {}-
Added preliminary support for component inheritance. Components now inherit
inputs, outputs, host bindings, host listeners, queries, and view queries
transitively from their immediate supertype if it's a component or directive. -
We use a new open sourcing tool called "CopyBara" that greatly simplifies
both releasing and taking open source contributions. We are able to release
to github more often, and accept PRs much more easily. You can view our
bleedinggithub-syncbranch for what has yet to be merged
intomaster. -
We no longer emit
ng_*.jsonfiles as part of the compile process #276. -
Attribute selectors (
<ng-content select="custom-action[group='1']">) is now supported #237. -
Lifecycle interfaces no longer need to be "re-implemented" on classes in order
for the compiler to pick them up - we now respect the dependency chain #19. -
Provider(useValue: ...)now accepts "complex const data structures", with
the caveat that your data structure must not be invoking a private constructor
#10.
Breaking changes
-
Removed the runtime (
dart:mirrors-based) interpreter. It is now required to
always use the AngularDart transformer to pre-compile the code, even during
development time in Dartium.package:angular2/reflection.dartwas also
removed. -
The
bootstrapfunction now always throws a runtime exception, and both it
andbootstrapStaticare accessible viaangular.dartinstead of
platform/browser.dartandplatform/browser_static.dart#357. -
Returning
falsefrom an event handler will no longer cancel the event. See
#387 for details. -
Removed
QueryandViewQuery. Please useContentChild/ContentChildren
andViewChild/ViewChildrenin their place instead. -
Removed the
use_analyzerflag for the transformer. This is alwaystrue.
#404. -
Removed all other unused or unsupported flags from the transformer. There is
now a singleCompilerFlagsclass that is universally supported for all build
systems. -
Removed a number of classes that were never intended to be public.
Deprecations
- Support for shadow piercing combinators
/deep/and>>>to prevent style
encapsulation is now deprecated./deep/is already deprecated and will be
removed in Chrome 60. Its alias>>>is limited to the
static profile of selectors, meaning it's not supported
in style sheets. Continued use of these combinators puts Angular at risk of
incompatibility with common CSS tooling.::ng-deepis a drop-in replacement,
intended to provide the same functionality as/deep/and>>>, without the
need to use deprecated or unsupported CSS syntax #454.
Bug fixes
-
Properly annotate methods in generated
.template.dartcode with@override. -
Updated the documentation for
OnInitandOnDestroyto mention more
specifics about the contract and document "crash detection" cases where they
may be called more than once. -
*ngIfnow properly checks that inputs do not change during change detection #453. -
Properly typed
TrackByFnas anintnot anum#431. -
Import aliases are supported by the compiler #245.
Performance
-
Remove redundant calls to
dbg(...)in dev-mode. This reduces the amount of
work done and speeds up developer runtimes, such as those using the
DartDevCompiler (DDC). -
Some change detection code that was duplicated across all generated templates
were moved internally to a newAppView#detectHostChangesmethod. -
Introduced a new
AppViewDatastructure in the generated code that decreases
code size ~2% or more in some applications due to better code re-use and emit
in dart2js. -
We no longer change detect literals and simple
finalproperty reads. -
Some of the enums used to manage change detection state have been simplified
tointin order to reduce the cost in the generated code.
angular_test
1.0.0-beta+4
Now supports package:angular instead of package:angular2.
angular_compiler
0.1.0
- Initial commit of
angular_compiler.