Giter VIP home page Giter VIP logo

Comments (4)

markerikson avatar markerikson commented on August 16, 2024

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.

glenjamin avatar glenjamin commented on August 16, 2024

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.

markerikson avatar markerikson commented on August 16, 2024

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.

mweststrate avatar mweststrate commented on August 16, 2024

from immer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.