-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Immer 10 proposals: Drop promises, default export, array.length patches, ES5 mode, and make getter / setter support opt-in #1015
Comments
@mweststrate AWESOME, great to see this! It aligns wonderfully with the work I'm doing on RTK 2.0. These all sound like pretty good proposals to me. And yeah, both the default export and ESM things seem like things to put into a major. Actually, looking at Immer's current package.json, it seems like you already technically are using ESM with the "fix" in 9.0.14 by having both Along with the getter/setter stuff, I wonder if there's any other ideas that could be borrowed from https://github.com/giusepperaso/structura.js or https://github.com/unadlib/mutative to help improve perf? |
I agree with all points. |
Yeah, fortunately with RTK we don't have anything stateful that way. I know I've read some articles that have tricks for a file that can be used simultaneously with ESM and CJS imports and correctly share state between (ie, the module is only loaded once despite being loaded in two different ways). |
@mweststrate : just out of curiosity, what would be your estimate for the amount of work involved and a vague ETA for releasing Immer 10? No rush, just trying to get a sense of how that would tie into RTK 2.0. (Which will take us a while to get done, trust me :) ) |
@markerikson my current plan is to work on this 2nd half of March and hopefully release early April. |
bunchee, it can simplify esm/cjs export bundle, used by swr. |
regarding the
what's weird is nothing w/ the all i had to do was change:
to:
in a global search/replace. it was easy to fix, but i wanted to give a heads up here! also: i'm only mentioning here b/c we might want to update the examples/docs as part of the still uses the "default import". |
Tried out RTK 2 alpha, which includes Immer 10 under the hood, and noticed that Known issue? Easy to work around, but works fine in plain js. |
@einarq there isn't an intentional change there, but if you have a minimal repo or unit test for that that'd be great. |
@einarq / @markerikson - curious if changing: Line 182 in 48a91b3
from:
to:
and: Line 185 in 48a91b3
from:
to:
will fix this? i might attempt a fix/pr (and add a unit test) EDIT: pr is here: #1031 |
@skratchdot, thanks for that! Sorry, missed the PR before from my spotty train connection, but can confirm the issue has been reproduced and fixed, and will be part of the final release |
1 similar comment
@skratchdot, thanks for that! Sorry, missed the PR before from my spotty train connection, but can confirm the issue has been reproduced and fixed, and will be part of the final release |
Immer 10 released couple of week ago :) |
🚀 Feature Proposal
Hi folks,
I've collected a bunch of issues that are together I think worthy of being put in a separate major version:
getter
property in irrelevant plain objects #1012 Immer takes a long time to update the data. #867 [breaking change] implement and default to useStrictShallowCopy, omitting getters #941import produce from 'immer'
andimport {produce} from 'immer'
. Since both default exports and offering two ways to achieve exactly the same are anti patterns, and removing simplifies ESM support, I'm proposing to drop the default export. This is quite a breaking change, but on the upside easily handled by a simple search and replace. Possible breaking change in package exports in v9.0.13 #937 (comment) / Migrate the RTK package to be full ESM reduxjs/redux-toolkit#3095[ ] Support map/set by default -> avoid control issues like import and callenableMapSet()
error happens even after enableMapSet() is called. #1022Notes to self:
cc @markerikson
The text was updated successfully, but these errors were encountered: