This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 405
build: make legacy standalone bundle #1201
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| { | ||
| "targets": [ | ||
| { | ||
| "path": "dist/zone.min.js", | ||
| "path": "dist/zone-evergreen.min.js", | ||
| "checkTarget": true, | ||
| "limit": 43000 | ||
| }, | ||
| { | ||
| "path": "dist/zone.min.js", | ||
| "checkTarget": true, | ||
| "limit": 44000 | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| */ | ||
| export function patchCallbacks( | ||
| api: _ZonePrivate, target: any, targetName: string, method: string, callbacks: string[]) { | ||
| const symbol = Zone.__symbol__(method); | ||
| if (target[symbol]) { | ||
| return; | ||
| } | ||
| const nativeDelegate = target[symbol] = target[method]; | ||
| target[method] = function(name: any, opts: any, options?: any) { | ||
| if (opts && opts.prototype) { | ||
| callbacks.forEach(function(callback) { | ||
| const source = `${targetName}.${method}::` + callback; | ||
| const prototype = opts.prototype; | ||
| if (prototype.hasOwnProperty(callback)) { | ||
| const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback); | ||
| if (descriptor && descriptor.value) { | ||
| descriptor.value = api.wrapWithCurrentZone(descriptor.value, source); | ||
| api._redefineProperty(opts.prototype, callback, descriptor); | ||
| } else if (prototype[callback]) { | ||
| prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source); | ||
| } | ||
| } else if (prototype[callback]) { | ||
| prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| return nativeDelegate.call(target, name, opts, options); | ||
| }; | ||
|
|
||
| api.attachOriginToPatched(target[method], nativeDelegate); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to add
__zone_symbol__legacyPatchto the global? Who invokes that function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, here is the flow.
browser-legacy.js, and register this factory function in global.zone-evergreen.js, and call this__zone_symbol__legacyPatchhere, https://github.com/angular/zone.js/pull/1201/files#diff-75082c639aefcc47b3b8df57c8870867R23, so the legacy patch can be loaded after thecommon logic of zoneis loaded.