Deprecate RSVP - #1220
Conversation
| | `RSVP.all(array)` | `Promise.all(array)` | | ||
| | `RSVP.race(array)` | `Promise.race(array)` | | ||
| | `RSVP.allSettled(array)` | `Promise.allSettled(array)` [^settled] | | ||
| | `RSVP.defer()` | [`Promise.withResolvers()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) [^defer] | |
There was a problem hiding this comment.
Yes! Two things to note here:
- ember-concurrency relies on RSVP.defer, so a PR there be a good testbed for an actual migration
- Promise.withResolvers is baseline 2024, which is higher than the current Ember browser support table for 6, which also reminds us that we should probably add an updated browser support table for v7?
| | `RSVP.defer()` | [`Promise.withResolvers()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) [^defer] | | ||
| | `RSVP.hash(obj)` | no native equivalent, see below | | ||
| | `RSVP.map(array, fn)` | `Promise.all(array.map(fn))` | | ||
| | `RSVP.filter(array, fn)` | `Promise.all` + `Array.prototype.filter` | |
There was a problem hiding this comment.
This one get's a little bit complicated. I think this will have to be Array.map => Array.filter => Promise.all => Array.map as RSVP.filter resolves promises within the filter method and then uses that result to filter the values. I'm not sure if it currently returns those values resolved, but I don't think it does so that's even more to cover. I don't think this should be taken as a point against this RFC though.
There was a problem hiding this comment.
I'd also just note that people can re-install RSVP and use it. The main thing we want to do is stop having it built-in to ember / stop overriding its flush in ember
|
|
|
|
||
| ## Transition Path | ||
|
|
||
| Most usage is a mechanical find-and-replace: |
There was a problem hiding this comment.
Are we talking about usage inside of ember-source, or a suggested alternative for users that use these functions on promises returned by ember-source?
Like @runspired said, if people really want to keep using these, they can just install rsvp.
Personally, I've never known a time without native Promises, so for me:
Drop it like it's hot 🔥
There was a problem hiding this comment.
Also, rsvp hasn't been updated in 7 years ☠️ , that's longer than I have been working with JS
Propose deprecating RSVP
Rendered
Summary
This pull request is proposing a new RFC.
To succeed, it will need to pass into the Exploring Stage, followed by the Accepted Stage.
A Proposed or Exploring RFC may also move to the Closed Stage if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.
An FCP is required before merging this PR to advance to Accepted.
Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.
Exploring Stage Description
This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.
An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an
Exploringlabel applied.An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.
Accepted Stage Description
To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.
If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.
When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.
Checklist to move to Exploring
S-Proposedis removed from the PR and the labelS-Exploringis added.Checklist to move to Accepted
Final Comment Periodlabel has been added to start the FCP