Update ember-resources from v5 to v7 #281
Open
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.
Via
Here is the code for the codemod:
NullVoxPopuli/ember-resources#1147
There aren't many breaking changes from v5 to v7.
Here are the breaking changes in v6:
map
utility (which this library uses) has changed its type signature for better inference)Here are the breaking changes in v7:
reactiveweb
, documentation here: https://reactive.nullvoxpopuli.com/map
Resource
class has moved to a separate package, https://github.com/NullVoxPopuli/ember-modify-based-class-resource/modify()
hooks -- as they are a sort of backdoor effect, which we don't want to encourage -- instead folks should rely on more data derivation patterns (ember-headless-table is, in general, a great example of data derivation)Of note, because ember-resources has such broad support (3.28 - 6+), ember-resources declares a peer on
ember-source
so that it can correctly choose which features to use based on the consuming app's version.As a result,
ember-resources
(in pnpm7 anyway),ember-resources
must also become a peer, which is a breaking change. (However, I'm exploring if peers can be removed entirely here https://discord.com/channels/480462759797063690/568935504288940056/1281690947708784681 -- which would make this PR not a breaking change (once I propagate the findings to the relevant libraries))There is a fair bit of this code:
The default ember-source for ember-headless-table is v4, but it looks like 3.28+ is also supported (the same range as ember-resources).
Though, while addressing this, I ran in to a number of peer problems. It may be best to address those in separate PRs, but they are included here in hopes that CI goes green, since I hadn't yet contributed to this repo since my time at CS.
I also ran in to a number of maintenance problems that will probably not mean this PR will go green
@embroider/*
ember-cli
ember-auto-import
pnpm
These alone are not problematic except when wanting to have fixed build problems.
In particular, I noticed with the current repo's dependencies, the dependency graph is incorrect, and packages are being resolved incorrectly -- for example, something is trying to resolve
reactiveweb/dist/index
, but that file doesn't exist, and nor should it -- because you only pay for what you import, and having a barrel file for a generic library would be bad for performance.So, I guess this PR is more demonstration than anything, as other work must happen before this work can attempt to go green.
(If I used this library, I'd PR fixes for ya'll -- but I haven't had a need for a table in a while -- my timebox ran out on trying to get this repo working <3 )