Comments (4)
Unfortunately this is the "price of progress" :) As tools modernize, they drop support for legacy platforms... and if you still have to support that legacy platform, you can end up stuck and not being able to update.
In this case, yeah, RTK 2.0 intentionally updates to Immer 10, and Immer 10 does not have the ES5 fallback support.
The biggest question is whether those old versions of Chrome have support for Proxies. If they do, then you could at least use Immer 10 and if necessary transpile packages in node_modules
(Immer, RTK, etc) back to ES5 syntax.
If those versions of Chrome do not have Proxy support, then you would need to stick with Immer 9. At that point things get more complicated:
- The simplest option is to stick with RTK 1.9 and Immer 9, since they are already meant to work together, and RTK 1.9 automatically enables the Immer ES5 fallback
- It might theoretically be possible to install RTK 2.0, use your package manager's override system to install Immer 9, and have that work. You would have to import the
enableES5
fallback plugin and call that in your app, since RTK 2.0 no longer does that. I honestly think it might work, but would not be surprised if there's some kind of import/export issue along the way.
from immer.
Thanks for the quick response!
I'm keen to adopt the selectors-in-slices model, it's a shame that brings with it a bunch of extra complications!
We have various possible plans for finally dropping support, but so far every issue we've run into has had a fairly cheap workaround.
The Smart TVs tend to be a bit mysterious about what they actually support, but I suspect most of them do actually support Proxy, so perhaps I'll get away with this.
Do you know if there are any intentional API changes between 9 and 10 aside from the ES5 compat flag?
Your second suggestion is pretty much what I had in mind to try. Even if there is a small difference I figure I can probably swap in a shim using either the bundler or npm to override.
I'll give this a whirl and report back, hopefully I'll have something that can be added to the docs
from immer.
Looking at https://github.com/immerjs/immer/releases/tag/v10.0.0 , I don't immediately see any other obvious API changes listed. Worth a shot!
from immer.
from immer.
Related Issues (20)
- `produce` leaks proxy objects when symbols are present HOT 8
- Wrong description for "Question" issue type on "New Issue" page HOT 2
- In Vue 2's array, using push causes an error HOT 1
- How to deep clone ignoring immer references? (deepCurrent vs currrent) HOT 4
- Immer problem HOT 1
- Is there a way to convert object types in TypeScript in produce? HOT 2
- When ImmerJS processes objects containing Symbol keys, the Symbols become Proxies. HOT 1
- Property ... is missing in type WritableDraft<...> but required in type ... HOT 1
- "Maximum call stack exceeded" with circular references HOT 5
- Use Immer Reducer to create Composite Object HOT 5
- type WritableDraft is not exported anywhere in dist, this causes build type declaration files with Draft finally fall back to raw and causing the type declaration exceeds max token length
- Array update speed HOT 1
- Object values of a `Map` are not frozen anymore HOT 2
- Can immer.js can be used for future mutations? HOT 3
- Maybe update docs
- Configure rollup
- Typescript: Cannot assign immutable state from payload to immutable writable draft HOT 2
- Unable to pass generic to produce for dynamic typing
- how to modify data with unknown path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immer.