-
Notifications
You must be signed in to change notification settings - Fork 16
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
Possibility of creating an immutable-js based polyfill? #8
Comments
@nmn I know your comment was over a year ago, but what are your current thoughts on this? I think it would be great if we had a Babel plugin to transform the syntax into |
There are some issues with the idea.
However, with Proxies in modern JS VMs it's possible to make the |
@nmn In regards to your points.
I'm not very familiar with
You are right, I didn't realise how slow Proxies are! However, I think this would be great, if at the very least. One of the problems with Proxies is we could only support getters, as setters (for example Is there value in having this functionality as standalone lib for |
One of the most common problems I run into while using 'immutable-js' is forgetting to use the
.get
method and instead trying to read values from a Map/Vector using a subscript.So I end up trying to read a value from a Vector like so:
It would be great if it was possible to create some way of using the sugar syntax with immutable values today. It's easy to use sweet-js to create sugar initialisers. Such that
#[1, 2]
can becomeImmutable.Vector(1, 2)
. But it is much more complex task to walk through the entire codebase, detect the value types and convert places where subscripts are being used to.get
.Perhaps a new feature for Babeljs? @sebmck thoughts?
The text was updated successfully, but these errors were encountered: