This repository was archived by the owner on Feb 26, 2024. It is now read-only.
build: make legacy standalone bundle#1201
Merged
mhevery merged 1 commit intoangular:masterfrom Mar 19, 2019
Merged
Conversation
ba3a022 to
d6140e1
Compare
d6140e1 to
081644b
Compare
mhevery
reviewed
Mar 15, 2019
| registerElementPatch(global); | ||
| }); | ||
| (function(_global: any) { | ||
| _global['__zone_symbol__legacyPatch'] = function() { |
Contributor
There was a problem hiding this comment.
Why is it necessary to add __zone_symbol__legacyPatch to the global? Who invokes that function?
Collaborator
Author
There was a problem hiding this comment.
Yeah, here is the flow.
- loading
browser-legacy.js, and register this factory function in global. - loading
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.
mhevery
approved these changes
Mar 19, 2019
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In
angular cli, there is a file namedes2015-polyfill.js, inside this file, allpolyfillfores5 legacy browserswill be there, so withzone evergreen bundle, the most idle way to handle this is.zone-legacy.jsinsidees2015-polyfill.js.zone-evergreen.jsinsidepolyfill.ts.So
es5 legacy browser, it will loadzone-legacy.js+zone-evergreen.js.modern browser, it will only loadzone-evergreen.js.Before this PR,
zone-legacy.jsneed to be loaded afterzone-evergreen.js, because thezone-legacyuse a lot ofcommon logicfromzone-evergreen.js. So in this PR,zone-legacy.jsis alazy load modulewhich will only define afactory function.zone-evergreen.jsloading, it will check whether thislazy load module exist, if exists, it will execute thezone-legacy patch logic.