angular-cn/CHANGELOG.md

456 KiB
Raw Blame History

4.0.0-rc.1 (2017-02-24)

We are excited to share RC0 with the community. This is a feature-complete pre-release of 4.0.0. Upgrade to get to know the new features to be released in 4.0.0, and to help us validate the release.

Its important to note that this release has been tested extensively. All Angular applications within Google use the master branch of Angular, so every commit is tested and validated at scale prior to any release.

We Need Your Help

Please give this RC a try and test it with your projects! We have spent a significant amount of time working to ensure that this release is backwards compatible and will work with your existing code, but you may have use cases we havent anticipated. If you are broken by this release, let us know so that we can look into it right away. We are also looking for feedback related to the ergonomics of any newly added APIs.

Whats New

View Engine

Weve made changes under to hood to what AOT generated code looks like. These changes should reduce the size of the generated code for your components by more than half in some cases. Read the Design Doc for the View Engine updates.

Enhanced *ngIf syntax

Our template binding syntax now supports a couple helpful changes. You can now use an if/else style syntax, and assign local variables such as when unrolling an observable.

<div #loading>Loading...</div>
<div *ngIf="userObservable | async; else loading; let user">
  {{ user.name }}
</div>

Animation Package

We have pulled Animations into their own package. This means that if you dont use Animations, this extra code will not end up in your production bundles. This also allows you to more easily find documentation and to take better advantage of autocompletion. If you do need animations, libraries like Material will automatically import the module (once you install it via NPM), or you can add it yourself to your main NgModule.

TypeScript 2.1

Weve updated Angular to a more recent version of TypeScript. This will improve the speed of ngc and you will get better type checking throughout your application.

StrictNullChecks

Angular is now compliant with TypeScripts StrictNullChecks. This means that you can enable StrictNullChecks in your project, if desired.

Universal

Universal, the project that allows developers to run Angular on a server, is now up to date with Angular again, and has been adopted by the Angular team. This release now includes the results of the work from the Universal team over the last few months. The majority of the Universal code is now in platform-server. To learn more about this change, take a look the new renderModuleFactory method, or Rob Wormalds Demo Repository. More documentation is forthcoming.

Flat ES Modules (ESM)

We now ship flattened versions of our modules, this should help tree-shaking and help reduce the size of your generated bundles.

ES2015 Builds

We now also ship our packages in the ES2015 Flat ESM format. This option is experimental and opt-in (configure your webpack to resolve "es2015" property in package.json over the regular "module" property).

Known Issues

The following is a list of known issues that will be fixed in the next rcs.

  • Source maps are missing in npm packages
  • Generated bundles will be larger temporarily while we validate new code paths and remove old ones
  • angular.io docs have not been updated to reflect API changes in 4.0
  • legacy UMD bundles don't have correct RxJS mappings when running in ES5 mode without a module system

Installing RC.0

We have two main ways to update. If you have an existing project, you should be able to run:

npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

Then run whatever ng serve or npm start command you normally use, and everything should work.

Please ensure that you are using Typescript v2.1.6 or higher.

If you rely on Animations youll also need to install the animations package and import the new AnimationsModule from @angular/animations in your root NgModule. Without this, your code will compile and run, but animations wont activate.

What's next?

We have three more release candidates scheduled before our planned GA the week of March 22. In the meantime we'll be looking for your feedback, fixing bugs and working on docs.

Commit Summary

Features

  • compiler: Add a enableLegacyTemplate option to support <template> (e99d721)
  • compiler: introduce <ng-template>, deprecate <template> and template attribute (bf8eb41)
  • compiler-cli: add a locale option to ng-xi18n (234f059), closes #12303 #14537
  • compiler-cli: add an outFile option to ng-xi18n (39f56fa), closes #11416 #14508 #14657
  • core: enable new view engine (d3a98c7)
  • core: make new Inject() optional for deps specified as InjectionToken (#14486) (d6a58f9), closes #10625
  • core: add a PLATFORM_ID token that provides a platform id Object. (#14647) (a1d4769)
  • forms: add option to use browser's native validation and angular forms (#13566) (8742432), closes #13573
  • forms: introduce AsyncValidator interface (#13483) (551fe50), closes #13398
  • router: add RouteConfigLoadStart and RouteConfigLoadEnd events (78e8814)
  • router: add an option to rerun guards and resolvers when query changes (c2e0f71), closes #14514 #14567
  • router: add an option to rerun guards and resolvers when query changes (#14624) (41da599), closes #14514 #14567
  • router: introduce RouteConfigLoaded event (7df6f46), closes #14036

Bug Fixes

  • common: do not reference deprecated classes in providers (#14523) (#14523) (a23634d), closes #14521
  • core: host bindings and host listeners for animations (5049a50)
  • http: Make ResponseOptionsArgs an interface (#14607) (fbe4b76), closes #13708
  • packaging: properly build the core-testing bundle (4301dce)
  • platform-webworker: integrate review feedback (601fd3e), closes #14581
  • router: do not finish bootstrap until all the routes are resolved (#14608) (2a191ca), closes #12162 #14155
  • app ids for better