Releases: angulardart/angular
4.0.0-alpha+2
angular
4.0.0-alpha+2
New features
- Added
ComponentLoader
, a high-level imperative API for creating components
at runtime. It uses internal code-paths that already existed, and is much
more future proof.ComponentLoader
is usable within a@Directive()
, an
@Component()
, and injectable services.
// An `ExampleComponent`s generated code, including a `ComponentFactory`.
import 'example.template.dart' as ng;
class AdBannerComponent implements AfterViewInit {
final ComponentLoader _loader;
AdBannerComponent(this._loader);
@override
ngAfterViewInit() {
final component = _loader.loadDetached(ng.ExampleComponentNgFactory);
// Do something with this reference.
}
}
-
You can now directly inject
dart:html
'sElement
orHtmlElement
instead
ofElementRef
, which is "soft deprecated" (will be deprecated and removed
in a future release). -
findContainer
has now been exposed from NgForm allowing easier creation of
custom form implementations. -
setUpControl
has been exposed from the forms API to allow forms to setup
their controls easier.
Bug Fixes
- The transformer now fails if any unsupported arguments are passed in.
Performance
- Directives now generate their own change detector class (behind the scenes)
instead of the code being re-created into every component that uses a
directive.
Breaking changes
-
The router package is now being published separate as
package:angular_router
(not throughpackage:angular/router.dart
). In the near future it will be
updated to a more Dart idiomatic "2.0" router, but for now it is an exact
replica of the previous router. -
Removed
@{Component|Directive}#queries
. This is replable using the same
member-level annotation (i.e.@{Content|View}Child{ren}
). -
DynamicComponentLoader
was renamedSlowComponentLoader
to encourage users
to preferComponentLoader
. Additionally, argumentsprojectableNodes:
and
onDestroy:
callbacks were removed - they were mostly unused, and confusing
since they were undocumented. -
Removed
angular/platform/browser_static.dart
; replace imports with
angular/angular.dart
. -
Removed
angular/platform/common_dom.dart
; replace imports with
angular/angular.dart
. -
Removed
angular/testing.dart
; Useangular_test
package instead. -
Removed
angular/platform/testing.dart
. -
Removed
platform/testing/browser_static.dart
. -
Removed
MockNgZone
. -
Removed
ViewEncapsulation.native
, which is no longer supported. -
Renamed
FORM_DIRECTIVES
toformDirectives
.
angular_router
1.0.0
- Initial commit of
angular_router
. This is just a port of the router that was
in the core angular package.
angular_test
1.0.0-beta+5
- Workaround for
pub {serve|build}
hanging onangular_test
as a dependency.
angular_compiler
0.2.0
- Added various classes and helpers to form the new compile infrastructure:
ComponentReader
DependencyReader
,DependencyInvocation
,DependencyElement
ProviderReader
,ProviderElement
TokenReader
,TypeTokenElement
,OpaqueTokenElement
getInheritanceHierarchy
,urlOf
ReflectableReader
,ReflectableOutput
,ReflectableClass
4.0.0-alpha+1
4.0.0-alpha+1
New features
- Inheritence for both component and directive metadata is now complete! Any
field or method-level annotations (@Input
,@Output
,
@ViewChild|Children
,@ContentChild|Children
) are now inherited through
super types (extends
,implements
,with
) #231:
class BaseComponent {
@Input()
String name;
}
// Also has an input called "name" now!
@Component(selector: 'comp')
class ConcreteComponent extends BaseComponent {}
- Inputs that are of type
bool
now receive a default value oftrue
instead
of a value ofnull
or an empty string. This allows a much more HTML-friendly
syntax for your components:
<!-- All of these set a value of disabled=true -->
<fancy-button disabled></fancy-button>
<fancy-button [disabled]></fancy-button>
<fancy-button [disabled]="true"></fancy-button>
<!-- Value of disabled=false -->
<fancy-button [disabled]="false"></fancy-button>
@Component()
class FancyButton {
@Input()
bool disabled = false;
}
Breaking changes
- Removed
angular/common.dart
; replace imports withangular/angular.dart
. - Removed
angular/compiler.dart
; Compiler should only be invoked via the
transformers or viapkg:build
directly usingangular/source_gen.dart
. - Deprecated
@View()
annotation was completely removed. - Deprecated second parameter to
ExceptionHandler
was completely removed.
Bug fixes
- Fixed a bug where
@deferred
did not work nested inside of<template>
:
<template [ngIf]="someCondition">
<expensive-comp @deferred></expensive-comp>
</template>
-
ngForm
now allowsonSubmit
to be called with anull
value. -
Using
inputs|outputs
in the@Component
annotation to rename an existing
@Input()
or@Output()
now logs and fails the build during compilation. -
Symbol collisions with
dart:html
no longer cause a runtime exception, all
framework use ofdart:html
is now scoped behind a prefixed import.
angular_compiler-0.1.1
Following the publishing pattern in https://github.com/dart-lang/build/releases.
0.1.1
- Fixed a bug where flag
entry_points
was only allowed to be a list.
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-alpha
New 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,
exports
are 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
@deferred
as 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-sync
branch for what has yet to be merged
intomaster
. -
We no longer emit
ng_*.json
files 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.dart
was also
removed. -
The
bootstrap
function now always throws a runtime exception, and both it
andbootstrapStatic
are accessible viaangular.dart
instead of
platform/browser.dart
andplatform/browser_static.dart
#357. -
Returning
false
from an event handler will no longer cancel the event. See
#387 for details. -
Removed
Query
andViewQuery
. Please useContentChild
/ContentChildren
andViewChild
/ViewChildren
in their place instead. -
Removed the
use_analyzer
flag for the transformer. This is alwaystrue
.
#404. -
Removed all other unused or unsupported flags from the transformer. There is
now a singleCompilerFlags
class 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-deep
is 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.dart
code with@override
. -
Updated the documentation for
OnInit
andOnDestroy
to mention more
specifics about the contract and document "crash detection" cases where they
may be called more than once. -
*ngIf
now properly checks that inputs do not change during change detection #453. -
Properly typed
TrackByFn
as anint
not 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#detectHostChanges
method. -
Introduced a new
AppViewData
structure 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
final
property reads. -
Some of the enums used to manage change detection state have been simplified
toint
in 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
.
3.1.0
3.1.0
New features
-
Exposed
TouchFunction
andChangeFunction
typedefs to make the transition
to strong-mode easier for teams relying on these function definitions. We
might remove them in a future release when they are no longer needed. -
Added a flag to use an experimental new compiler that uses the Dart analyzer
to gather metadata information. This flag will be turned on by default in
4.0
:
transformers:
angular2/transform/codegen:
use_analyzer: true
WARNING: Using use_analyzer: true
requires discontinuing use of the
platform_*
options, and fails-fast if both flags are used. See
https://goo.gl/68VhMa for details.
WARNING: Using use_analyser: true
doesn't yet work with most third-party
packages due to a bug.
Deprecations
- Using
dart:mirrors
(i.e. running AngularDart without code generation) is
now formally deprecated. In4.0+
code generation will be the only way to
run an AngularDart application, even in development mode. Please ensure you
are using our transformer: https://goo.gl/rRHqO7.
Bug fixes
-
CSS errors are now just warnings, and can be ignored. This is due to using
a CSS parser for encapsulation - and the AngularDart transformer aggressively
runs on all CSS files in a given package. We hope to make this smoother in a
future release. -
Do not generate
throwOnChanges
checks outside of dev-mode.
Performance
- Bypasses the deprecated event plugin system for all native DOM events.
- At runtime
interpolate
is now represented by multiple functions (faster). KeyValueDiffer
(NgClass
,NgStyle
) optimized for initial add/removals.- No longer generates event handler registrations for directive outputs.
3.1.0-beta+1
3.1.0
New features
-
Exposed
TouchFunction
andChangeFunction
typedefs to make the transition
to strong-mode easier for teams relying on these function definitions. We
might remove them in a future release when they are no longer needed. -
Added a flag to use an experimental new compiler that uses the Dart analyzer
to gather metadata information. This flag will be turned on by default in
4.0
:
transformers:
angular2/transform/codegen:
use_analyzer: true
WARNING: Using use_analyzer: true
requires discontinuing use of the
platform_*
options, and fails-fast if both flags are used. See
https://goo.gl/68VhMa for details.
WARNING: Using use_analyser: true
doesn't yet work with most third-party
packages due to a bug.
Deprecations
- Using
dart:mirrors
(i.e. running AngularDart without code generation) is
now formally deprecated. In4.0+
code generation will be the only way to
run an AngularDart application, even in development mode. Please ensure you
are using our transformer: https://goo.gl/rRHqO7.
Bug fixes
-
CSS errors are now just warnings, and can be ignored. This is due to using
a CSS parser for encapsulation - and the AngularDart transformer aggressively
runs on all CSS files in a given package. We hope to make this smoother in a
future release. -
Do not generate
throwOnChanges
checks outside of dev-mode.
Performance
- Bypasses the deprecated event plugin system for all native DOM events.
- At runtime
interpolate
is now represented by multiple functions (faster). KeyValueDiffer
(NgClass
,NgStyle
) optimized for initial add/removals.- No longer generates event handler registrations for directive outputs.
3.0.0: Update changelog for v3 gold
New features
composeValidators
andcomposeAsyncValidators
now part of the public API.angular2/testing.dart
includes a test-onlyisDebugMode
function.- (Forms)
AbstractControl.markAsDirty
now emits a status change event.
Breaking changes
-
Requires at least Dart SDK
1.23.0
. -
Injecting
null
is no longer supported. -
Remove unused
useProperty
argument in DIProvider
api. -
ReflectionCapabilities.isReflectionEnabled
renamed toreflectionEnabled
. -
Malformed CSS warnings are errors now.
-
Removed forms async validators. Alternative:
control.valueChange((value) { rpc.validate(change).then((errors) { if (errors != null) control.setErrors(errors); }); });
-
Removed
TitleService
. To update the title, usedart:html
:document.title = 'My title';
-
DynamicComponentLoader
now has a simplified API:loadAsRoot
,loadAsRootIntoNode
replaced by a singleload
method that
always creates the component root node instead of hoisting into an existing
node. -
Removed
viewBindings
fromComponent
. This has been interchangeable with
viewProviders
for a while now.BEFORE:
dart @Component(viewBindings: const [])
AFTER:
dart @Component(viewProviders: const [])
-
Removed
EventManager
from the public API. Code generation is now closer to
document.addEventListener
and having this interception layer would not
allow further optimizations. -
Removed
IterableDifferFactory
andKeyValueDifferFactory
from the public
API. We have planned compiler optimizations that will no longer allow
overriding our diffing implementations. Looking into alternatives before a
final3.0.0
release that are lower cost. -
ASYNC_VALIDATORS
can no longer return aStream
instance, onlyFuture
. -
The experimental
NgTestBed
was removed. Usepackage:angular_test
now. -
By default, the
ExceptionHandler
is aBrowserExceptionHandler
, which
prints exceptions to the console. If you don't want this behavior (i.e.
releasing to production), make sure to override it. -
ElementRef.nativeElement
is nowfinal
(no setter). -
DOM adapter is now completely removed from the API and generated code
-
A
name
parameter is now required for all@Pipe(...)
definitions:BEFORE:
dart @Pipe(name: 'uppercase')
AFTER:
dart @Pipe('uppercase')
-
DomEventsPlugin
now requires a strongly typed interface todart:html
. -
Null
is no longer propagated as an initial change value. Code should be
updated to either deliver a different initial value or components with an
@Input()
should have an appropriate default value.BEFORE
<my-component [value]="null"></my-component> ... String _value; set value(String value) { _value = value ?? 'Default name'; }
AFTER
String _value = 'Default name'; set value(String value) { _value = value; }
-
Removed the
isFirstChange()
method ofSimpleChange
.
Instead, check whetherpreviousValue
isnull
. -
Removed
NgPlural
, deprecated as of 2.1.0. -
Removed
ObservableListDiffFactory
, deprecated as of 2.1.0. -
Event handlers are bound at initialization time. Therefore, the following
will no longer work, becauseclickHandler
isnull
during initialization.@Component( selector: 'my-component', template: '<div (click)="clickHandler($event)"></div>') class MyComponent { Function clickHandler; }
-
Removed
Component.moduleId
, which was unused.
Deprecations
@View
will be removed in4.0
, only use@Component
instead.EventEmitter
is now@Deprecated
: UseStream
andStreamController
.ngSwitchCase
replacesngSwitchWhen
(soft deprecation).XHR
is deprecated, along with the runtime/reflective compiler.IterableDiffers
andKeyValueDiffers
are deprecated. The cost of looking
up to see if a custom differ is available is too high for almost no use.
Before they're removed, we'll have other customization options.
Bug fixes
- Updated various documentation to make cleaner and use Dart, not TS, samples.
- Perf: Added performance improvements around generated code and type inference.
- Fix: Key-value differ now detects removals when first key moves.
- Fix:
<ng-content select="...">
does not emit incorrect code (regression). - Perf: Optimized how reflective providers are resolved on application startup.
ngSwitchWhen
now properly compares identity in Dartium.Component/Directive#selector
is now a@required
property.- Angular warns in the console if using Dartium without checked mode.
- Various performance improvements for both code size and runtime.
- Various Dart idiomatic/style guide updates to the codebase.
ngIf
now throws again if the bound value changes during change detection.- Fixed a bug where the router didn't work on a root path in IE11.
- Fixed generated code that caused a strong-mode warning on
AppView<...>
. - Fixed a bug where DDC didn't work properly with "pure"
Pipe
s. - Some simple types are now propagated to the generated
.template.dart
file. - When setting up a new
NgControl
,valueAccessor
no longer can throw an NPE - Re-enabled
strong-mode
analysis within the project, and fixed some errors.
Refactoring
- We now use the formal
<T>
generic type syntax for methods, not/*<T>*/
. - Removed
NgZoneImpl
, all the code exists inNgZone
now. - We now generate specific code for view and content children (faster).
- Projectable nodes now use the visitor pattern in
AppView
. - In generated
.template.dart
change detected primitives are typed. - Moved
renderType
as a static class member in generated code.
3.0.0-beta+2
@View
will be removed in3.0.0
final, only use@Component
instead.EventEmitter
is now@Deprecated
: UseStream
andStreamController
.ElementRef.nativeElement
is nowfinal
(no setter).- Updated various documentation to make cleaner and use Dart, not TS, samples.
- Perf: Added performance improvments around generated code and type inference.
- Fix: Key-value differ now detects removals when first key moves.
- Fix:
<ng-content select="...">
does not emit incorrect code (regression). - Perf: Optimized how reflective providers are resolved on application startup.
3.0.0-beta+1: perf(ReflectiveProviders): Phase1, speed up resolveReflectiveProviders
- Require at least Dart SDK
1.23.0-dev.7.0
. Required for a JS-interop fix.
Breaking changes
-
Injecting null no longer supported.
-
Remove unused
useProperty
argument in DIProvider
api. -
ReflectionCapabilities.isReflectionEnabled
renamed toreflectionEnabled
. -
Malformed CSS warnings are errors now.
-
Removed forms async validators. Alternative:
control.valueChange((value) { rpc.validate(change).then((errors) { if (errors != null) control.setErrors(errors); }); });
3.0.0-beta
New features
composeValidators
andcomposeAsyncValidators
now part of the public API.angular2/testing.dart
includes a test-onlyisDebugMode
function.
Breaking changes
-
Removed
TitleService
. To update the title, usedart:html
:document.title = 'My title';
-
DynamicComponentLoader
now has a simplified API:loadAsRoot
,loadAsRootIntoNode
replaced by a singleload
method that
always creates the component root node instead of hoisting into an existing
node.
Bug fixes and deprecations
ngSwitchWhen
now properly compares identity in Dartium.ngSwitchCase
replacesngSwitchWhen
(soft deprecation).Component/Directive#selector
is now a@required
property.- Angular warns in the console if using Dartium without checked mode.
- Various performance improvements for both code size and runtime.
- Various Dart idiomatic/style guide updates to the codebase.
ngIf
now throws again if the bound value changes during change detection.XHR
is deprecated, along with the runtime/reflective compiler.