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

possible static optimizations #2

Closed
threepointone opened this issue Jul 21, 2016 · 3 comments
Closed

possible static optimizations #2

threepointone opened this issue Jul 21, 2016 · 3 comments

Comments

@threepointone
Copy link
Owner

The basic idea here is to process the javascript and replace function calls with values, deduping common declarations and avoiding cpu cycles. If we could detect all functional calls to style/<pseudo>/media, and the arguments passed to them were constant objects with primitive values (eg -{color:'red'}), we could then hoist the function call to the very top of the program, deduping on 'equal' values, and replacing the callsite with the resulting {[data-*]:<id>} object.
Further ideas in jsxstyle.

@threepointone
Copy link
Owner Author

another idea is to detect merge/media calls with inline rules as arguments, and replace them with a more optimal representation, preventing the unused rules from ever reaching the stylesheet.

@threepointone
Copy link
Owner Author

another idea is to detect dom jsx calls, and read the css prop from them and replace with references. this might be a good middle ground, especially for react consumers.

@threepointone
Copy link
Owner Author

closing this as fairly vague.

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

1 participant