Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
8b81537
fix: use fetch(about://blank) to prevent exception on MS Edge (#442)
mhevery Sep 14, 2016
7a66237
chore: Release v0.6.22
mhevery Sep 14, 2016
3844435
fix(fetch): correct chrome not able to load about://blank
mhevery Sep 14, 2016
473f01c
chore: Release v0.6.23
mhevery Sep 14, 2016
0ea20fa
test: add edge to sauce config (#441)
jeffbcross Sep 15, 2016
8dd06e5
fix(bundling): switch to using umd bundles (#457)
juliemr Sep 19, 2016
262d13a
chore: release v0.6.24 (#459)
juliemr Sep 19, 2016
28a14f8
fix(zonespecs): revert unwrapping of zonespecs which actually require…
juliemr Sep 20, 2016
0c3ce2e
chore: 0.6.25 release
juliemr Sep 20, 2016
737f8d8
fix(promise): include stack trace in an unhandlerd promise (#463)
mhevery Sep 20, 2016
51f2e1f
fix(property-descriptor): do not use document object in Safari web wo…
urimor Aug 24, 2016
7da0c52
fix(safari) - webworker objects have no .hasOwnProperty method, use
nadavsinai Sep 28, 2016
b52cf02
fix: stop using class extends as it breaks rollup
mhevery Sep 30, 2016
a85db4c
fix: run all timers in passage of time in a single fakeAsync's tick call
kasiditi Sep 17, 2016
16be7f9
fix: make fetch promise patching safe
marclaval Sep 22, 2016
2cad6b3
build: add a gulp lint task
vicb Oct 2, 2016
ed87c26
fix: lint errors
vicb Oct 2, 2016
3ffc664
build: add a clang-format task
vicb Oct 2, 2016
0bc6035
style: format ts files
vicb Oct 2, 2016
63bca67
refactor: add copyright header to source files
vicb Oct 2, 2016
fea6d68
fix: support clearing the timeouts with numeric IDs
platosha Sep 20, 2016
abaac6f
test(setTimeout): use explicit timeout delays where order matters
platosha Oct 7, 2016
431f6f0
fix(node): crash when calling listeners() for event with no listeners
alxhub Oct 12, 2016
21935e8
chore: bump npm version to 0.6.26
alxhub Oct 18, 2016
c5130a6
fix: fluent interface for EventEmitter (#475)
jtmalinowski Nov 3, 2016
41a9047
feat: add mocha support
nording Nov 15, 2016
cf7dd6d
docs(readme): add note about newrelic (#486)
PatrickJS Nov 16, 2016
d8c15eb
fix: Add WebSocket to the NO_EVENT_TARGET list to be patched as well …
woppa684 Nov 16, 2016
c69df25
fix: Make the check for ZoneAwarePromise more stringent (#495)
markandrus Nov 16, 2016
1f2ebc7
chore: Add CDNJS version badge in readme (#497)
kennynaoh Nov 16, 2016
eff3353
Fix EventEmitter.once issue and add EventEmitter removeAllListeners p…
JiaLiPassion Nov 16, 2016
f79c179
chore: explicitly load zone.js (instead from system.js)
mhevery Nov 18, 2016
dd8aa15
chore: remove duplicate tests in Promise spec.
mhevery Nov 18, 2016
e1c2a02
feat(Error): Rewrite Error stack frames to include zone
mhevery Nov 18, 2016
4b4249c
fix: use strict equality in scheduleQueueDrain (#504)
Nov 19, 2016
3b94918
chore: update README.md
mhevery Nov 19, 2016
d7d8eb5
fix: fix wrong usage of == caught by closure compiler (#510)
vikerman Nov 22, 2016
cd727ff
chore: bump npm version to 0.7.0
mhevery Nov 22, 2016
e961833
fix: missing zone from the build file
mhevery Nov 22, 2016
402971a
chore: bump npm version to 0.7.1
mhevery Nov 22, 2016
94c33d1
docs(changelog): use conventional changelog (#517)
ocombe Dec 1, 2016
c36c0bc
feat: Patch captureStackTrace/prepareStackTrace to ZoneAwareError, pa…
JiaLiPassion Dec 5, 2016
5a94259
build(tslint): enable no-inner-declarations
vicb Dec 8, 2016
b1e2062
refactor: lint & format
vicb Dec 8, 2016
f522e1b
fix: parameterize `wrap` method on `Zone` (#542)
mhevery Dec 13, 2016
af14646
fix(closure): avoid property renaming on globals
alexeagle Dec 15, 2016
2594817
chore(release): update dist
alexeagle Dec 16, 2016
9509747
fix: Prevent adding listener for xhrhttprequest multiple times
JiaLiPassion Dec 18, 2016
486010b
fix: support nw.js environment
adros Dec 18, 2016
dc12d8e
fix: correct currentZone passed into delegate methods
JiaLiPassion Dec 18, 2016
1bff7c0
chore: add reconnect options in sauce shell
JiaLiPassion Dec 18, 2016
ba7858c
fix: Correct ZoneAwareError prototype chain
JiaLiPassion Dec 18, 2016
0fd8c03
refactor: add generic patch eventtarget method
JiaLiPassion Dec 18, 2016
20b5a5d
fix: inline event handler issue
JiaLiPassion Dec 18, 2016
c0604f5
fix: Run tests on both the build as well as the dist folder (#514)
mhevery Dec 18, 2016
50b168a
chore: enforce source format
mhevery Dec 19, 2016
610649b
fix: add better Type safety
mhevery Dec 19, 2016
384f5ec
fix: correct zone.min.js not including zone
Nov 24, 2016
130bde6
chore: enforce source format
mhevery Dec 19, 2016
8f9a5d2
chore: release v0.7.3
mhevery Dec 19, 2016
2643783
fix(closure): Fix closure error suppression comment. (#552)
vikerman Dec 20, 2016
c70e9ec
fix: formatting issue.
mhevery Dec 20, 2016
a22a687
Revert "fix: Correct ZoneAwareError prototype chain" (#556)
chuckjaz Dec 20, 2016
1de7ea0
chore: release v0.7.4
chuckjaz Dec 20, 2016
5c7bc01
fix: add missing test MutationObserver
mhevery Dec 22, 2016
f854ce0
fix: Promise.toString() to look like native function
mhevery Dec 23, 2016
3c7d62d
style: lint & format
vicb Dec 28, 2016
68f7408
style: update tslint & add rules
vicb Dec 28, 2016
bbd3782
refactor: ban the var keyword (use let or const instead)
vicb Dec 28, 2016
c03acda
build: enforce no var keyword
vicb Dec 28, 2016
406e231
docs: fix a typo in API docs (#568)
laurentgoudet Dec 29, 2016
82722c3
fix(ZoneAwareError): Error should keep prototype chain and can be cal…
JiaLiPassion Jan 6, 2017
1ad71b0
update CHANGELOG.md to 0.7.4
JiaLiPassion Dec 31, 2016
c000b05
update README.md to add conflict explaination with other libs (#587)
JiaLiPassion Jan 12, 2017
ecbef87
docs(zone.ts): fix typo (#583)
lightningtgc Jan 12, 2017
fb8d51c
Fix #532, Fix #566, add tslint in ci, add tslint/format/test/karma in…
JiaLiPassion Jan 12, 2017
7cd570e
fix #584, remove android 4.1~4.3, add no-ssl options to make android …
JiaLiPassion Jan 12, 2017
e92f934
add web-api.ts to patch mediaQuery (#571)
JiaLiPassion Jan 12, 2017
62f1449
fix #569, request will cause updateTaskCount failed if we call abort …
JiaLiPassion Jan 12, 2017
41f5306
fix #574, captureStackTrace will have additional stackframe from Zone…
JiaLiPassion Jan 12, 2017
03d19f9
fix #551, add toJSON to ZoneTask to prevent cyclic error (#576)
JiaLiPassion Jan 12, 2017
c297752
fix #577, canPatchViaPropertyDescriptor test should add configurable …
JiaLiPassion Jan 12, 2017
e1d3240
patch fs methods as macrotask, add test cases of fs watcher (#572)
JiaLiPassion Jan 12, 2017
c00abdb
chore: release v0.7.5
mhevery Jan 12, 2017
95ad315
fix(doc): typo in comment and reformat README.md (#590)
JiaLiPassion Jan 17, 2017
e3cd1f4
fix: #604, sometimes setInterval test spec will fail on Android 4.4 (…
JiaLiPassion Jan 17, 2017
83dfa97
fix: #536, add notification api patch (#599)
JiaLiPassion Jan 17, 2017
f7330de
fix: #595, refactor ZoneAwareError property copy (#597)
JiaLiPassion Jan 17, 2017
1401d60
fix: #593, only call removeAttribute when have the method (#594)
JiaLiPassion Jan 17, 2017
787b636
chore: release v0.7.6
mhevery Jan 12, 2017
33d0d8d
fix(minification): fix #607 to change catch variable name to error/er…
JiaLiPassion Jan 23, 2017
437ab4e
docs: Document non standard web apis (#610)
JiaLiPassion Jan 23, 2017
7665e5a
test(fix): fix flaky test setInterval in android 4.4 (#611)
JiaLiPassion Jan 23, 2017
9e81037
fix(node): patch crypto as macroTask and add test cases for crypto, r…
JiaLiPassion Jan 23, 2017
ac7b046
feat(promise a+) fix #591, make ZoneAwarePromise pass promise a+ test…
JiaLiPassion Jan 23, 2017
6d31734
feat(electron/nw): fix #533, in electron/nw.js, we may need to patch …
JiaLiPassion Jan 23, 2017
9818139
feat: add Zone.root api (#601)
JiaLiPassion Feb 7, 2017
d6772e2
refactor(node): patch nextTick with more general patchMicroTask metho…
JiaLiPassion Feb 7, 2017
6731ad0
feat: make fetch() zone-aware without triggering extra requests or un…
MichaelBuerge Feb 7, 2017
35aeb68
docs(core): remove old example, update counting example with new API …
JiaLiPassion Feb 7, 2017
f300658
docs(core): add standard api document (#625)
JiaLiPassion Feb 7, 2017
47962df
fix(patch): check timer patch return undefined (#628)
JiaLiPassion Feb 7, 2017
f3547cc
feat(promise): fix #621, add unhandledRejection handler and ignore co…
JiaLiPassion Feb 8, 2017
76c6ebf
feat: allow tasks to be canceled and rescheduled on different zone in…
mhevery Feb 14, 2017
12ecc02
chore: suppress closure compiler warnings
alexeagle Feb 15, 2017
c07560f
fix(zonespec): don't throw and exception when setInterval is called w…
vikerman Feb 15, 2017
14c7a6f
fix(task): findEventTask should return Task array (#633)
JiaLiPassion Feb 17, 2017
0534b19
fix(core): remove debugger (#639)
JiaLiPassion Mar 7, 2017
eb9250d
fix(task): fix #638, eventTask/Periodical task should not be reset af…
JiaLiPassion Mar 7, 2017
fcd8be5
fix(patch): fix #618, use zoneSymbol as property name to avoid name c…
JiaLiPassion Mar 7, 2017
84459f1
fix(package): use fixed version typescript,clang-format and jasmine (…
JiaLiPassion Mar 7, 2017
36c0899
fix(xhr): fix #657, sometimes xhr will fire onreadystatechange with d…
JiaLiPassion Mar 7, 2017
96cb3d0
fix(jasmine): support "pending" `it` clauses with no test body
petebacondarwin Mar 3, 2017
f3b8885
chore: fix formatting
mhevery Mar 7, 2017
e783bfa
feat(bluebird): patch bluebird promise and treat it as microtask (#655)
JiaLiPassion Mar 7, 2017
2594940
fix(timers): cleanup task reference when exception (#637)
bsergei Mar 7, 2017
2d30914
fix(error): fix #618, ZoneAwareError should copy Error's static prope…
JiaLiPassion Mar 8, 2017
a4c6525
feat(longStackTraceSpec): handled promise rejection can also render l…
JiaLiPassion Mar 10, 2017
8b2543e
fix(webapi): refactor webapi to not import util.ts directly
JiaLiPassion Mar 7, 2017
ce47cfb
chore: release v0.7.8
mhevery Mar 10, 2017
54c8d35
feat(TypeScript): support TypeScript v2.2.1
mhevery Mar 10, 2017
d3c59d0
chore: make type checking stricter
mhevery Mar 10, 2017
8db0159
chore: release v0.8.0
mhevery Mar 10, 2017
300dc36
fix(XHR): fix #671, patch XMLHttpRequestEventTarget prototype
JiaLiPassion Mar 12, 2017
a63ae5f
fix(example): Update counting.html (#648)
Mar 13, 2017
76fa891
feat(error): remove zone internal stack frames in error.stack (#632)
JiaLiPassion Mar 13, 2017
ef39a44
feat(task): add task lifecycle doc and testcases to explain task stat…
JiaLiPassion Mar 13, 2017
2a7dd7b
chore: release v0.8.1
mhevery Mar 13, 2017
8322be8
fix(zone): fix #674, handle error.stack readonly case (#675)
JiaLiPassion Mar 14, 2017
2e4cca5
chore: release v0.8.2
mhevery Mar 14, 2017
f742394
fix(zone): consistent access to __symbol__ to work with closure
mhevery Mar 15, 2017
8f6ddf3
chore: release v0.8.3
mhevery Mar 15, 2017
0e19304
fix: correct declaration which breaks closure
mhevery Mar 15, 2017
bcd09a0
fix: stack rewriting now works with source maps
mhevery Mar 16, 2017
ffb2ab1
chore: release v0.8.4
mhevery Mar 16, 2017
eeaab91
fix: remove left over console.log
mhevery Mar 17, 2017
6010557
fix: improve long-stack-trace stack format detection
mhevery Mar 17, 2017
81297ee
fix: add support for subclassing of Errors
mhevery Mar 17, 2017
5c4e24d
fix(event): fix #667, eventHandler should return result (#682)
JiaLiPassion Mar 17, 2017
5635ac0
fix(jasmine): modify jasmine test ifEnvSupports message (#689)
JiaLiPassion Mar 21, 2017
61aee2e
feat(dom): fix #664, patch window,document,SVGElement onProperties (#…
JiaLiPassion Mar 21, 2017
291d5a0
fix(REVERT): remove zone internal stack frames in error.stack (#632) …
mhevery Mar 21, 2017
e11d9ff
chore: release v0.8.5
mhevery Mar 21, 2017
0d0ee53
fix(toString): fix #666, Zone patched method toString should like bef…
JiaLiPassion Mar 22, 2017
e02960d
fix(listener): fix #616, webdriver removeEventListener throw permissi…
JiaLiPassion Apr 10, 2017
84ff8db
docs: fixed a typo in documentation (#695)
zzx88991 Apr 10, 2017
967a991
fix(typo): fix typo, remove extra semicolons, unify api doc (#697)
JiaLiPassion Apr 10, 2017
88d1a49
fix(error): remove throw in Error constructor to improve performance …
JiaLiPassion Apr 10, 2017
2de7ef0
ci(SauceLabs): refresh browsers list (#716)
marclaval Apr 10, 2017
92a39e2
fix(task): fix #705, don't json task.data to prevent cyclic error (#712)
JiaLiPassion Apr 10, 2017
160531b
fix(patch): fix #719, window onproperty callback this is undefined (#…
JiaLiPassion Apr 10, 2017
e422fb1
fix(patch): fix #707, should not try to patch non configurable proper…
JiaLiPassion Apr 10, 2017
06d1ac0
fix(error): fix #706, handleError when onHasTask throw error (#709)
JiaLiPassion Apr 10, 2017
681a017
feat(error): Remove all Zone frames from stack (#693)
JiaLiPassion Apr 10, 2017
b60e9e6
feat(closure): fix #727, add zone_externs.js for closure compiler (#731)
JiaLiPassion Apr 17, 2017
e9f68be
docs: fix a typo in STANDARD-APIS.md (#742)
jsong0605 Apr 21, 2017
a89830d
feat(EventListenerOptions): fix #737, add support to EventListenerOpt…
JiaLiPassion Apr 21, 2017
2f11e67
feat(patch): fix #499, let promise instance toString active like nati…
JiaLiPassion Apr 21, 2017
5090cf9
fix(test): fix websocket test server will crash when test in chrome (…
JiaLiPassion Apr 21, 2017
55cf064
fix(doc): fix typo in document, fix a typescript warning in test (#732)
JiaLiPassion Apr 21, 2017
0a06874
fix(test): fix #718, use async test to do unhandle promise rejection …
JiaLiPassion Apr 21, 2017
7d4d07f
fix(patch): fix #708, modify the canPatchDescriptor logic when browse…
JiaLiPassion Apr 21, 2017
51e7ffe
fix: resolve errors with closure (#722)
vikerman Apr 4, 2017
0829316
chore: release v0.8.6
mhevery Apr 21, 2017
917893b
chore: release v0.8.7
mhevery Apr 21, 2017
0e2ead2
chore: add support for .editorconfig
mhevery Apr 21, 2017
fbe7b13
fix: on<property> handling broken in v0.8.7
mhevery Apr 21, 2017
7b43b51
chore: release v0.8.8
mhevery Apr 21, 2017
e598310
fix(patch): fix #746, check desc get is null and only patch window.re…
JiaLiPassion Apr 25, 2017
89132fd
chore: release v0.8.9
mhevery Apr 25, 2017
e933cbd
feat: make codebase more modular so that only parts of it can be load…
mhevery Apr 26, 2017
bb6aadc
Add a `flush` method to the FakeAsync zone spec (#755)
juliemr Apr 26, 2017
97c03b5
feat(patch): load non standard api with new load module method (#764)
JiaLiPassion May 2, 2017
4baeb5c
fix(showError): fix ignoreConsoleErrorUncaughtError may change during…
JiaLiPassion May 2, 2017
f8d17ac
fix(spec): fix #760, fakeAsyncTestSpec should handle microtask with a…
JiaLiPassion May 2, 2017
b48db54
feat: turn more code into Zone modules (#761)
mhevery May 2, 2017
b5e33fd
fix: Package Error stack rewriting as a separate bundle. (#770)
mhevery May 3, 2017
d94dc65
don't save handleIds for node (#736)
manuelschneider May 3, 2017
3218b5a
fix(timer): fix #437, #744, fix nativescript timer issue, fix nodejs …
JiaLiPassion May 3, 2017
1d422f2
chore: release v0.8.10
mhevery May 3, 2017
82d4133
refactor(private): move help method to _ZonePrivate (#785)
JiaLiPassion May 19, 2017
245f8e9
fix(webcomponents): fix #782, fix conflicts with shadydom of webcompo…
JiaLiPassion May 19, 2017
b7238c8
fix(task): fix #778, sometimes task will run after being canceled (#780)
JiaLiPassion May 19, 2017
7ad3070
doc(module): add document for new module system and how to disable fe…
JiaLiPassion May 19, 2017
582ff7b
fix(closure): patchOnProperty with exact eventNames as possible (#768)
JiaLiPassion May 19, 2017
89f990a
fix(patch): fix #744, add namespace to load patch name (#774)
JiaLiPassion May 19, 2017
1919b36
fix: access `process` through `_global` so that WebPack does not acci…
mhevery May 19, 2017
b92b6e3
chore: release v0.8.11
mhevery May 19, 2017
0c5da04
fix(doc): fix #793, fix confuse bluebird patch doc (#794)
JiaLiPassion Jun 2, 2017
67634ae
fix(patch): fix #791, fix mediaQuery/Notification patch use wrong glo…
JiaLiPassion Jun 2, 2017
7ca3995
feat(patch): fix #696, patch HTMLCanvasElement.toBlob as MacroTask (#…
JiaLiPassion Jun 2, 2017
857929d
feat(patch): fix #758, patch cordova.exec success/error with zone.wra…
JiaLiPassion Jun 3, 2017
7bd1418
fix(xhr): inner onreadystatechange should not triigger Zone callback …
JiaLiPassion Jun 5, 2017
68aa03e
fix(toString): fix #802, fix ios 9 MutationObserver toString error (#…
JiaLiPassion Jun 7, 2017
3511159
chore: release v0.8.12
mhevery Jun 7, 2017
8260f1d
fix(spec): fakeAsyncTestSpec should handle requestAnimationFrame (#805)
vikerman Jun 11, 2017
3a017d3
perf: Add addEventListener benchmark
mhevery Jun 12, 2017
f439fe2
fix(promise): fix #806, remove duplicate consolelog (#807)
JiaLiPassion Jun 14, 2017
98f3903
refactor(util): replace zoneSymbol with Zone.__symbol__ (#809)
JiaLiPassion Jun 16, 2017
b3a76d3
feat(eventListener): fix #798, improve EventTarget.addEventListener p…
JiaLiPassion Jun 30, 2017
fabddd8
strongloop/zone library is now deprecated (#825)
m0uneer Jul 6, 2017
047d9b2
feat(saucelab): integrate saucelab webdriver test. (#819)
JiaLiPassion Jul 6, 2017
273cb85
fix(websocket): fix #824, patch websocket onproperties correctly in P…
JiaLiPassion Jul 12, 2017
667cd6f
fix(spec): FakeAsyncTestZoneSpec.flush() passes limit along to schedu…
nertzy Jul 12, 2017
79baffb
chore: release v0.8.13
mhevery Jul 12, 2017
3a4bfbd
fix(task): fix #832, fix #835, task.data should be an object (#834)
JiaLiPassion Jul 14, 2017
f301fa2
fix(event): fix #836, handle event callback call removeEventListener …
JiaLiPassion Jul 14, 2017
2143d9c
fix(event): fix memory leak for once, add more test cases (#841)
JiaLiPassion Jul 17, 2017
5a010c6
chore: release v0.8.14
mhevery Jul 18, 2017
ab82852
chore: refactor closure build (#844)
JiaLiPassion Jul 20, 2017
1ed83d0
feat(rxjs): fix #830, monkey patch rxjs to make rxjs run in correct z…
JiaLiPassion Jul 20, 2017
ccf002d
chore: release v0.8.15
mhevery Jul 20, 2017
eca04b0
fix(spec): do not count requestAnimationFrame as a pending timer (#854)
vikerman Jul 25, 2017
5c5ca1a
feat(spec): add an option to FakeAsyncTestZoneSpec to flush periodic …
vikerman Jul 27, 2017
5900d3a
fix(console): console.log in nodejs should run in root Zone (#855)
JiaLiPassion Jul 27, 2017
6e44cab
fix(promise): fix #850, check Promise.then writable (#851)
JiaLiPassion Jul 27, 2017
b0c5076
chore: release v0.8.16
mhevery Jul 27, 2017
4032ddf
fix(node): remove reference to 'noop' (#865)
vikerman Aug 4, 2017
0d12a27
fix(websocket), fix #862, in old safari, patchEventTarget for WebSock…
JiaLiPassion Aug 4, 2017
deae751
fix: suppress closure warnings/errors (#861)
vikerman Aug 4, 2017
7fbd655
fix: readonly property should not be patched (#860)
JiaLiPassion Aug 4, 2017
02cd40e
feat(spec): add a 'tick' callback to flush() (#866)
vikerman Aug 7, 2017
cbc58c1
fix(rxjs): fix #863, fix asap scheduler issue, add testcases (#848)
JiaLiPassion Aug 8, 2017
31d38c1
fix(patch): fix #869, should not patch readonly method (#871)
JiaLiPassion Aug 8, 2017
a66595a
feat(performance): onProperty handler use global wrapFn, other perfor…
JiaLiPassion Aug 12, 2017
a03b84b
fix(task): fix closure compatibility issue with ZoneDelegate._updateT…
qiyigg Aug 17, 2017
eed776c
fix(spec): fix flush() behavior in handling periodic timers (#881)
vikerman Aug 18, 2017
7ee8bcd
feat(performance): reuse microTaskQueue native promise (#874)
JiaLiPassion Aug 23, 2017
fcf187c
fix(module): fix #875, can disable requestAnimationFrame (#876)
JiaLiPassion Aug 23, 2017
b1e5970
feat(cordova): fix #868, patch cordova FileReader (#879)
JiaLiPassion Aug 23, 2017
f27ff14
feat(patch): fix #833, add IntersectionObserver support (#880)
JiaLiPassion Aug 23, 2017
a733688
feat(onProperty): fix #875, can disable patch specified onProperties …
JiaLiPassion Aug 23, 2017
ce3f12f
fix(rxjs): asap should runGuarded to let error inZone (#884)
JiaLiPassion Aug 23, 2017
b9c0d9c
chore: release v0.8.17
mhevery Aug 23, 2017
874bfdc
feat(spec): log URL in error when attempting XHR from FakeAsyncTestZo…
vikerman Sep 6, 2017
d4e5ae8
fix(patch): patchOnProperty getter should return original listener (#…
JiaLiPassion Sep 6, 2017
8d27f23
chore: update saucelabs config to latest version (#896)
JiaLiPassion Sep 13, 2017
aec4bd4
fix(timer): fix #314, setTimeout/interval should return original time…
JiaLiPassion Sep 13, 2017
e999593
feat(compile): fix #892, upgrade to typescript 2.3.4, support for...o…
JiaLiPassion Sep 13, 2017
956c729
fix(promise): can set native promise after loading zone.js (#899)
JiaLiPassion Sep 15, 2017
dcc285a
fix(event): should handle event.stopImmediatePropagration (#903)
JiaLiPassion Sep 15, 2017
5c8828e
docs: fix grammar and spelling mistakes (#895)
jeromepl Sep 15, 2017
8718e07
fix(event): EventTarget of SourceBuffer in samsung tv will have null …
JiaLiPassion Sep 17, 2017
6f74efb
fix(event): fix #883, fix RTCPeerConnection Safari event not triggere…
JiaLiPassion Sep 17, 2017
7ef13a7
Add newline to separate @fileoverview comment from a node. (#912)
LucasSloan Sep 20, 2017
418a583
fix(patch): Worker should patch onProperties (#915)
JiaLiPassion Sep 27, 2017
4ba5d97
fix(event): fix #911, in IE, event handler event maybe undefined (#913)
JiaLiPassion Sep 27, 2017
e5fa562
hore: release v0.8.18
mhevery Sep 27, 2017
6cdb6e8
feat(nativescript): Add a separate zone-nativescript entrypoint
hdeshev Sep 13, 2016
f7f3183
feat(testing): add mocha and jasmine patch outputs for nativescript
justindujardin Oct 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
15 changes: 13 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
sudo: false
node_js:
- '4.2.1'
- '6.3.1'
env:
global:
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
Expand All @@ -22,5 +22,16 @@ before_script:
- ./scripts/sauce/sauce_connect_block.sh

script:
- node_modules/.bin/karma start karma-sauce.conf.js --single-run
- node_modules/.bin/gulp lint
- node_modules/.bin/gulp format:enforce
- node_modules/.bin/gulp build
- scripts/closure/closure_compiler.sh
- node_modules/.bin/gulp promisetest
- npm run test:phantomjs-single
- node_modules/.bin/karma start karma-dist-sauce-jasmine.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-mocha.conf.js --single-run
- node_modules/.bin/karma start karma-dist-sauce-selenium3-jasmine.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-selenium3-mocha.conf.js --single-run
- node_modules/.bin/gulp test/node
- node simple-server.js 2>&1> server.log&
- node ./test/webdriver/test.sauce.js
1,102 changes: 1,102 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,63 @@ Run the browser tests using Karma:
Run the node.js tests:

`npm run test-node`

Run tslint:

`npm run lint`

Run format with clang-format:

`npm run format`

Run all checks (lint/format/browser test/test-node):

`npm run ci`

Before Commit
------------

Please make sure you pass all following checks before commit

- gulp lint (tslint)
- gulp format:enforce (clang-format)
- gulp promisetest (promise a+ test)
- npm test (karma browser test)
- gulp test-node (node test)

You can run

`npm run ci`

to do all those checks for you.
You can also add the script into your git pre-commit hook

```
echo -e 'exec npm run ci' > .git/hooks/pre-commit
chmod u+x .git/hooks/pre-commit
```

Webdriver Test
--------------

`zone.js` also supports running webdriver e2e tests.

1. run locally

```
npm run webdriver-start
npm run webdriver-http
npm run webdriver-test
```

2. run locally with sauce connect

```
// export SAUCE_USERNAME and SAUCE_ACCESS_KEY
export SAUCE_USERNAME=XXXX
export SAUCE_ACCESS_KEY=XXX

sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY
npm run webdriver-http
npm run webdriver-sauce-test
```
88 changes: 88 additions & 0 deletions MODULE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Modules

Starting from zone.js v0.8.9, you can choose which web API modules you want to patch as to reduce overhead introduced by the patching of these modules. For example,
the below samples show how to disable some modules. You just need to define a few global variables
before loading zone.js.

```
<script>
__Zone_disable_Error = true; // Zone will not patch Error
__Zone_disable_on_property = true; // Zone will not patch onProperty such as button.onclick
__Zone_disable_geolocation = true; // Zone will not patch geolocation API
__Zone_disable_toString = true; // Zone will not patch Function.prototype.toString
__Zone_disable_blocking = true; // Zone will not patch alert/prompt/confirm
__Zone_disable_PromiseRejectionEvent = true; // Zone will not patch PromiseRejectionEventHandler
</script>
<script src="../dist/zone.js"></script>
```

Below is the full list of currently supported modules.

- Common

|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|Error|stack frames will have the Zone's name information, (By default, Error patch will not be loaded by zone.js)|__Zone_disable_Error = true|
|toString|Function.toString will be patched to return native version of toString|__Zone_disable_toString = true|
|ZoneAwarePromise|Promise.then will be patched as Zone aware MicroTask|__Zone_disable_ZoneAwarePromise = true|
|bluebird|Bluebird will use Zone.scheduleMicroTask as async scheduler. (By default, bluebird patch will not be loaded by zone.js)|__Zone_disable_bluebird = true|

- Browser

|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|on_property|target.onProp will become zone aware target.addEventListener(prop)|__Zone_disable_on_property = true|
|timers|setTimeout/setInterval/setImmediate will be patched as Zone MacroTask|__Zone_disable_timer = true|
|requestAnimationFrame|requestAnimationFrame will be patched as Zone MacroTask|__Zone_disable_requestAnimationFrame = true|
|blocking|alert/prompt/confirm will be patched as Zone.run|__Zone_disable_blocking = true|
|EventTarget|target.addEventListener will be patched as Zone aware EventTask|__Zone_disable_EventTarget = true|
|IE BrowserTools check|in IE, browser tool will not use zone patched eventListener|__Zone_disable_IE_check = true|
|CrossContext check|in webdriver, enable check event listener is cross context|__Zone_enable_cross_context_check = true|
|XHR|XMLHttpRequest will be patched as Zone aware MacroTask|__Zone_disable_XHR = true|
|geolocation|navigator.geolocation's prototype will be patched as Zone.run|__Zone_disable_geolocation = true|
|PromiseRejectionEvent|PromiseRejectEvent will fire when ZoneAwarePromise has unhandled error|__Zone_disable_PromiseRejectionEvent = true|
|mediaQuery|mediaQuery addListener API will be patched as Zone aware EventTask. (By default, mediaQuery patch will not be loaded by zone.js) |__Zone_disable_mediaQuery = true|
|notification|notification onProperties API will be patched as Zone aware EventTask. (By default, notification patch will not be loaded by zone.js) |__Zone_disable_notification = true|

- NodeJS

|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|node_timers|NodeJS patch timer|__Zone_disable_node_timers = true|
|fs|NodeJS patch fs function as macroTask|__Zone_disable_fs = true|
|EventEmitter|NodeJS patch EventEmitter as Zone aware EventTask|__Zone_disable_EventEmitter = true|
|nextTick|NodeJS patch process.nextTick as microTask|__Zone_disable_nextTick = true|
|handleUnhandledPromiseRejection|NodeJS handle unhandledPromiseRejection from ZoneAwarePromise|__Zone_disable_handleUnhandledPromiseRejection = true|
|crypto|NodeJS patch crypto function as macroTask|__Zone_disable_crypto = true|

- on_property

You can also disable specific on_properties by setting `__Zone_ignore_on_properties` as follows: for example,
if you want to disable `window.onmessage` and `HTMLElement.prototype.onclick` from zone.js patching,
you can do like this.

```
<script>
__Zone_ignore_on_properties = [
{
target: window,
ignoreProperties: ['message']
}, {
target: HTMLElement.prototype,
ignoreProperties: ['click']
}
];
</script>
<script src="../dist/zone.js"></script>
```

- Angular(2+)

Angular uses zone.js to manage async operations and decide when to perform change detection. Thus, in Angular,
the following APIs should be patched, otherwise Angular may not work as expected.

1. ZoneAwarePromise
2. timer
3. on_property
4. EventTarget
5. XHR
162 changes: 162 additions & 0 deletions NON-STANDARD-APIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Zone.js's support for non standard apis

Zone.js patched most standard APIs such as DOM event listeners, XMLHttpRequest in Browser, EventEmitter and fs API in Node.js so they can be in zone.

But there are still a lot of non standard APIs that are not patched by default, such as MediaQuery, Notification,
WebAudio and so on. We are adding support to those APIs, and our progress is updated here.

## Currently supported non standard Web APIs

* MediaQuery
* Notification

## Currently supported polyfills

* webcomponents

Usage:

```
<script src="webcomponents-lite.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/zone.js/dist/webapis-shadydom.js"></script>
```

## Currently supported non standard node APIs

## Currently supported non standard common APIs

* bluebird promise

Browser Usage:

```
<script src="zone.js"></script>
<script src="bluebird.js"></script>
<script src="zone-bluebird.js"></script>
<script>
Zone[Zone['__symbol__']('bluebird')](Promise);
</script>
```

After those steps, window.Promise will become a ZoneAware Bluebird Promise.

Node Sample Usage:

```
require('zone.js');
const Bluebird = require('bluebird');
require('zone.js/dist/zone-bluebird');
Zone[Zone['__symbol__']('bluebird')](Bluebird);
Zone.current.fork({
name: 'bluebird'
}).run(() => {
Bluebird.resolve(1).then(r => {
console.log('result ', r, 'Zone', Zone.current.name);
});
});
```

In NodeJS environment, you can choose to use Bluebird Promise as global.Promise
or use ZoneAwarePromise as global.Promise.

To run the jasmine test cases of bluebird

```
npm install bluebird
```

then modify test/node_tests.ts
remove the comment of the following line

```
//import './extra/bluebird.spec';
```

## Others

* Cordova

patch `cordova.exec` API

`cordova.exec(success, error, service, action, args);`

`success` and `error` will be patched with `Zone.wrap`.

to load the patch, you should load in the following order.

```
<script src="zone.js"></script>
<script src="cordova.js"></script>
<script src="zone-patch-cordova.js"></script>
```

## Usage

By default, those APIs' support will not be loaded in zone.js or zone-node.js,
so if you want to load those API's support, you should load those files by yourself.

For example, if you want to add MediaQuery patch, you should do like this:

```
<script src="path/zone.js"></script>
<script src="path/webapis-media-query.js"></script>
```

* rxjs

`zone.js` also provide a `rxjs` patch to make sure rxjs Observable/Subscription/Operator run in correct zone.
For details please refer to [pull request 843](https://github.com/angular/zone.js/pull/843). The following sample code describes the idea.

```
const constructorZone = Zone.current.fork({name: 'constructor'});
const subscriptionZone = Zone.current.fork({name: 'subscription'});
const operatorZone = Zone.current.fork({name: 'operator'});

let observable;
let subscriber;
constructorZone.run(() => {
observable = new Observable((_subscriber) => {
subscriber = _subscriber;
console.log('current zone when construct observable:', Zone.current.name); // will output constructor.
return () => {
console.log('current zone when unsubscribe observable:', Zone.current.name); // will output constructor.
}
});
});

subscriptionZone.run(() => {
observable.subscribe(() => {
console.log('current zone when subscription next', Zone.current.name); // will output subscription.
}, () => {
console.log('current zone when subscription error', Zone.current.name); // will output subscription.
}, () => {
console.log('current zone when subscription complete', Zone.current.name); // will output subscription.
});
});

operatorZone.run(() => {
observable.map(() => {
console.log('current zone when map operator', Zone.current.name); // will output operator.
});
});
```

Currently basically everything the `rxjs` API includes

- Observable
- Subscription
- Subscriber
- Operators
- Scheduler

is patched, so each asynchronous call will run in the correct zone.

## Usage.

For example, in an Angular application, you can load this patch in your `app.module.ts`.

```
import 'zone.js/dist/zone-patch-rxjs';
```

Loading