-
-
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
Storybook 3.0 release #1046
Comments
|
We use milestones to signify which release a issue / pr is planned. |
I'm just awaiting final sign off on #1049 🎉 |
@ndelangen @tmeasday @aaronmcadam @usulpro @mnmtanish Proposed release workflow. Thoughts/feedback welcome! The publisher (e.g. one of us) should:
NOTE1: for pre-releases we should only tag the release and should not actually generate a github release, which means we should use the NOTE2: this is also compatible with a manual CHANGELOG strategy if we end up falling back to that. |
Seems like a good start. I think as long as we keep a document somewhere with the instructions up to date with what we are actually doing on releases it'll be good. The details of the process are less important than documenting it so people are consistent. |
@tmeasday thanks. have updated the proposal and added it to the end of |
Great job guys! Will this make Storybook work with Webpack 2? |
yes, you can try out the release condidate right now: If you already have a project you want to migrate, we're working on a migration guide, but the gist of it is:
Hope everything works for you. Please let us know if things are broken. |
Amazing @ndelangen - I didn't know I could start using the alpha. I have downloaded and migrated our few stories (we literally started using Storybook last week so it hasn't been dramatic. I admit we are not heavy users yet but as far as I can see, the webpack integration finally worked for me. However, I have experienced a new issue for me - Every time I open a new story I get an error message saying "No Preview Available" (see screenshot below). If I refresh the page, I can then see my story. Got any idea of why? Thanks again for your great job! |
Are you sure everything is migrated? |
My project is a fork of react-redux-starter-kit - They have recently upgraded to webpack 2 so did I - That is why my Storybook stopped working and I am here now :) Here are the files that I am using to run Storybook: .storybook/config.jsimport { configure } from '@storybook/react';
const req = require.context('../src/components', true, /\.stories\.js$/)
console.log(req)
function loadStories() {
require('../stories');
req.keys().forEach((filename) => req(filename))
}
configure(loadStories, module); .storybook/webpack.config.jsconst path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const project = require('../project.config')
const inProject = path.resolve.bind(path, project.basePath)
const inProjectSrc = (file) => inProject(project.srcDir, file)
const __DEV__ = project.env === 'development'
const __TEST__ = project.env === 'test'
const __PROD__ = project.env === 'production'
let fontLoaders = new Array();
;[
['woff', 'application/font-woff'],
['woff2', 'application/font-woff2'],
['otf', 'font/opentype'],
['ttf', 'application/octet-stream'],
['eot', 'application/vnd.ms-fontobject'],
['svg', 'image/svg+xml'],
].forEach((font) => {
const extension = font[0]
const mimetype = font[1]
fontLoaders.push({
test : new RegExp(`\\.${extension}$`),
loader : 'url-loader',
options : {
name : 'fonts/[name].[ext]',
limit : 10000,
mimetype,
},
})
})
const extractStyles = new ExtractTextPlugin({
filename: 'styles/[name].[contenthash].css',
allChunks: true,
disable: __DEV__,
})
module.exports = {
plugins: [
// your custom plugins
extractStyles
],
module: {
rules: [
// add your custom loaders.
...fontLoaders,
{
test: /\.(sass|scss|css)$/,
loader: extractStyles.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
sourceMap: project.sourcemaps,
minimize: {
autoprefixer: {
add: true,
remove: true,
browsers: ['last 2 versions'],
},
discardComments: {
removeAll : true,
},
discardUnused: false,
mergeIdents: false,
reduceIdents: false,
safe: true,
sourcemap: project.sourcemaps,
},
},
},
{
loader: 'sass-loader',
options: {
sourceMap: project.sourcemaps,
includePaths: [
inProjectSrc('styles'),
],
},
}
],
})
}
],
},
}; stories/index.jsimport React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import Button from './Button';
import Welcome from './Welcome';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
storiesOf('Button', module)
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>); src/components/RouteCircleButton/RouteCircleButton.stories.jsimport React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import RouteCircleButton from './RouteCircleButton'
const Story = ({ name, icon }) => (
<RouteCircleButton name='Test' icon='user' />
);
Story.propTypes = {
name: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired
};
storiesOf('RouteCircleButton', module)
.add('Incomplete', () => (
<RouteCircleButton name="Profile Information" icon="user" status='0' />
))
.add('Started', () => (
<RouteCircleButton name="Profile Information" icon="user" status='50' />
))
.add('Next', () => (
<RouteCircleButton name="Profile Information" icon="user" status='0' isNext />
))
.add('Completed', () => (
<RouteCircleButton name="Profile Information" icon="user" status={100} />
))
.add('Disabled', () => (
<RouteCircleButton name="Profile Information" icon="user" disabled={true} />
)); Am I doing something wrong? |
I think in your case it's best to use the 'full control mode' for your webpack configuration: But I can't see anything wrong with your configs really.. Can you show your |
I have changed the |
I have an update, I have successfully integrated the full control mode (thanks for the hint) but I am still facing the "no preview available" issue. The update is that I have tested moving my story to Working config.jsimport { configure } from '@storybook/react';
function loadStories() {
require('../stories');
}
configure(loadStories, module); Non-Working config.jsimport { configure } from '@storybook/react';
const req = require.context('../src/components', true, /\.stories\.js$/)
function loadStories() {
require('../stories');
req.keys().forEach((filename) => req(filename))
}
configure(loadStories, module); stories/index.js (working)import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import Button from './Button';
import Welcome from './Welcome';
import RouteCircleButton from '../src/components/RouteCircleButton';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
storiesOf('Button', module)
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>);
storiesOf('RouteCircleButton', module).add('to Storybook', () => <RouteCircleButton name="Profile Information" icon="user" status='0' />); Story inside the component (not working)import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import RouteCircleButton from './RouteCircleButton'
const Story = ({ name, icon }) => (
<RouteCircleButton name='Test' icon='user' />
);
Story.propTypes = {
name: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired
};
storiesOf('RouteCircleButton', module)
.add('Incomplete', () => (
<RouteCircleButton name="Profile Information" icon="user" status='0' />
))
.add('Started', () => (
<RouteCircleButton name="Profile Information" icon="user" status='50' />
))
.add('Next', () => (
<RouteCircleButton name="Profile Information" icon="user" status='0' isNext />
))
.add('Completed', () => (
<RouteCircleButton name="Profile Information" icon="user" status={100} />
))
.add('Disabled', () => (
<RouteCircleButton name="Profile Information" icon="user" disabled={true} />
));
|
Sorry for spamming with so many comments but I have just realised I had a component still requiring the old version of storybook. Changed that, it works without any problem. Thanks a lot for your work. :) |
Haha, thanks for posting the solution, you never know others might find this page, and have the same problem. I'm super happy it works for you. 🎉 |
#why
This is a big release in the new org and we should make sure it gets done properly and is simple to repeat for future major and minor releases.
what
The text was updated successfully, but these errors were encountered: