Skip to content
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

Reduce Immer bundle size by eliminating the Proxy based implementations of Set and Map #449

Closed
mweststrate opened this issue Oct 30, 2019 · 3 comments

Comments

@mweststrate
Copy link
Collaborator

Currently all data structures supported by Immer (plain objects, arrays, Maps, Sets) have an ES5 and Proxy based implementation. However, the Proxy implementation of Maps and Sets don't really add value, as all object interactions are through patchable methods, so the ES5 implementation has no real practical or performance drawback over the Proxy implementation. Eliminating the latter should reduce the bundle size with 0.5 to 1 KB? Relevant comment

@oriSomething
Copy link
Contributor

As much as I don't like this idea (because mutating bulllit-ins) it can solve #466 for free

@oriSomething
Copy link
Contributor

By the way, have someone benchmarked if Object.create(···) makes slower or faster ES5 Map/Set traps?

mweststrate added a commit that referenced this issue Jan 9, 2020
mweststrate added a commit that referenced this issue Jan 9, 2020
@mweststrate
Copy link
Collaborator Author

Released as 5.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants