-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Use babelrc: false
only for custom config in .storybook
directory
#4077
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { storiesOf } from '@storybook/marko'; | ||
import { withKnobs, boolean, text, number } from '@storybook/addon-knobs'; | ||
import { withKnobs, text, number } from '@storybook/addon-knobs'; | ||
import { withOptions } from '@storybook/addon-options'; | ||
import Hello from '../components/hello/index.marko'; | ||
import MarkoWidgetHello from '../components/marko-widgets/hello'; | ||
import MarkoWidgetButton from '../components/marko-widgets/button'; | ||
|
||
storiesOf('Addons|Knobs/Hello', module) | ||
.addDecorator(withOptions) | ||
|
@@ -17,27 +15,3 @@ storiesOf('Addons|Knobs/Hello', module) | |
age, | ||
}); | ||
}); | ||
|
||
storiesOf('Addons|Knobs/Hello (Marko Widget)', module) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no widgets in a new version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like they decided to drop this functionality There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CC @nm123github |
||
.addDecorator(withOptions) | ||
.addDecorator(withKnobs) | ||
.addParameters({ options: { addonPanelInRight: false } }) | ||
.add('Simple', () => { | ||
const name = text('Name', 'John Doe'); | ||
return MarkoWidgetHello.renderSync({ | ||
name, | ||
}); | ||
}); | ||
|
||
storiesOf('Addons|Knobs/Button (Marko Widget)', module) | ||
.addDecorator(withKnobs) | ||
.add('Simple', () => { | ||
const body = text('Body', 'Hello Button'); | ||
const priority = text('Priority', 'danger'); | ||
const disabled = boolean('Disabled', false); | ||
return MarkoWidgetButton.renderSync({ | ||
body, | ||
priority, | ||
disabled, | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
// automatically import all files ending in *.stories.js | ||
const req = require.context('../stories', true, /.stories.js$/); | ||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
configure(loadStories, module); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
plugins: ['@babel/plugin-proposal-optional-chaining'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "react-babel-config-js-fixture", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"main": "stories/index.stories.js", | ||
"scripts": { | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
"dependencies": { | ||
"react": "^16.4.2", | ||
"react-dom": "^16.4.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "7.0.0-rc.3", | ||
"@babel/core": "7.0.0-rc.3", | ||
"babel-loader": "8.0.0-beta.6", | ||
"@storybook/react": "^4.0.0-alpha.17" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
|
||
const data = { | ||
user: { | ||
name: 'Joe', | ||
}, | ||
}; | ||
|
||
storiesOf('My Component', module) | ||
.add('state', () => <span>Hello {data.user?.name}</span>) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["./babel-preset-custom"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
// automatically import all files ending in *.stories.js | ||
const req = require.context('../stories', true, /.stories.js$/); | ||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
configure(loadStories, module); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = () => ({ | ||
plugins: ['@babel/plugin-proposal-optional-chaining'], | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "react-babel-custom-preset-fixture", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"main": "stories/index.stories.js", | ||
"scripts": { | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
"dependencies": { | ||
"react": "^16.4.2", | ||
"react-dom": "^16.4.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "7.0.0-rc.3", | ||
"@babel/core": "7.0.0-rc.3", | ||
"babel-loader": "8.0.0-beta.6", | ||
"@storybook/react": "^4.0.0-alpha.17" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
|
||
const data = { | ||
user: { | ||
name: 'Joe', | ||
}, | ||
}; | ||
|
||
storiesOf('My Component', module) | ||
.add('state', () => <span>Hello {data.user?.name}</span>) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
// automatically import all files ending in *.stories.js | ||
const req = require.context('../stories', true, /.stories.js$/); | ||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
configure(loadStories, module); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "react-babel-pkg-json-fixture", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"main": "stories/index.stories.js", | ||
"scripts": { | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
"dependencies": { | ||
"react": "^16.4.2", | ||
"react-dom": "^16.4.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "7.0.0-rc.3", | ||
"@babel/core": "7.0.0-rc.3", | ||
"babel-loader": "8.0.0-beta.6", | ||
"@storybook/react": "^4.0.0-alpha.17" | ||
}, | ||
"babel": { | ||
"plugins": ["@babel/plugin-proposal-optional-chaining"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
|
||
const data = { | ||
user: { | ||
name: 'Joe', | ||
}, | ||
}; | ||
|
||
storiesOf('My Component', module) | ||
.add('state', () => <span>Hello {data.user?.name}</span>) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["@babel/plugin-proposal-optional-chaining"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
// automatically import all files ending in *.stories.js | ||
const req = require.context('../stories', true, /.stories.js$/); | ||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
configure(loadStories, module); |
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.
why delete the widgets?
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.
They are deprecated and don't support marko 4
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.
okay, clear!