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

Deprecate extract static #812

Merged
merged 9 commits into from
Aug 28, 2018
Merged

Deprecate extract static #812

merged 9 commits into from
Aug 28, 2018

Conversation

emmatown
Copy link
Member

@emmatown emmatown commented Aug 21, 2018

What:

Add warnings when using extractStatic and mention in the docs that it's deprecated.

Why:

#637

How:

Checklist:

  • Documentation
  • Tests it's not worth it
  • Code complete

@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #812 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
packages/babel-plugin-emotion/src/index.js 96.99% <100%> (+0.06%) ⬆️
packages/create-emotion-styled/src/index.js 100% <100%> (ø) ⬆️

@Andarist
Copy link
Member

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).

@emmatown emmatown requested review from tkh44 and Andarist August 27, 2018 09:56
Copy link
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, good explanation!


### 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.
Copy link
Member

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.

Copy link
Member Author

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

@emmatown emmatown merged commit d882e8b into master Aug 28, 2018
@Andarist Andarist deleted the deprecate-extract-static branch August 28, 2018 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants