Skip to content

Commit d2eb4f8

Browse files
committed
feat(zone): Use zone-nativescript vendored below ./zone.js
Add a document describing the zone.js upgrade process.
1 parent 51d2ed6 commit d2eb4f8

File tree

6 files changed

+862
-6
lines changed

6 files changed

+862
-6
lines changed

doc/upgrading-zonejs.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Upgrading Zone.js
2+
3+
`nativescript-angular` uses a fork of the `zone.js` package in order to work around incompatibilities between node, browser, and mobile implementations.
4+
5+
The fork resides at https://github.com/NativeScript/zone.js in the `zone-nativescript` branch. It adds a separate `lib/nativescript/nativescript.ts` entry point that is used to generate a new bundle: `dist/zone-nativescript.js`.
6+
7+
To upgrade to a newer release of `zone.js`:
8+
9+
1. Identify the upgrade target -- most likely a release tag.
10+
2. Rebase the `zone-nativescript` branch on top of the upgrade target.
11+
3. Rebuild: `gulp build`
12+
4. Run the node-based smoke tests: `gulp test/nativescript`
13+
5. Run the browser tests: `node_modules/.bin/karma start karma.conf.js --single-run` (You need to run node `test/ws-server.js` in a separate console first)
14+
6. Commit `dist/zone-nativescript.js`, drop the previous `dist/zone-nativescript.js` commit from the branch. Force push the new `zone-nativescript` branch to GitHub.
15+
7. Update your copy of `nativescript-angular/zone.js/dist/zone-nativescript.js` with the bundle you just built.

nativescript-angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@angular/forms": "2.0.0-rc.6",
3030
"@angular/router": "3.0.0-rc.2",
3131
"rxjs": "5.0.0-beta.11",
32-
"zone.js": "^0.6.17",
3332
"reflect-metadata": "^0.1.8",
3433
"parse5": "1.3.2",
3534
"punycode": "1.3.2",
@@ -38,6 +37,7 @@
3837
},
3938
"devDependencies": {
4039
"tns-core-modules": ">=2.2.0 || >=2.2.0-2016",
40+
"zone.js": "^0.6.17",
4141
"typescript": "^1.8.10"
4242
},
4343
"nativescript": {}

nativescript-angular/platform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'globals';
2-
import "zone.js/dist/zone-node";
2+
import "./zone.js/dist/zone-nativescript";
33

44
import 'reflect-metadata';
55
import './polyfills/array';

0 commit comments

Comments
 (0)