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.
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
RFC: Deprecate array prototype extensions #848
RFC: Deprecate array prototype extensions #848
Changes from 13 commits
92b9401
c7e689e
7de7d1d
b28f04e
afc0fed
26b5b73
f9010fa
6823f5a
9d471fa
3117290
bb91b28
fa8b6d2
caf515f
11ca5d2
b49ddc3
65da28b
734fa12
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
these false positives will be greatly reduced soon because in ember-data 4.8 usages of these has already been deprecated. This means remaining usage is from
A()
which I would hope this RFC would consider simultaneously deprecating or various otherArrayProxy
implementations which are far less common.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.
Agreed! One of the things I plan to discuss at Friday's Framework Core meeting is exactly whether we should deprecate
@ember/array
entirely and/or at least extracting it and move it out to a separate package which is not installed by default.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.
Sure, but the reason I mention
A
is thatA
mutates array instances when prototype extensions are turned off. If we're going to rip off the bandaide it seems better to rip it fully off vs allowing people to just callA
on everything to get back to the same state.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.
Another sets of false positives are self-defined class functions, for example☹️
invoke
,clear
are pretty common method names.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.
@runspired yeah, I spent literally my whole day today dealing specifically with the horror caused by the
NativeArray
shenanigans as relates to types. If it were my preference alone, we'd deprecate it and cut a special v5.0 tomorrow just to get rid ofA()
. 😂@smilland yeah, unfortunately that kind of thing is basically impossible to avoid 100% without full TS coverage (which we obviously can't require people to have!).
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.
Assuming that the lint rule and codemod would both rely solely on static analysis (i.e. the codemod would not have any runtime information available) (previous thread), then personally I'd rather focus on building out the ember/no-array-prototype-extensions lint rule autofixer, as that would be easily accessible to all Ember users who already have eslint-plugin-ember installed and already integrated into their IDE/tooling, as opposed to a codemod which requires someone to seek it out and manually run it.