-
-
Notifications
You must be signed in to change notification settings - Fork 409
Deprecate EmberObject #1234
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
Draft
NullVoxPopuli
wants to merge
4
commits into
main
Choose a base branch
from
nvp/deprecate-ember-object
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Deprecate EmberObject #1234
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| --- | ||
| stage: accepted | ||
| start-date: | ||
| release-date: | ||
| release-versions: | ||
| teams: # delete teams that aren't relevant | ||
| - cli | ||
| - data | ||
| - framework | ||
| - learning | ||
| - steering | ||
| - typescript | ||
| prs: | ||
| accepted: https://github.com/emberjs/rfcs/pull/1234 | ||
| project-link: | ||
| --- | ||
|
|
||
| <!--- | ||
| Directions for above: | ||
|
|
||
| stage: Leave as is | ||
| start-date: Fill in with today's date, 2032-12-01T00:00:00.000Z | ||
| release-date: Leave as is | ||
| release-versions: Leave as is | ||
| teams: Include only the [team(s)](README.md#relevant-teams) for which this RFC applies | ||
| prs: | ||
| accepted: Fill this in with the URL for the Proposal RFC PR | ||
| project-link: Leave as is | ||
| --> | ||
|
|
||
| # Deprecate EmberObject | ||
|
|
||
| ## Summary | ||
|
|
||
| Deprecates `EmberObject` in a way that is initually opt-in, so people can more gradually prepare their codebase for the removal of `EmberObject`. | ||
|
|
||
|
|
||
| ## Motivation | ||
|
|
||
| `EmberObject` has had heavy use in the early days of Ember (pre-JavaScript having classes), and since classes shipped in 2015, the need for `EmberObject` has greatly diminished. | ||
|
|
||
| Removing `EmberObject` is one of the last steps in coercing codebases to be plain modern JavaScript. | ||
|
|
||
| ## Transition Path | ||
|
|
||
| Unlike previous deprecations, this is targeting Ember 9, and will have a feature flag that removes all behavior related to `EmberObject`. This does require a lot of internal implementation in `ember-source`, but is needed anyway for the removal of `EmberObject`, ultimately. | ||
|
|
||
| This will be the first deprecation that users will be able to preview the removal off. | ||
|
|
||
| Leading up to v8, the feature flag will be "off": | ||
| - deprecation logged for all EmberObject APIs (even thoose acessible through framework objects (get/set/etc)) | ||
| - EmberObject is still usable | ||
|
|
||
| With the release of v8, and leading up to v9, the feature flag will be "on" by default: | ||
| - EmberObject (and related APIs) is/are not usable, due to the feature flag removing all of the implementation | ||
| - if users wish, the feature flag can be flipped back off, which brings back the EmberObject behavior along with the deprecations | ||
|
|
||
| At `ember-source` v9, `EmberObject` is removed fully along with the feature flag. | ||
|
|
||
|
|
||
| > [!NOTE] | ||
| > This includes `@computed`, as `@computed` is part of the "Ember Object Model" of reactivity. | ||
|
|
||
|
|
||
| Internally, implementation would likely be similar to how Mixins were initially deprecated -- copied to an "internal" file, and then the "public" version of `EmberObject` would override `init`, and provide the deprecations. | ||
|
|
||
| On the internal copy of `EmberObject`, we deprecate all the methods (`get`, / `set` / etc), so that the deprecations flow through to other framework classes such as `Route`, `Controller`, `Service`, etc. | ||
|
|
||
| ## How We Teach This | ||
|
|
||
| > Would the acceptance of this proposal mean the Ember guides must be | ||
| re-organized or altered? Does it change how Ember is taught to new users | ||
| at any level? | ||
| Does it mean we need to put effort into highlighting the replacement | ||
| functionality more? What should we do about documentation, in the guides | ||
| related to this feature? | ||
| How should this deprecation be introduced and explained to existing Ember | ||
| users? | ||
|
|
||
| > Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc. | ||
|
|
||
| ## Drawbacks | ||
|
|
||
| keeping EmberObject is a drawback, because of the dozens of KB that come along with it. | ||
|
|
||
| all codebases with old code probably have some usage of EmberObject remaining, so they need to migrate. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| - do nothing | ||
|
|
||
| ## Unresolved questions | ||
|
|
||
| n/a | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion here is not to try to deprecate every individual path, but rather to have one big deprecation for "you still have EmberObject enabled".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, updated!