Commit 583a9d3
feat(zone.js): upgrade zone.js to angular package format(APF) (#36540)
Close #35157
In the current version of zone.js, zone.js uses it's own package format, and it is not following the rule
of Angualr package format(APF), so it is not easily to be consumed by Angular CLI or other bundle tools.
For example, zone.js npm package has two bundles,
1. zone.js/dist/zone.js, this is a `es5` bundle.
2. zone.js/dist/zone-evergreen.js, this is a `es2015` bundle.
And Angular CLI has to add some hard-coding code to handle this case, ohttps://github.com/angular/angular-cli/blob/5376a8b1392ac7bd252782d8474161ce03a4d1cb/packages/schematics/angular/application/files/src/polyfills.ts.template#L55-L58
This PR upgrade zone.js npm package format to follow APF rule, https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx
The updated points are:
1. in package.json, update all bundle related properties
```
"main": "./bundles/zone.umd.js",
"module": "./fesm2015/zone.js",
"es2015": "./fesm2015/zone.js",
"fesm2015": "./fesm2015/zone.js",
```
2. re-organize dist folder, for example for `zone.js` bundle, now we have
```
dist/
bundles/
zone.js // this is the es5 bundle
fesm2015/
zone.js // this is the es2015 bundle (in the old version is `zone-evergreen.js`)
```
3. have several sub-packages.
1. `zone-testing`, provide zone-testing bundles include zone.js and testing libraries
2. `zone-node`, provide zone.js implemention for NodeJS
3. `zone-mix`, provide zone.js patches for both Browser and NodeJS
All those sub-packages will have their own `package.json` and the bundle will reference `bundles(es5)` and `fesm2015(es2015)`.
4. keep backward compatibility, still keep the `zone.js/dist` folder, and all bundles will be redirected to `zone.js/bundles` or `zone.js/fesm2015` folders.
PR Close #365401 parent 1fce6d6 commit 583a9d3
182 files changed
Lines changed: 1708 additions & 902 deletions
File tree
- .circleci
- aio/content
- examples
- setup/src
- upgrade-module/src
- upgrade-phonecat-2-hybrid
- aot
- upgrade-phonecat-3-final
- guide
- dev-infra/benchmark/component_benchmark
- integration
- bazel
- src
- hello-world
- dynamic-compiler
- hello_world__closure
- src
- hello_world__systemjs_umd/src
- i18n
- src
- ng_elements
- platform-server
- src
- helloworld
- transferstate
- modules
- benchmarks/src
- change_detection/transplanted_views
- expanding_rows
- js-web-frameworks/ng2
- largeform/ng2
- largetable
- ng2_switch
- ng2
- styling/ng2
- tree
- ng2_static
- ng2_switch
- ng2
- views
- playground/src
- animate
- async
- gestures
- hello_world
- http
- jsonp
- key_events
- model_driven_forms
- order_management
- person_management
- relative_assets
- routing
- sourcemap
- svg
- template_driven_forms
- todo
- upgrade
- web_workers
- animations
- images
- input
- kitchen_sink
- message_broker
- router
- todo
- zippy_component
- packages
- bazel/src/schematics/ng-add
- elements/test
- examples
- common
- core
- forms
- router/activated-route
- service-worker
- push
- registration-options
- upgrade
- router
- zone.js
- bundles
- dist
- async-test.min
- async-test
- fake-async-test.min
- fake-async-test
- jasmine-patch.min
- jasmine-patch
- long-stack-trace-zone.min
- long-stack-trace-zone
- mocha-patch.min
- mocha-patch
- proxy.min
- proxy
- sync-test.min
- sync-test
- task-tracking.min
- task-tracking
- webapis-media-query.min
- webapis-media-query
- webapis-notification.min
- webapis-notification
- webapis-rtc-peer-connection.min
- webapis-rtc-peer-connection
- webapis-shadydom.min
- webapis-shadydom
- wtf.min
- wtf
- zone-bluebird.min
- zone-bluebird
- zone-error.min
- zone-error
- zone-evergreen-testing-bundle.min
- zone-evergreen-testing-bundle
- zone-evergreen.min
- zone-evergreen
- zone-legacy.min
- zone-legacy
- zone-mix.min
- zone-mix
- zone-node.min
- zone-node
- zone-patch-canvas.min
- zone-patch-canvas
- zone-patch-cordova.min
- zone-patch-cordova
- zone-patch-electron.min
- zone-patch-electron
- zone-patch-fetch.min
- zone-patch-fetch
- zone-patch-jsonp.min
- zone-patch-jsonp
- zone-patch-message-port.min
- zone-patch-message-port
- zone-patch-promise-test.min
- zone-patch-promise-test
- zone-patch-resize-observer.min
- zone-patch-resize-observer
- zone-patch-rxjs-fake-async.min
- zone-patch-rxjs-fake-async
- zone-patch-rxjs.min
- zone-patch-rxjs
- zone-patch-socket-io.min
- zone-patch-socket-io
- zone-patch-user-media.min
- zone-patch-user-media
- zone-testing-bundle.min
- zone-testing-bundle
- zone-testing-node-bundle.min
- zone-testing-node-bundle
- zone-testing.min
- zone-testing
- zone.min
- zone_externs
- zone
- fesm2015
- lib/zone-spec
- mix
- node
- testing
- test
- extra
- npm_package
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
735 | | - | |
| 734 | + | |
| 735 | + | |
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments