-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Deprecate extract static #812
Conversation
Codecov Report
|
Would be good to describe the reasoning behind the change - people will ask about this a lot (even if they wouldnt actually set up static extraction). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, good explanation!
docs/extract-static.md
Outdated
|
||
### Why is extractStatic being deprecated? | ||
|
||
The emotion team isn't very interested in static extraction in its current state as it negates lots of the benefits of emotion, most notably, [composition](/docs/composition.md). There is also very little interest from the community in maintaining it and maintaining `extractStatic` takes time away from maintaining more widely used parts of emotion. We don't think static extraction is a bad idea but the implementation that we have doesn't provide a good enough experience and we believe there are more important problems to be solved first. We're very interested in the work being done with [prepack](https://github.com/facebook/prepack) though and if we add some form of static extraction back, it will likely be done with prepack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this as an alternative. Let me know what you think.
Static extraction was designed and built for earlier versions of emotion which functioned in subtly different ways than current versions. As the team added more features which expanded the power of composition and made it more performant, static extraction became less important. Because most of the community is leveraging the power of composition, the time cost in maintaining
extractStatic
has become too high. Libraries such as linaria and css-literal-loader do static extraction well and the developers working on them are focused on this specific problem. As a team, we believe that projects like prepack, when they are ready, will provide a better and more forward thinking solution to the problem or pre-compiling styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, I’ll probably use that with a few small changes
What:
Add warnings when using extractStatic and mention in the docs that it's deprecated.
Why:
#637
How:
Checklist:
Testsit's not worth it