Skip to content
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.5 #17168

Closed
wants to merge 58 commits into from

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Oct 31, 2018

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:

4854485c44d3a6d3e9aeb76e89db87417c6db7a8 Remove deprecated 'BINDING_SUPPORT'
428dfbf0304c746a4e00211bd47179f495ebf0e6 [core-object] Delay init until after construction
9a817d4de69e8b57ce9b85bf496ab5d6919353a0 remove new usage from tests
595a1d638b02a1c6713524ecd3a7f5c7a0be9712 Adds new EmberObject deprecation url
a80eba3d9876542e35837897042fe02b9f6f3f09 [refactor] Adds initialization flag and isPrototypeMeta()
b3bcc7a127fd40018b99f2c41e23578bb42f813b [BUGFIX] ES6 classes on/removeListener and observes/removeObserver in...
7164bd6c69f4c9b3ce33d129aac564dc1ec95920 completely remove function listeners
da28ceadc37c0d3f7ad4ba150defd70285233e9c fix flattening, add deprecations
ef21456efee841d38d703f5b3ea7ef9698e1e021 fix tests, sort macro
506b8841888190de9cc35814d16a8d3098cfb20e add more counters, fix performance issues

kategengler and others added 30 commits August 27, 2018 23:46
(cherry picked from commit c3bfebd)
Fixes issue with attribute merging with dynamic angle bracket component
invocation (invoking paths, named args, locals, etc).

(cherry picked from commit 807c489)
[ci skip]

(cherry picked from commit e0317d4)
(cherry picked from commit aca371c)
[ci skip]

(cherry picked from commit af8f4ee)
(cherry picked from commit cdc02da)
The previous implementation did not work correctly when the element of
the component listening to mouseEnter/Leave was quickly moved over,
(i.e. no mouseover event triggered on this element) and the child node
is from another component, as demonstrated in the replication in emberjs#16922.

Related to 16603
Fixes emberjs#16922

(cherry picked from commit 6264318)
(cherry picked from commit 793d123)
(cherry picked from commit 74ebe7b)
...or `{{...}}` with `htmlSafe('')`

(cherry picked from commit d260f6f)
[ci skip]

(cherry picked from commit 82b0b2d)
[ci skip]

(cherry picked from commit a054631)
rwjblue and others added 11 commits October 29, 2018 16:21
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.
@pzuraq pzuraq mentioned this pull request Oct 31, 2018
24 tasks
@pzuraq pzuraq force-pushed the ember-native-class-polyfill-3.5 branch from 1b08658 to f1af53d Compare November 12, 2018 22:27
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.
@pzuraq pzuraq force-pushed the ember-native-class-polyfill-3.5 branch from f56b8ab to b665418 Compare November 29, 2018 14:55
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.
@locks
Copy link
Contributor

locks commented Aug 16, 2019

Closing as no longer relevant.

@locks locks closed this Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet