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 #3746

Merged
merged 84 commits into from
Aug 23, 2018
Merged

Babel 7 #3746

Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c704d60
Initial move to babel 7
Hypnosphi Jun 9, 2018
69cc530
Merge remote-tracking branch 'origin/master' into babel-7
Hypnosphi Jun 10, 2018
cb988d0
Move lib/core to babel@7
Hypnosphi Jun 10, 2018
a4f9a2e
Move back to .babelrc
Hypnosphi Jun 10, 2018
084671c
Fix lint error
Hypnosphi Jun 10, 2018
113c182
Merge master
Hypnosphi Jun 16, 2018
73dc63b
Update dependencies
Hypnosphi Jun 20, 2018
b6153d1
Merge master
Hypnosphi Jul 4, 2018
0f93c5e
Add @babel/runtime dependency to all the packages with server-side part
Hypnosphi Jul 4, 2018
ee5c7c7
Update dependencies
Hypnosphi Jul 4, 2018
720bb23
Migration guide
Hypnosphi Jul 4, 2018
e496dfb
Update CLI
Hypnosphi Jul 4, 2018
87312a6
Fix vue build
Hypnosphi Jul 4, 2018
a050bcb
Update lockfile
Hypnosphi Jul 4, 2018
74475b9
Fix jest
Hypnosphi Jul 5, 2018
c4e468a
Fix jest
Hypnosphi Jul 5, 2018
ee6472d
Fix RN test
Hypnosphi Jul 5, 2018
170160d
Revert CLI changes for RN
Hypnosphi Jul 5, 2018
3c0e383
Add babel-loader peer dep
Hypnosphi Jul 6, 2018
6da0f7a
Commit snapshot
Hypnosphi Jul 6, 2018
4b169ab
Fix version choice logic
Hypnosphi Jul 6, 2018
ba544ef
Merge branch 'master' into babel-7
ndelangen Jul 16, 2018
d0b7972
FIX snapshots
ndelangen Jul 16, 2018
e0ad03d
Merge branch 'master' into babel-7
ndelangen Jul 20, 2018
a87d16d
FIX snapshots
ndelangen Jul 20, 2018
0ec2bc0
REMOVE smoke-tests in cli (static build examples are now all in teamc…
ndelangen Jul 20, 2018
6371e1f
Merge branch 'master' into babel-7
ndelangen Jul 20, 2018
a039c96
Merge branch 'master' into babel-7
ndelangen Aug 14, 2018
6e2d8c1
UPDATE "babel-plugin-react-docgen": "^2.0.0-babel7.0",
ndelangen Aug 14, 2018
a8e41c9
REVERT incorrect removal of package relating to angular
ndelangen Aug 14, 2018
fe86390
REMOVE unneeded tslint config
ndelangen Aug 14, 2018
e6c055c
FIX snapshots
ndelangen Aug 15, 2018
bf3c2e5
UPGRADE to babel7-rc.1
ndelangen Aug 15, 2018
b649f24
REMOVE stage presets and replace with plugins we need
ndelangen Aug 15, 2018
f7cd337
FIX eslint
ndelangen Aug 15, 2018
9a1abf2
FIX cli-tests
ndelangen Aug 15, 2018
3ae34e5
FIX cli test snapshots
ndelangen Aug 15, 2018
850b083
FIX angular example with a hack?
ndelangen Aug 15, 2018
1209703
REVERT changes to angular require-context (BROKEN)
ndelangen Aug 15, 2018
7ed57a8
FIX a warning in polymer storybook
ndelangen Aug 15, 2018
04f6ef8
Fix jest-ts-babel.js
igor-dv Aug 15, 2018
3c027a4
Try to fix CLI
igor-dv Aug 15, 2018
41d6168
CHANGE tot use babel7 everywhere (not just for our own build, but als…
ndelangen Aug 15, 2018
29e1c02
SORT package.json files
ndelangen Aug 15, 2018
107f5e0
FIX cli snapshots
ndelangen Aug 15, 2018
f627592
FIX incorrect dependency in app/html
ndelangen Aug 16, 2018
2b4f05b
FIX lockfile
ndelangen Aug 16, 2018
f36869a
TEMP FIX for hyperapp in netlify
ndelangen Aug 16, 2018
df723e0
REVERT deletion of smoke tests on cli output && REVERT babel6 cli fix…
ndelangen Aug 16, 2018
61d5c09
REVERT version-change for react in app/html
ndelangen Aug 16, 2018
224e1f9
UPDATE react & react-dom for app/svelte
ndelangen Aug 16, 2018
aadd8f0
CHANGE the installBabel to only install babel-loader & RENAME to inst…
ndelangen Aug 16, 2018
4fcf8cb
FIX snapshots
ndelangen Aug 16, 2018
3dec3ba
FIX lockfile
ndelangen Aug 16, 2018
5b9226b
CHANGE docs for migrating to babel 7
ndelangen Aug 16, 2018
c6dd3e4
REMOVE unneeded dependency
ndelangen Aug 16, 2018
773821d
CHANGE cli tests to e2e
ndelangen Aug 16, 2018
bfccae4
FIX package.json
ndelangen Aug 16, 2018
bbf7d8a
no message
ndelangen Aug 16, 2018
30fe991
FIX package.json in root version
ndelangen Aug 17, 2018
7b5dc84
FIX verdaccio.yaml
ndelangen Aug 17, 2018
40274f9
FIX cli/run_tests to install for each run individually
ndelangen Aug 17, 2018
165e996
FIX so tests are run in correct folder
ndelangen Aug 17, 2018
cb69d42
FIX so legacy packages *are* proxied
ndelangen Aug 17, 2018
305fff1
FIX webpack-react cli example
ndelangen Aug 17, 2018
f8332e7
CHANGE meteor generator babel file
ndelangen Aug 17, 2018
c0cd951
REMOVE the babel-root-slash-import module completely. It's not used b…
ndelangen Aug 17, 2018
7102951
Merge branch 'master' into babel-7
ndelangen Aug 21, 2018
451b8af
CHANGE teamcity config to test cli e2e via new script
ndelangen Aug 21, 2018
a05565b
UPGRADE to rc.2
ndelangen Aug 22, 2018
72e4b84
REVERT ci tests for ci via yarn test --cli
ndelangen Aug 22, 2018
ad78be3
CHANGE to silent installs during e2e
ndelangen Aug 22, 2018
70d9094
CHANGE to fixed version, otherwise they keep changing when testing
ndelangen Aug 22, 2018
2028cd4
Removed the added @babel/core everywhere
pksunkara Aug 22, 2018
94a049c
Revert "CHANGE the installBabel to only install babel-loader & RENAME…
pksunkara Aug 22, 2018
f1cf6d2
Remove unnecessary babel bridge installation in installBabel
pksunkara Aug 22, 2018
9c4cff4
Use installBabel for meteor cli
pksunkara Aug 22, 2018
9648d20
FIX scripts/test.js
ndelangen Aug 22, 2018
bb3e725
Pass registry url to lerna
pksunkara Aug 22, 2018
961fdef
Fixed cli test issues
pksunkara Aug 22, 2018
36a2676
Cleanup not needed anymore
Hypnosphi Aug 22, 2018
489d55d
Added babel-loader to app/svelte
pksunkara Aug 23, 2018
06d799c
Use 'babel-loader' without "require.resolve"
igor-dv Aug 23, 2018
c5f5433
Try to bring the CLI back
igor-dv Aug 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
{
"presets": ["env", "stage-0", "react"],
"env": {
"test": {
"plugins": ["require-context-hook"]
},
"plugins": [
"emotion",
"babel-plugin-macros",
["transform-runtime", {
"presets": [
"@babel/preset-env",
["@babel/preset-stage-0", { "decoratorsLegacy": true }],
Copy link
Member

@danielduan danielduan Aug 14, 2018

Choose a reason for hiding this comment

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

"@babel/preset-react",
"@babel/preset-flow"
],
"plugins": [
"babel-plugin-emotion",
"babel-plugin-macros",
[
"@babel/plugin-transform-runtime",
{
"polyfill": false,
"regenerator": true
}]
}
]
}
],
"env": {
"test": {
"plugins": ["babel-plugin-require-context-hook"]
}
},
"overrides": [
{
"test": "./examples/vue-kitchen-sink",
"presets": [
"@babel/preset-env",
["@babel/preset-stage-0", { "decoratorsLegacy": true }],
"babel-preset-vue"
]
}
]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lib/cli/test
*.js.map

!.remarkrc.js
!.babelrc.js
!.eslintrc.js
!.eslintrc-markdown.js
!.jest.config.js
Expand Down
16 changes: 16 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- [Removed addWithInfo](#removed-add-with-info)
- [Removed RN addons](#removed-rn-addons)
- [Storyshots changes](#storyshots-changes)
- [Webpack 4](#webpack-4)
- [Babel 7](#babel-7)
- [From version 3.3.x to 3.4.x](#from-version-33x-to-34x)
- [From version 3.2.x to 3.3.x](#from-version-32x-to-33x)
- [Refactored Knobs](#refactored-knobs)
Expand Down Expand Up @@ -54,6 +56,20 @@ will need to add a babel plugin to polyfill this functionality.
A possible plugin might be [babel-plugin-require-context-hook](https://github.com/smrq/babel-plugin-require-context-hook).
[README](https://github.com/storybooks/storybook/tree/master/addons/storyshots/storyshots-core#configure-jest-to-work-with-webpacks-requirecontext)

### Webpack 4

Storybook now uses webpack 4. If you have a [custom webpack config](https://storybook.js.org/configurations/custom-webpack-config/), make sure that all the loaders and plugins you use support webpack 4.

### Babel 7

Storybook now uses Babel 7. There's a couple of cases when it can break with your app:

* If you aren't using Babel yourself, and don't have .babelrc, install following dependencies:
```
npm i -D babel-core@bridge @babel/core babel-loader@next
Copy link
Member Author

@Hypnosphi Hypnosphi Aug 16, 2018

Choose a reason for hiding this comment

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

now it's only babel-loader. And it may also be needed for those that use Babel without webpack

Copy link
Member

Choose a reason for hiding this comment

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

done

```
* If you're using Babel 6, make sure that you have direct dependencies on `babel-core@6` and `babel-loader@7`.

## From version 3.3.x to 3.4.x

There are no expected breaking changes in the 3.4.x release, but 3.4 contains a major refactor to make it easier to support new frameworks, and we will document any breaking changes here if they arise.
Expand Down
1 change: 0 additions & 1 deletion addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@storybook/components": "4.0.0-alpha.14",
"@storybook/core-events": "4.0.0-alpha.14",
"axe-core": "^3.0.3",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"prop-types": "^15.6.1",
"react-emotion": "^9.1.3"
Expand Down
1 change: 0 additions & 1 deletion addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"dependencies": {
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/core-events": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"prop-types": "^15.6.1",
"react-emotion": "^9.1.3",
Expand Down
1 change: 0 additions & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"dependencies": {
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/core-events": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"format-json": "^1.0.3",
"prop-types": "^15.6.1",
"react-emotion": "^9.1.3",
Expand Down
1 change: 0 additions & 1 deletion addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"graphiql": "^0.11.11",
"graphql": "^0.13.2",
Expand Down
1 change: 0 additions & 1 deletion addons/info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/client-logger": "4.0.0-alpha.14",
"@storybook/components": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"core-js": "2.5.7",
"global": "^4.3.2",
"marksy": "^6.0.3",
Expand Down
36 changes: 20 additions & 16 deletions addons/info/src/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`addon Info should render <Info /> and external markdown 1`] = `
.emotion-2 {
.emotion-4 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -22,7 +22,7 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
overflow-x: scroll;
}

.emotion-1 {
.emotion-2 {
overflow: hidden;
border: 1px solid #eee;
border-radius: 3px;
Expand All @@ -38,12 +38,12 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
flex-shrink: 0;
}

.emotion-1:hover {
.emotion-2:hover {
background-color: #f4f7fa;
border-color: #ddd;
}

.emotion-1:active {
.emotion-2:active {
background-color: #e9ecef;
border-color: #ccc;
}
Expand Down Expand Up @@ -123,7 +123,9 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
>
<div>
<h1>
function func(x) {return x + 1;}
function func(x) {
return x + 1;
}
</h1>
<h2>
[object Object]
Expand Down Expand Up @@ -305,7 +307,7 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
>
<Styled(pre)>
<pre
className="emotion-2"
className="emotion-4 emotion-5"
>
<div>
<Node
Expand Down Expand Up @@ -1218,14 +1220,14 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
styles={Object {}}
>
<button
className="emotion-1"
className="emotion-2 emotion-3"
onClick={[Function]}
>
<Styled(div)
toggled={false}
>
<div
className="emotion-0"
className="emotion-0 emotion-1"
>
<div
style={
Expand Down Expand Up @@ -1306,7 +1308,7 @@ exports[`addon Info should render <Info /> and external markdown 1`] = `
`;

exports[`addon Info should render <Info /> and markdown 1`] = `
.emotion-2 {
.emotion-4 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -1327,7 +1329,7 @@ exports[`addon Info should render <Info /> and markdown 1`] = `
overflow-x: scroll;
}

.emotion-1 {
.emotion-2 {
overflow: hidden;
border: 1px solid #eee;
border-radius: 3px;
Expand All @@ -1343,12 +1345,12 @@ exports[`addon Info should render <Info /> and markdown 1`] = `
flex-shrink: 0;
}

.emotion-1:hover {
.emotion-2:hover {
background-color: #f4f7fa;
border-color: #ddd;
}

.emotion-1:active {
.emotion-2:active {
background-color: #e9ecef;
border-color: #ccc;
}
Expand Down Expand Up @@ -1430,7 +1432,9 @@ containing **bold**, *cursive* text, \`code\` and [a link](https://github.com)"
>
<div>
<h1>
function func(x) {return x + 1;}
function func(x) {
return x + 1;
}
</h1>
<h2>
[object Object]
Expand Down Expand Up @@ -1703,7 +1707,7 @@ containing **bold**, *cursive* text, \`code\` and [a link](https://github.com)"
>
<Styled(pre)>
<pre
className="emotion-2"
className="emotion-4 emotion-5"
>
<div>
<Node
Expand Down Expand Up @@ -2616,14 +2620,14 @@ containing **bold**, *cursive* text, \`code\` and [a link](https://github.com)"
styles={Object {}}
>
<button
className="emotion-1"
className="emotion-2 emotion-3"
onClick={[Function]}
>
<Styled(div)
toggled={false}
>
<div
className="emotion-0"
className="emotion-0 emotion-1"
>
<div
style={
Expand Down
1 change: 0 additions & 1 deletion addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"dependencies": {
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/components": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"prop-types": "^15.6.1",
"react-emotion": "^9.1.3",
Expand Down
1 change: 0 additions & 1 deletion addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/components": "4.0.0-alpha.14",
"@storybook/core-events": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"copy-to-clipboard": "^3.0.8",
"escape-html": "^1.0.3",
"fast-deep-equal": "^2.0.1",
Expand Down
1 change: 0 additions & 1 deletion addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@storybook/addons": "4.0.0-alpha.14",
"@storybook/components": "4.0.0-alpha.14",
"@storybook/core-events": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"prop-types": "^15.6.1"
},
Expand Down
1 change: 0 additions & 1 deletion addons/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
},
"dependencies": {
"@storybook/addons": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"marked": "^0.4.0",
"prop-types": "^15.6.1",
"react-emotion": "^9.1.3"
Expand Down
3 changes: 1 addition & 2 deletions addons/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0"
"@storybook/addons": "4.0.0-alpha.14"
},
"peerDependencies": {
"react": "*"
Expand Down
2 changes: 1 addition & 1 deletion addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@storybook/addons": "4.0.0-alpha.14",
"babel-runtime": "^6.26.0",
"glob": "^7.1.2",
"global": "^4.3.2",
"jest-specific-snapshot": "^0.5.0",
Expand Down
Loading