2019-10-05 23:06:53 -04:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
2019-05-31 11:56:07 -04:00
|
|
|
|
fix(zone.js): should have better backward compatibilities (#38797)
Close #38561, #38669
zone.js 0.11.1 introduces a breaking change to adpat Angular package format,
and it breaks the module loading order, before 0.11, in IE11, the `zone.js` es5
format bundle will be imported, but after 0.11, the `fesm2015` format bundle will
be imported, which causes error.
And since the only purpose of the `dist` folder of zone.js bundles is to keep backward
compatibility, in the original commit, I use package redirect to implement that, but
it is not fully backward compatible, we should keep the same dist structure as `0.10.3`.
PR Close #38797
2020-09-10 14:28:40 -04:00
|
|
|
load("//packages/zone.js/dist:tools.bzl", "copy_es2015_to_dist", "copy_es5_to_dist")
|
|
|
|
|
|
|
|
copy_es2015_to_dist()
|
|
|
|
|
|
|
|
copy_es5_to_dist()
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "zone_externs",
|
|
|
|
srcs = ["//packages/zone.js:zone_externs"],
|
|
|
|
outs = ["zone_externs.js"],
|
|
|
|
cmd = "cp $< $@",
|
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "zone_extensions_d_ts",
|
|
|
|
srcs = ["//packages/zone.js/lib:zone.api.extensions.ts"],
|
|
|
|
outs = ["zone.api.extensions.ts"],
|
|
|
|
cmd = "cp $< $@",
|
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "zone_configurations_d_ts",
|
|
|
|
srcs = ["//packages/zone.js/lib:zone.configurations.api.ts"],
|
|
|
|
outs = ["zone.configurations.api.ts"],
|
|
|
|
cmd = "cp $< $@",
|
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "zone_js_d_ts",
|
|
|
|
srcs = ["//packages/zone.js/lib:zone_d_ts"],
|
|
|
|
outs = ["zone.js.d.ts"],
|
|
|
|
cmd = "cp $< $@",
|
|
|
|
)
|
|
|
|
|
2020-02-10 14:23:58 -05:00
|
|
|
filegroup(
|
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 #36540
2020-05-16 21:53:03 -04:00
|
|
|
name = "dist_bundle_group",
|
2020-02-10 14:23:58 -05:00
|
|
|
srcs = [
|
fix(zone.js): should have better backward compatibilities (#38797)
Close #38561, #38669
zone.js 0.11.1 introduces a breaking change to adpat Angular package format,
and it breaks the module loading order, before 0.11, in IE11, the `zone.js` es5
format bundle will be imported, but after 0.11, the `fesm2015` format bundle will
be imported, which causes error.
And since the only purpose of the `dist` folder of zone.js bundles is to keep backward
compatibility, in the original commit, I use package redirect to implement that, but
it is not fully backward compatible, we should keep the same dist structure as `0.10.3`.
PR Close #38797
2020-09-10 14:28:40 -04:00
|
|
|
":async-test.js",
|
|
|
|
":async-test.min.js",
|
|
|
|
":fake-async-test.js",
|
|
|
|
":fake-async-test.min.js",
|
|
|
|
":jasmine-patch.js",
|
|
|
|
":jasmine-patch.min.js",
|
|
|
|
":long-stack-trace-zone.js",
|
|
|
|
":long-stack-trace-zone.min.js",
|
|
|
|
":mocha-patch.js",
|
|
|
|
":mocha-patch.min.js",
|
|
|
|
":proxy.js",
|
|
|
|
":proxy.min.js",
|
|
|
|
":sync-test.js",
|
|
|
|
":sync-test.min.js",
|
|
|
|
":task-tracking.js",
|
|
|
|
":task-tracking.min.js",
|
|
|
|
":webapis-media-query.js",
|
|
|
|
":webapis-media-query.min.js",
|
|
|
|
":webapis-notification.js",
|
|
|
|
":webapis-notification.min.js",
|
|
|
|
":webapis-rtc-peer-connection.js",
|
|
|
|
":webapis-rtc-peer-connection.min.js",
|
|
|
|
":webapis-shadydom.js",
|
|
|
|
":webapis-shadydom.min.js",
|
|
|
|
":wtf.js",
|
|
|
|
":wtf.min.js",
|
|
|
|
":zone.js",
|
|
|
|
":zone.min.js",
|
|
|
|
":zone-bluebird.js",
|
|
|
|
":zone-bluebird.min.js",
|
|
|
|
":zone-error.js",
|
|
|
|
":zone-error.min.js",
|
|
|
|
":zone-evergreen.js",
|
|
|
|
":zone-evergreen.min.js",
|
|
|
|
":zone-evergreen-testing-bundle.js",
|
|
|
|
":zone-evergreen-testing-bundle.min.js",
|
|
|
|
":zone-legacy.js",
|
|
|
|
":zone-legacy.min.js",
|
|
|
|
":zone-mix.js",
|
|
|
|
":zone-mix.min.js",
|
|
|
|
":zone-node.js",
|
|
|
|
":zone-node.min.js",
|
|
|
|
":zone-patch-canvas.js",
|
|
|
|
":zone-patch-canvas.min.js",
|
|
|
|
":zone-patch-cordova.js",
|
|
|
|
":zone-patch-cordova.min.js",
|
|
|
|
":zone-patch-electron.js",
|
|
|
|
":zone-patch-electron.min.js",
|
|
|
|
":zone-patch-fetch.js",
|
|
|
|
":zone-patch-fetch.min.js",
|
|
|
|
":zone-patch-jsonp.js",
|
|
|
|
":zone-patch-jsonp.min.js",
|
|
|
|
":zone-patch-message-port.js",
|
|
|
|
":zone-patch-message-port.min.js",
|
|
|
|
":zone-patch-promise-test.js",
|
|
|
|
":zone-patch-promise-test.min.js",
|
|
|
|
":zone-patch-resize-observer.js",
|
|
|
|
":zone-patch-resize-observer.min.js",
|
|
|
|
":zone-patch-rxjs.js",
|
|
|
|
":zone-patch-rxjs.min.js",
|
|
|
|
":zone-patch-rxjs-fake-async.js",
|
|
|
|
":zone-patch-rxjs-fake-async.min.js",
|
|
|
|
":zone-patch-socket-io.js",
|
|
|
|
":zone-patch-socket-io.min.js",
|
|
|
|
":zone-patch-user-media.js",
|
|
|
|
":zone-patch-user-media.min.js",
|
|
|
|
":zone-testing.js",
|
|
|
|
":zone-testing.min.js",
|
|
|
|
":zone-testing-bundle.js",
|
|
|
|
":zone-testing-bundle.min.js",
|
|
|
|
":zone-testing-node-bundle.js",
|
|
|
|
":zone-testing-node-bundle.min.js",
|
|
|
|
":zone_configurations_d_ts",
|
|
|
|
":zone_extensions_d_ts",
|
|
|
|
":zone_externs",
|
|
|
|
":zone_js_d_ts",
|
2020-02-10 14:23:58 -05:00
|
|
|
],
|
|
|
|
)
|