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

Automatic hoisting. #414

Merged
merged 19 commits into from
Oct 18, 2017
Merged

Automatic hoisting. #414

merged 19 commits into from
Oct 18, 2017

Conversation

tkh44
Copy link
Member

@tkh44 tkh44 commented Oct 17, 2017

What:
Hoist any arguments supplied to css or styled if they are not template literals (not sure if this matters).

Why:
Hoisting should increase the performance of inline css calls the most, but will have a secondary benefit for anyone using object styles.

How:
Use babel's isPure and hoist methods on the path.

Checklist:

  • Documentation
  • Tests
  • Code complete

@@ -257,7 +271,7 @@ export default function(babel) {
} catch (e) {
throw path.buildCodeFrameError(e)
}

hoistPureArgs(path)
path[visited] = true
Copy link
Member

Choose a reason for hiding this comment

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

This will hoist every single CallExpression

@codecov
Copy link

codecov bot commented Oct 17, 2017

Codecov Report

Merging #414 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted Files Coverage Δ
packages/babel-plugin-emotion/src/index.js 94.73% <100%> (+0.73%) ⬆️

@tkh44 tkh44 merged commit e041089 into master Oct 18, 2017
@tkh44 tkh44 deleted the hoisting branch October 18, 2017 18:35
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.

2 participants