Skip to content

Commit

Permalink
Merge branch 'master' into angular-cli-stories-separation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen authored Dec 28, 2017
2 parents 7d422a8 + ce993cc commit 469ecb1
Show file tree
Hide file tree
Showing 58 changed files with 337 additions and 261 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# 3.3.3

2017-December-29

#### Bug Fixes

- [app:angular] Fixed dependency injection for components [#2566](https://github.com/storybooks/storybook/pull/2566)
- Revert "Move everything from lodash to lodash-es" [#2591](https://github.com/storybooks/storybook/pull/2591)

#### Maintenance

- Update CLI snapshots as a postpublish step [#2565](https://github.com/storybooks/storybook/pull/2565)
- Add more `imports` eslint rules [#2589](https://github.com/storybooks/storybook/pull/2589)

#### Dependency Upgrades

- Upgraded `@storybook/addon-actions` in `/docs` from "3.2.18" to "3.3.1" [#2580](https://github.com/storybooks/storybook/pull/2580)
- Upgraded `@storybook/addon-links` in `/docs` from "3.2.18" to "3.3.1" [#2580](https://github.com/storybooks/storybook/pull/2580)
- Upgraded `@storybook/addons` in `/docs` from "3.2.18" to "3.3.1" [#2580](https://github.com/storybooks/storybook/pull/2580)
- Upgraded `@storybook/react` in `/docs` from "3.2.18" to "3.3.1" [#2580](https://github.com/storybooks/storybook/pull/2580)

# 3.3.2

2017-December-28
Expand Down
6 changes: 3 additions & 3 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "3.3.2",
"version": "3.3.3",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
Expand All @@ -25,8 +25,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/components": "^3.3.2",
"axe-core": "^2.6.0",
"@storybook/components": "^3.3.3",
"axe-core": "^2.6.1",
"prop-types": "^15.6.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "3.3.2",
"version": "3.3.3",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion addons/background/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "3.3.2",
"version": "3.3.3",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion addons/centered/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-centered",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook decorator to center components",
"license": "MIT",
"author": "Muhammed Thanish <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
"version": "3.3.2",
"version": "3.3.3",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion addons/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"storybook"
Expand Down
6 changes: 3 additions & 3 deletions addons/info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-info",
"version": "3.3.2",
"version": "3.3.3",
"description": "A Storybook addon to show additional information for your stories.",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -15,8 +15,8 @@
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"@storybook/client-logger": "^3.3.2",
"@storybook/components": "^3.3.2",
"@storybook/client-logger": "^3.3.3",
"@storybook/components": "^3.3.3",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
"marksy": "^6.0.1",
Expand Down
4 changes: 2 additions & 2 deletions addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "3.3.2",
"version": "3.3.3",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand All @@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/components": "^3.3.2",
"@storybook/components": "^3.3.3",
"glamor": "^2.20.40",
"glamorous": "^4.11.2",
"global": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion addons/knobs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook Addon Prop Editor Component",
"license": "MIT",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions addons/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "3.3.2",
"version": "3.3.3",
"description": "Story Links addon for storybook",
"keywords": [
"storybook"
Expand All @@ -22,7 +22,7 @@
"storybook": "start-storybook -p 9001"
},
"dependencies": {
"@storybook/components": "^3.3.2",
"@storybook/components": "^3.3.3",
"global": "^4.3.2",
"prop-types": "^15.5.10"
},
Expand Down
2 changes: 1 addition & 1 deletion addons/notes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-notes",
"version": "3.3.2",
"version": "3.3.3",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion addons/options/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-options",
"version": "3.3.2",
"version": "3.3.3",
"description": "Options addon for storybook",
"keywords": [
"storybook"
Expand Down
12 changes: 6 additions & 6 deletions addons/storyshots/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
"version": "3.3.2",
"version": "3.3.3",
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -16,7 +16,7 @@
"example": "jest storyshot.test"
},
"dependencies": {
"@storybook/channels": "^3.3.2",
"@storybook/channels": "^3.3.3",
"babel-runtime": "^6.26.0",
"glob": "^7.1.2",
"global": "^4.3.2",
Expand All @@ -25,8 +25,8 @@
"read-pkg-up": "^3.0.0"
},
"devDependencies": {
"@storybook/addons": "^3.3.2",
"@storybook/react": "^3.3.2",
"@storybook/addons": "^3.3.3",
"@storybook/react": "^3.3.3",
"babel-cli": "^6.26.0",
"babel-jest": "^20.0.3",
"babel-plugin-transform-runtime": "^6.23.0",
Expand All @@ -40,8 +40,8 @@
"react-dom": "^16.1.0"
},
"peerDependencies": {
"@storybook/addons": "^3.3.2",
"babel-core": "^6.26.0 | ^7.0.0-0",
"@storybook/addons": "^3.3.3",
"babel-core": "^6.26.0 || ^7.0.0-0",
"react": "*",
"react-test-renderer": "*"
}
Expand Down
4 changes: 2 additions & 2 deletions addons/viewport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook addon to change the viewport size to mobile",
"main": "register.js",
"keywords": [
Expand All @@ -11,7 +11,7 @@
},
"license": "MIT",
"dependencies": {
"@storybook/components": "^3.3.2",
"@storybook/components": "^3.3.3",
"global": "^4.3.2",
"prop-types": "^15.5.10"
},
Expand Down
12 changes: 6 additions & 6 deletions app/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook for Anglar: Develop Angular Components in isolation with Hot Reloading.",
"homepage": "https://github.com/storybooks/storybook/tree/master/apps/angular",
"bugs": {
Expand All @@ -23,11 +23,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addon-actions": "^3.3.2",
"@storybook/addon-links": "^3.3.2",
"@storybook/addons": "^3.3.2",
"@storybook/channel-postmessage": "^3.3.2",
"@storybook/ui": "^3.3.2",
"@storybook/addon-actions": "^3.3.3",
"@storybook/addon-links": "^3.3.3",
"@storybook/addons": "^3.3.3",
"@storybook/channel-postmessage": "^3.3.3",
"@storybook/ui": "^3.3.3",
"airbnb-js-shims": "^1.1.1",
"angular2-template-loader": "^0.6.2",
"autoprefixer": "^7.1.1",
Expand Down
2 changes: 2 additions & 0 deletions app/angular/src/client/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ const renderUI = () => {
};

reduxStore.subscribe(renderUI);

export const forceReRender = () => render(context, true);
8 changes: 4 additions & 4 deletions app/angular/src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function renderException(error) {
logger.error(error.stack);
}

export function renderMain(data, storyStore) {
export function renderMain(data, storyStore, forceRender) {
if (storyStore.size() === 0) return null;

const { selectedKind, selectedStory } = data;
Expand All @@ -39,7 +39,7 @@ export function renderMain(data, storyStore) {
// https://github.com/storybooks/react-storybook/issues/116

const reRender = selectedKind !== previousKind || previousStory !== selectedStory;
if (reRender) {
if (reRender || forceRender) {
// We need to unmount the existing set of components in the DOM node.
// Otherwise, React may not recrease instances for every story run.
// This could leads to issues like below:
Expand All @@ -54,14 +54,14 @@ export function renderMain(data, storyStore) {
return renderNgApp(story, context, reRender);
}

export default function renderPreview({ reduxStore, storyStore }) {
export default function renderPreview({ reduxStore, storyStore }, forceRender = false) {
const state = reduxStore.getState();
if (state.error) {
return renderException(state.error);
}

try {
return renderMain(state, storyStore);
return renderMain(state, storyStore, forceRender);
} catch (ex) {
return renderException(ex);
}
Expand Down
14 changes: 7 additions & 7 deletions app/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-native",
"version": "3.3.2",
"version": "3.3.3",
"description": "A better way to develop React Native Components for your app",
"keywords": [
"react",
Expand All @@ -25,11 +25,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addon-actions": "^3.3.2",
"@storybook/addon-links": "^3.3.2",
"@storybook/addons": "^3.3.2",
"@storybook/channel-websocket": "^3.3.2",
"@storybook/ui": "^3.3.2",
"@storybook/addon-actions": "^3.3.3",
"@storybook/addon-links": "^3.3.3",
"@storybook/addons": "^3.3.3",
"@storybook/channel-websocket": "^3.3.3",
"@storybook/ui": "^3.3.3",
"autoprefixer": "^7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-syntax-async-functions": "^6.13.0",
Expand Down Expand Up @@ -76,7 +76,7 @@
"react-native": "^0.51.0"
},
"peerDependencies": {
"babel-core": "^6.26.0 | ^7.0.0-0",
"babel-core": "^6.26.0 || ^7.0.0-0",
"react": "*",
"react-native": ">=0.27.0"
}
Expand Down
16 changes: 8 additions & 8 deletions app/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/react",
"version": "3.3.2",
"version": "3.3.3",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybooks/storybook/tree/master/app/react",
"bugs": {
Expand All @@ -23,13 +23,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addon-actions": "^3.3.2",
"@storybook/addon-links": "^3.3.2",
"@storybook/addons": "^3.3.2",
"@storybook/channel-postmessage": "^3.3.2",
"@storybook/client-logger": "^3.3.2",
"@storybook/node-logger": "^3.3.2",
"@storybook/ui": "^3.3.2",
"@storybook/addon-actions": "^3.3.3",
"@storybook/addon-links": "^3.3.3",
"@storybook/addons": "^3.3.3",
"@storybook/channel-postmessage": "^3.3.3",
"@storybook/client-logger": "^3.3.3",
"@storybook/node-logger": "^3.3.3",
"@storybook/ui": "^3.3.3",
"airbnb-js-shims": "^1.4.0",
"autoprefixer": "^7.2.3",
"babel-loader": "^7.1.2",
Expand Down
9 changes: 8 additions & 1 deletion app/react/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import deprecate from 'util-deprecate';
import { action as deprecatedAction } from '@storybook/addon-actions';
import { linkTo as deprecatedLinkTo } from '@storybook/addon-links';

export { storiesOf, setAddon, addDecorator, configure, getStorybook } from './preview';
export {
storiesOf,
setAddon,
addDecorator,
configure,
getStorybook,
forceReRender,
} from './preview';

export const action = deprecate(
deprecatedAction,
Expand Down
4 changes: 4 additions & 0 deletions app/react/src/client/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const isBrowser =
!(navigator.userAgent.indexOf('jsdom') > -1);

const storyStore = new StoryStore();
/* eslint-disable no-underscore-dangle */
const reduxStore = createStore(reducer);
/* eslint-enable */
const context = { storyStore, reduxStore };

if (isBrowser) {
Expand Down Expand Up @@ -54,3 +56,5 @@ const renderUI = () => {
};

reduxStore.subscribe(renderUI);

export const forceReRender = () => render(context, true);
Loading

0 comments on commit 469ecb1

Please sign in to comment.