-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] Ember native class polyfill 3.4 #17167
Closed
Closed
Conversation
This file contains 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
pzuraq
force-pushed
the
ember-native-class-polyfill-3.4
branch
2 times, most recently
from
October 31, 2018 20:19
031afa4
to
9c14683
Compare
pzuraq
force-pushed
the
ember-native-class-polyfill-3.4
branch
from
December 14, 2018 21:44
e100421
to
110c390
Compare
Rewrite test with higher level API.
Implements RFC 337, delaying initialization of create properties until after object construction.
Currently, `meta.isInitialized()` is used for two distinct purposes: 1. To check if the meta is for an _instance_ of `EmberObject` which is currently being _initialized_. 2. To check if a meta is the meta for a class _prototype_. In both cases, we want similar behavior - don't trigger event listeners, mandatory setters, or `setUnknownProperty` in some cases. So, these two functions were tied together historically out of convenience. This PR separates them into two methods, `isInitialized` and `isPrototypeMeta`, to clarify their purposes and allow us to distinguish the two states. One quirk of `isPrototypeMeta` is that it still requires an object be passed to it. This for the case where an object does not have it's own meta, and is relying entirely on its parent's meta. In this case, the parent meta is being used in the context of an instance, and should be treated as if it were an instance meta for that particular usage.
…terop v2 This is a rework of emberjs#16874 which flattens and caches the state of event listeners more efficiently. Rather than rebuild the result of a `matchListeners` query each time, including deduping, we flatten the listeners down the hierarchy of metas the first time an event match is requested. This still defers the majority of the work early on (adding listeners is cheap) but also prevents us from having to do the work again later.
This reverts a change from some years ago that made EmberError a native class. The recent change to build non-transpiled classes is causing failures in libraries that subclass EmberError (specifically Ember Data) and with the messiness around how EmberError actually does the extending, using native classes is not ideal. Eventually, EmberError should be replaced entirely as it is not a good idea to subclass Error at all. This will have to happen in the future, and will likely require an RFC.
The recent change to transpilation has made `new A()` break, because A is an arrow function and arrow functions cannot be constructors. This is a pretty common pattern in Ember apps and likely constitutes a breaking change, so this PR fixes it by changing the arrow function to a normal function, and deprecates this behavior.
pzuraq
force-pushed
the
ember-native-class-polyfill-3.4
branch
from
January 23, 2019 17:00
110c390
to
f251ea1
Compare
Should be revisited when 3.12 becomes LTS. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is for testing purposes only, we'll be releasing this build as a separate polyfill addon.
Cherry picks the following commits, which represent the delta since 3.4 that applies to native classes: