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

Babel 7 compatibility and change tests #440

Merged
merged 13 commits into from
Nov 4, 2017
Merged

Babel 7 compatibility and change tests #440

merged 13 commits into from
Nov 4, 2017

Conversation

emmatown
Copy link
Member

@emmatown emmatown commented Oct 31, 2017

What:
Babel 7 compatibility and change tests

Why:
Closes #437
Closes #169

How:
jest-in-case, writing some helpers and a babel plugin i wrote to convert the boilerplately cases into objects .

Checklist:

  • Documentation
  • Tests
  • Code complete

This isn't done yet, I'm having some problems with macro tests.

Once this is done, I'm thinking of switching to babel 7 for bundling so we get the smaller helpers and stuff.


test('className as expression string', () => {
const basic =
import { createInlineTests, createExtractTests } from './util'
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Copy link
Member

Choose a reason for hiding this comment

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

I tried doing this once and stopped at 2 files. Awesome work.

@@ -15,6 +15,7 @@
},
"dependencies": {
"babel-generator": "^6.26.0",
"babel-helper-module-imports": "^7.0.0-beta.3",
Copy link
Member

@Andarist Andarist Nov 2, 2017

Choose a reason for hiding this comment

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

this is also published already as scoped - @babel/helper-module-imports

you probably should update other babel dependencies to their respective @babel/*@7-beta.5 and you should pin them to the exact versions (no ^) as its not stable yet

@codecov
Copy link

codecov bot commented Nov 3, 2017

Codecov Report

Merging #440 into master will increase coverage by 0.29%.
The diff coverage is 100%.

Impacted Files Coverage Δ
packages/babel-plugin-emotion/src/css-prop.js 100% <100%> (ø) ⬆️
packages/babel-plugin-emotion/src/index.js 96.45% <100%> (+1.45%) ⬆️
packages/babel-plugin-emotion/test/util.js 100% <100%> (ø)

@emmatown emmatown merged commit bec844d into master Nov 4, 2017
@emmatown emmatown deleted the babel-7-compat branch November 4, 2017 04:20
"babel-generator": "^6.26.0",
"babel-macros": "^1.0.2",
"@babel/helper-module-imports": "7.0.0-beta.31",
"babel-macros": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
Copy link
Member

@Andarist Andarist Nov 4, 2017

Choose a reason for hiding this comment

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

@mitchellhamilton is there a reason this plugin is left here with version 6? mixing babel 7 and babel 6 packages together might not work and is considered highly risky

Copy link
Member Author

Choose a reason for hiding this comment

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

@babel/plugin-syntax-jsx has a peerDependency on @babel/core whereas babel-plugin-syntax-jsx doesn't and we want to maintain babel 6 compatibility for now. I understand it's not ideal.

"babel-plugin-syntax-jsx": "^6.18.0",
"convert-source-map": "^1.5.0",
"emotion-utils": "^8.0.9",
"source-map": "^0.5.7",
"touch": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.4",
"babel-cli": "^6.24.1",
Copy link
Member

Choose a reason for hiding this comment

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

same here, also beta packages should be synced in version for better stability, i would suggest upgrading all babel@beta-x to the latest, which is being 31 at the moment

Copy link
Member Author

Choose a reason for hiding this comment

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

We're still using babel 6 to build emotion, we're only using babel 7 to test the babel plugin. I just updated @babel/core to beta 31.

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.

Babel 7 compatibility for babel-plugin-emotion Improve Babel tests
3 participants