Git Product home page Git Product logo

Comments (4)

mweststrate avatar mweststrate commented on June 12, 2024 1

This workaround is not fixable I think as the arrow functions cannot act as base classes. The reason this downlevels this way is IIRC because when proxies are not used, this was the only way to reasonably correct inherit from the built-in array. If LegacyArray extends Array works nowadays, happy approve a PR for that!

I know it was a limitation in the past, and disabling proxies and using legacy array in the first place, is probably to target something from the past :) (Will be removed in next major)

from mobx.

urugator avatar urugator commented on June 12, 2024

Do you have an idea for workaround?

from mobx.

bradzacher avatar bradzacher commented on June 12, 2024

It's hard to say. TBH I'm not exactly sure why this workaround even exists!
I can see it was added in a9b5ed2 but the commit has no attached PR nor does it have any useful commit message.

In that commit I can see that there used to be some code that mutated the prototype - but that code is long since gone -- in v6 from the looks of it based on this comment:

// Weex proto freeze protection was here,
// but it is unclear why the hack is need as MobX never changed the prototype
// anyway, so removed it in V6

Seems to me like this code could just be class LegacyObservableArray<T> extends Array?

from mobx.

bradzacher avatar bradzacher commented on June 12, 2024

It also seems odd to me that MobX's build process downlevels classes to functions since all browser have had support since around 2016.

from mobx.

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.