Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork866
Immer 10#1028
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Immer 10#1028
Conversation
Patches generated by the current implementation do not follow the RFC method for removing an element from an array (https://www.rfc-editor.org/rfc/rfc6902#page-13) and cannot be used from other languages (e.g.,https://pypi.org/project/jsonpatch/).
…to kshramt-array-remove
… items from an array,#964
BREAKING CHANGE: removed enableAllPlugin, only Patch support is now optional
coveralls commentedMar 23, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Pull Request Test Coverage Report forBuild 4622958383Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 -Coveralls |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Just ran a quick check on 9.0.16 vs 10.0.beta, using Vite 4.2.1 +
If I hand-inspect the Vite bundle output, I don'tsee any If it helps at all, I just manually copied and pasted the minified versions of 9.0.16 and 10.0.0-beta.4 out of Vite-built bundles, ran them through Prettier, and am attaching them as a zip - maybe it'll help show where the differences are: Per the |
Ah interesting! Is there a documentation section I can refer people back toif they report this in the future? RTK is probably the biggest packagedImmer provider, so if that isn't even supposed to be done in that case,happy to reconsider …On Mon, Apr 3, 2023 at 6:11 PM Mark Erikson ***@***.***> wrote: Just ran a quick check on 9.0.16 vs 10.0.beta, using Vite 4.2.1 + source-map-explorer: - 9.0.16: immer/dist/immer.esm.mjs, 10.42KB - 10.0.0-beta.4: immer/dist/immer.mjs, 15.78KB If I hand-inspect the Vite bundle output, I don't *see* any NODE_ENV references left in there, which is what I would expect - they exist in the ESM artifact, but the minifier should get rid of those. If it helps at all, I just manually copied and pasted the minified versions of 9.0.16 and 10.0.0-beta.4 out of Vite-built bundles, ran them through Prettier, and am attaching them as a zip - maybe it'll help show where the differences are: immer-minified-prettified.zip <https://github.com/immerjs/immer/files/11140726/immer-minified-prettified.zip> Per the Map/Set thing: FWIW, we really *don't* want people using the Map/Set support with RTK because of serialization issues, so at least in our case that is a size increase we don't benefit from. But, I do understand how that can cause confusion and annoyance on *your* side. (My own preference would be that it still be opt-in somehow if possible.) — Reply to this email directly, view it on GitHub <#1028 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAN4NBF56VRECVVNPETOLHTW7MADJANCNFSM6AAAAAAWFUJMLA> . You are receiving this because you authored the thread.Message ID: ***@***.***> |
Yeah, the two most immediate references are here:
We actually had an internal discussion about |
@markerikson I reverted the MapSet opt-in in immer@10.0.0-beta.6, mind doing a check if it solves the bundle size increase? |
@mweststrate yeah, I'll check on that tonight! |
markerikson commentedApr 6, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@mweststrate: Okay, 3 builds of the same RTKQ app, changing only the Immer version:
I'm still generally surprised that 10.x isn'tsmaller than 9.x, given the changes. |
markerikson commentedApr 7, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@mweststrate : well, you got me hooked :) I cloned the
So, those are adding up to a bunch of dead bytes that aren't needed. Unrelated to the bundle sizes, there's also issues with the current build output in this beta:
FWIW, Ijust switched I just tried making a local branch that switches over to Some other notes here:
Sooooo, with all that said: If you're interested,I can try to do the rest of the TSDX -> Thoughts? |
@markerikson thanks for pointing out tsup! I was already wondering what was the modern bundling setup since tsdx went unmaintained, which was also the reason I didn't want to poke too much in the config. So happy to receive a PR! Please do leave the flow types, as they're useful inside Meta, so I try to keep them roughly up to date :) |
@mweststrate okay, sure! I'll try to put up a PR over the weekend. |
@mweststrate done! See#1032 . Please let me know if you have any questions or would like me to tweak things further! |
Sorry had some PTO and now playing really hard catch-up! I'll try to goover it in the weekend :) …On Mon, Apr 10, 2023 at 5:34 PM Mark Erikson ***@***.***> wrote:@mweststrate <https://github.com/mweststrate> done! See#1032 <#1032> . Please let me know if you have any questions or would like me to tweak things further! — Reply to this email directly, view it on GitHub <#1028 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAN4NBHGCON5TCPRRR2ELJLXAQR7JANCNFSM6AAAAAAWFUJMLA> . You are receiving this because you were mentioned.Message ID: ***@***.***> |
@markerikson just published |
🎉 This PR is included in version 10.0.0 🎉 The release is available on: Yoursemantic-release bot 📦🚀 |
Uh oh!
There was an error while loading.Please reload this page.
Release notes
Proxy,Reflect,SymbolandMapandSet.tsupand modernize JS build artifacts #1032!getterproperty in irrelevant plain objects #1012. Thankshrsh7th for implementing it in[breaking change] implement and default to useStrictShallowCopy, omitting getters #941!createDraftandfinishDraft.enableES5(), you SHOULD NOT upgrade Immer.enableES5has been removed.produceis no longer exposed as thedefaultexport. This improves eco system compatibility, and makes sure that there is only one correct way of doing thingsenableAllPluginshas been removed, useenablePatches(); enableMapSet()insteadlengthproperty, in accordance with JSON spec. Thankskshramt for implementing this in[breaking change] Do not replace array.length as patch when removing items #964!Overall, there is a rough performance increase of 33% for Immer (and in some cases significantly higher), and the (non gzipped) bundle size has reduced from 16 to 11.5 KB, while the the minimal gzipped import of just
producehas remained roughly the same at 3.3 KB.For more details, see#1015
Migration steps
enableES5()call, don't migrateuseStrictShallowCopy(true)at startupimport produce from "immer"withimport {produce} from "immer"enableAllPlugins()withenablePatches(); enableMapSet();to be more specific and smoothen future migrations.createDraftinstead. Roughly: