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

New cache system #684

Open
michalkvasnicak opened this issue Feb 8, 2021 · 0 comments
Open

New cache system #684

michalkvasnicak opened this issue Feb 8, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@michalkvasnicak
Copy link
Member

By default visage should encourage developers to memoize styles prop so it'd be better to make styles prop immutable (uses ref to store the first reference to styles object and doesn't react to its changes). Also we can introduce a prop that says that the styles prop should be mutable ( default false ).

Also cache needs to be simplified, now the code is terrible. With babel plugin we can cache everything much easier because styles are hoisted (the ones that can be). With immutable styles prop it's little bit harder because we still need to serialize styles to know their hash quickly. Maybe we could leverage some cache id counter that can be used instead, so we don't need to check for equality of object.

@michalkvasnicak michalkvasnicak added the enhancement New feature or request label Feb 8, 2021
@michalkvasnicak michalkvasnicak added this to the v1.0.0 milestone Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant