Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

fix(promise): fix #891, sometimes NativePromise will not ready, and reduce zone.js size#916

Merged
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:some-fix
Oct 3, 2017
Merged

fix(promise): fix #891, sometimes NativePromise will not ready, and reduce zone.js size#916
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:some-fix

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Collaborator

fix #891

  1. sometimes NativePromise will not be fully ready when override global.Promise, we should add check about it.
  2. now by default, typescript 2.3 will compile iterable and spread operator with new polyfill code and will make dist/zone.js bigger, and we don't really have to use iterable and spread, so we use simple loop to reduce the zone.js size.

@josephliccini
Copy link
Copy Markdown

josephliccini commented Sep 28, 2017

@JiaLiPassion just so I understand this a little better, the core-js/es6/promise will:

Lazy load its prototype

can you elaborate a little more? Thanks!

Comment thread lib/zone.ts Outdated
patchMethod: () => noop,
setNativePromise: (NativePromise: any) => {
nativeMicroTaskQueuePromise = NativePromise.resolve(0);
// sometimes NativePromise lazy load it's prototype
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's => its (typo) :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I will update the comment.

@JiaLiPassion
Copy link
Copy Markdown
Collaborator Author

@josephliccini
Copy link
Copy Markdown

Got it. Thank you!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

es6-promise overwrites zone.js

4 participants