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

[BUGFIX release-3-28] Fix #19867 #19868

Conversation

mixonic
Copy link
Sponsor Member

@mixonic mixonic commented Dec 1, 2021

Fixes #19867. Confirmed fix on the reproductions at jherdman/ember-data-store-sadness#1 and empress/empress-blog#148.

A build of this branch can be downloaded at https://gist.github.com/mixonic/fe502b7f84eba571b9bde80e78f1b720. You can try out the branch in your application with that build.

The way most Ember apps are setup in late 3.28 (an implicit injection of store but also an explicit injection) was not under test. This patch adds a test, and fixes a bug when applications use that pattern.

The prior implementation of the store injection deprecation on routes (added in #19854) used a wrapper DeprecatedStoreInjection in some cases which was unwrapped by the store getter. A deprecation implemented on CoreObject for when a explicit and implicit deprecation mis-match conflicted with that logic.

Here, refactor away from the DeprecatedStoreInjection wrapper to instead use a WeakSet to track injected instances. This does mean the deprecation is only going to fire in newer browsers (not in IE11), but I think that is acceptable.

@mixonic mixonic force-pushed the mixonic/explicit-injection-not-deprecated branch from e88a74b to 9bcffb5 Compare December 1, 2021 21:03
@mixonic mixonic force-pushed the mixonic/explicit-injection-not-deprecated branch from 9bcffb5 to 89e75a6 Compare December 2, 2021 01:05
@mixonic mixonic changed the title Repro for #19867 [BUGFIX release-3-28] Fix #19867 Dec 2, 2021
@mixonic mixonic force-pushed the mixonic/explicit-injection-not-deprecated branch 2 times, most recently from 6a84367 to ae15deb Compare December 2, 2021 01:28
mixonic added a commit to mixonic/ember-data-store-sadness that referenced this pull request Dec 2, 2021
@mixonic mixonic force-pushed the mixonic/explicit-injection-not-deprecated branch from ae15deb to 2fbce60 Compare December 2, 2021 01:58
@SergeAstapov
Copy link
Contributor

@mixonic confirmed via https://github.com/ember-learn/ember-cli-addon-docs/pull/1030/checks and works like a charm on my local

The way most Ember apps are setup in late 3.28 (an implicit injection of
`store` but also an explicit injection) was not under test. This patch
adds a test, and fixes a bug when applications use that pattern.

The prior implementation of the `store` injection deprecation on routes
(added in emberjs#19854) used a wrapper
`DeprecatedStoreInjection` in some cases which was unwrapped by the
store getter. A deprecation implemented on `CoreObject` for when a
explicit and implicit deprecation mis-match conflicted with that logic.

Here, refactor away from the `DeprecatedStoreInjection` wrapper to
instead use a WeakSet to track injected instances.
@mixonic mixonic force-pushed the mixonic/explicit-injection-not-deprecated branch from 2fbce60 to e4756aa Compare December 2, 2021 02:18
@mixonic mixonic marked this pull request as ready for review December 2, 2021 14:41
@mixonic mixonic merged commit 489b6e7 into emberjs:release-3-28 Dec 2, 2021
@mixonic mixonic deleted the mixonic/explicit-injection-not-deprecated branch December 2, 2021 15:03
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

3 participants