diff --git a/.babelrc.js b/.babelrc.js
index c1e808c5983..cb85c9eb2b7 100644
--- a/.babelrc.js
+++ b/.babelrc.js
@@ -13,7 +13,10 @@ const withTests = {
};
module.exports = {
- ignore: ['./lib/codemod/src/transforms/__testfixtures__'],
+ ignore: [
+ './lib/codemod/src/transforms/__testfixtures__',
+ './lib/postinstall/src/__testfixtures__',
+ ],
presets: [
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
'@babel/preset-typescript',
diff --git a/.eslintrc.js b/.eslintrc.js
index 37080fa43ba..3c53e6faad7 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,25 +1,21 @@
-const ignore = 0;
-// const warn = 1;
-const error = 2;
-
module.exports = {
root: true,
extends: ['@storybook/eslint-config-storybook'],
rules: {
'import/extensions': [
- error,
+ 'error',
'never',
{ ignorePackages: true, md: 'always', svg: 'always', json: 'always', tag: 'always' },
],
- 'import/no-unresolved': [error, { ignore: ['@storybook'] }],
- 'react/state-in-constructor': ignore,
- 'react/static-property-placement': ignore,
- 'react/jsx-props-no-spreading': ignore,
- 'react/jsx-fragments': ignore,
- '@typescript-eslint/ban-ts-ignore': ignore,
- '@typescript-eslint/no-object-literal-type-assertion': ignore,
+ 'import/no-unresolved': ['error', { ignore: ['@storybook'] }],
+ 'react/state-in-constructor': 'off',
+ 'react/static-property-placement': 'off',
+ 'react/jsx-props-no-spreading': 'off',
+ 'react/jsx-fragments': 'off',
+ '@typescript-eslint/ban-ts-ignore': 'off',
+ '@typescript-eslint/no-object-literal-type-assertion': 'off',
'react/sort-comp': [
- error,
+ 'error',
{
order: [
'staticLifecycle',
@@ -38,7 +34,7 @@ module.exports = {
},
},
],
- 'max-classes-per-file': ignore,
+ 'max-classes-per-file': 'off',
},
overrides: [
{
@@ -51,30 +47,30 @@ module.exports = {
'docs/src/stories/**',
],
rules: {
- '@typescript-eslint/no-empty-function': ignore,
- 'import/no-extraneous-dependencies': ignore,
+ '@typescript-eslint/no-empty-function': 'off',
+ 'import/no-extraneous-dependencies': 'off',
},
},
- { files: '**/.storybook/config.js', rules: { 'global-require': ignore } },
+ { files: '**/.storybook/config.js', rules: { 'global-require': 'off' } },
{
files: ['**/*.stories.*'],
rules: {
- 'no-console': ignore,
+ 'no-console': 'off',
},
},
{
files: ['**/*.tsx', '**/*.ts'],
rules: {
- 'react/prop-types': ignore, // we should use types
- 'no-dupe-class-members': ignore, // this is called overloads in typescript
+ 'react/prop-types': 'off', // we should use types
+ 'no-dupe-class-members': 'off', // this is called overloads in typescript
},
},
{
files: ['**/*.d.ts'],
rules: {
- 'vars-on-top': ignore,
- 'no-var': ignore, // this is how typescript works
- 'spaced-comment': ignore,
+ 'vars-on-top': 'off',
+ 'no-var': 'off', // this is how typescript works
+ 'spaced-comment': 'off',
},
},
],
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cb0146a53dd..1f3c86d548f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,148 @@
+## 5.3.0-beta.2 (November 19, 2019)
+
+### Features
+
+* Addon-docs: Customizable DocPage doc blocks ([#8855](https://github.com/storybookjs/storybook/pull/8855))
+
+### Bug Fixes
+
+* Addon-docs: Add back Props "exclude" support ([#8868](https://github.com/storybookjs/storybook/pull/8868))
+* Addon-docs: Fix MDX component permalinking ([#8872](https://github.com/storybookjs/storybook/pull/8872))
+* Addon-docs: Fix regression to @ignore in Props ([#8867](https://github.com/storybookjs/storybook/pull/8867))
+
+### Maintenance
+
+* Addon-docs: Add tests for prop types default value ([#8869](https://github.com/storybookjs/storybook/pull/8869))
+
+## 5.3.0-beta.1 (November 18, 2019)
+
+### Features
+
+* Addon-google-analytics: Add gaOption config ([#8859](https://github.com/storybookjs/storybook/pull/8859))
+
+### Bug Fixes
+
+* Addon-docs: Fix props table props sorting for PropTypes ([#8857](https://github.com/storybookjs/storybook/pull/8857))
+* Fix layout of Preview container ([#8628](https://github.com/storybookjs/storybook/pull/8628))
+
+## 5.3.0-beta.0 (November 16, 2019)
+
+Storybook 5.3 is in beta y'all 🔥🔥🔥 It includes:
+
+- 📝 Longform documentation in MDX
+- 🎨 Multi-framework SB Docs (React, Vue, Angular, WC)
+- 📦 Web-components framework support
+- 🔼 Tri-config (experimental)
+
+See the [latest changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) for a full list of changes.
+
+## 5.3.0-alpha.47 (November 16, 2019)
+
+### Features
+
+* Triconfig: Declarative story definition in main.js ([#8748](https://github.com/storybookjs/storybook/pull/8748))
+* Storyshots: Triconfig support ([#8765](https://github.com/storybookjs/storybook/pull/8765))
+
+### Bug Fixes
+
+* Addon-viewports: Fix missing TypeScript types ([#8848](https://github.com/storybookjs/storybook/pull/8848))
+
+### Dependency Upgrades
+
+* Dependency upgrades ([#8847](https://github.com/storybookjs/storybook/pull/8847))
+
+## 5.3.0-alpha.46 (November 16, 2019)
+
+### Features
+
+* Core: allow uppercase path names in url query param ([#8516](https://github.com/storybookjs/storybook/pull/8516))
+
+### Bug Fixes
+
+* Core: Fix null version check bug ([#8806](https://github.com/storybookjs/storybook/pull/8806))
+* Addon-notes: Fix anchor links ([#8132](https://github.com/storybookjs/storybook/pull/8132))
+
+### Maintenance
+
+* Refactor: remove useless variables from eslint config ([#8843](https://github.com/storybookjs/storybook/pull/8843))
+
+### Dependency Upgrades
+
+* Addon-docs: Replace `storybook-addon-vue-info` with `vue-docgen-loader` ([#8831](https://github.com/storybookjs/storybook/pull/8831))
+
+## 5.3.0-alpha.45 (November 14, 2019)
+
+### Breaking Changes
+
+* CSF: Deprecate displayName parameter ([#8775](https://github.com/storybookjs/storybook/pull/8775))
+
+### Features
+
+* Addon-docs: Rich prop tables ([#8826](https://github.com/storybookjs/storybook/pull/8826))
+* Core: Simplified hierarchy separators ([#8796](https://github.com/storybookjs/storybook/pull/8796))
+* CLI: Upgrade hierarchy separator codemod + examples ([#8818](https://github.com/storybookjs/storybook/pull/8818))
+* CLI: Addon postinstall hooks ([#8700](https://github.com/storybookjs/storybook/pull/8700))
+* CSF/MDX: Add component id for permalinks ([#8808](https://github.com/storybookjs/storybook/pull/8808))
+* Addon-knobs: Add object[] support for select ([#7957](https://github.com/storybookjs/storybook/pull/7957))
+
+### Bug Fixes
+
+* Addon-A11y: Show errors, reset config properly ([#8779](https://github.com/storybookjs/storybook/pull/8779))
+
+## 5.3.0-alpha.44 (November 13, 2019)
+
+### Features
+
+* React-native: Add theming to ondevice-addons ([#8738](https://github.com/storybookjs/storybook/pull/8738))
+
+### Bug Fixes
+
+* UI: Store layout state in sessionStorage ([#8786](https://github.com/storybookjs/storybook/pull/8786))
+* Core: Use `stable` package to ensure story sorting is stable ([#8795](https://github.com/storybookjs/storybook/pull/8795))
+
+### Maintenance
+
+* Svelte: Migrate @storybook/svelte to Typescript ([#8770](https://github.com/storybookjs/storybook/pull/8770))
+
+## 5.3.0-alpha.43 (November 11, 2019)
+
+### Bug Fixes
+
+* Source-loader: Warn if applied to non-stories file ([#8773](https://github.com/storybookjs/storybook/pull/8773))
+
+### Maintenance
+
+* Presets / Addon-docs: Cleanup framework-specific presets ([#8782](https://github.com/storybookjs/storybook/pull/8782))
+* Add @babel/runtime to workspace ([#8774](https://github.com/storybookjs/storybook/pull/8774))
+
+## 5.2.6 (November 9, 2019)
+
+### Bug Fixes
+
+* Addon-info: Remove jsnext:main ([#8764](https://github.com/storybookjs/storybook/pull/8764))
+* Addon-info: Fix "The prop 'children' is marked as required in 'Td'" ([#8745](https://github.com/storybookjs/storybook/pull/8745))
+* UI: Fix unmount components on Canvas/Docs tab switch ([#8625](https://github.com/storybookjs/storybook/pull/8625))
+* Addon-docs: Fix code style inside LI ([#8708](https://github.com/storybookjs/storybook/pull/8708))
+* Remove min-height CSS rule from DocsPage wrapper ([#8366](https://github.com/storybookjs/storybook/pull/8366))
+* Core: Revert webpack rebuild changes in node_modules ([#8657](https://github.com/storybookjs/storybook/pull/8657))
+* Addon-notes: Add key to render function ([#8633](https://github.com/storybookjs/storybook/pull/8633))
+* Addon-docs: Fix story scroll-to heuristics ([#8629](https://github.com/storybookjs/storybook/pull/8629))
+* React-native-server: Changed default port to number in CLI options ([#8584](https://github.com/storybookjs/storybook/pull/8584))
+* Increase TooltipLinkList max-height to accommodate more links ([#8545](https://github.com/storybookjs/storybook/pull/8545))
+* Prevent form submission as search is done while typing ([#8546](https://github.com/storybookjs/storybook/pull/8546))
+* Ondevice-knobs: Fix peer dep ([#8644](https://github.com/storybookjs/storybook/pull/8644))
+
+## 5.3.0-alpha.42 (November 9, 2019)
+
+### Bug Fixes
+
+* Addon-info: Remove jsnext:main ([#8764](https://github.com/storybookjs/storybook/pull/8764))
+* Addon-info: Fix "The prop 'children' is marked as required in 'Td'" ([#8745](https://github.com/storybookjs/storybook/pull/8745))
+
+### Maintenance
+
+* React-native: Update compilation target - it was compiled for old browsers ([#8698](https://github.com/storybookjs/storybook/pull/8698))
+
## 5.3.0-alpha.41 (November 7, 2019)
### Features
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 638e1aade6f..5235cf76da4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -327,9 +327,7 @@ First we are going to install storybook, then we are going to link `@storybook/r
You should now have a working storybook dev environment up and running.
-> TODO: update this section (is already incorrect)
-
-Save and go to `http://localhost:9009` (or wherever storybook is running)
+Save and go to `http://localhost:9011` (or wherever storybook is running)
If you don't see the changes rerun `yarn storybook` again in your sandbox app
diff --git a/MIGRATION.md b/MIGRATION.md
index ed9ccef19fb..4795757e5e9 100644
--- a/MIGRATION.md
+++ b/MIGRATION.md
@@ -5,6 +5,9 @@
- [Create React App preset](#create-react-app-preset)
- [Description doc block](#description-doc-block)
- [React Native Async Storage](#react-native-async-storage)
+ - [Deprecate displayName parameter](#deprecate-displayname-parameter)
+ - [Unified docs preset](#unified-docs-preset)
+ - [Simplified hierarchy separators](#simplified-hierarchy-separators)
- [From version 5.1.x to 5.2.x](#from-version-51x-to-52x)
- [Source-loader](#source-loader)
- [Default viewports](#default-viewports)
@@ -97,17 +100,41 @@ To avoid that now you have to manually pass asyncStorage to React Native Storybo
Solution:
-- Use `require('@react-native-community/async-storage')` for React Native v0.59 and above.
+- Use `require('@react-native-community/async-storage').AsyncStorage` for React Native v0.59 and above.
- Use `require('react-native').AsyncStorage` for React Native v0.58 or below.
- Use `null` to disable Async Storage completely.
```javascript
getStorybookUI({
...
- asyncStorage: require('@react-native-community/async-storage') || require('react-native').AsyncStorage || null
+ asyncStorage: require('@react-native-community/async-storage').AsyncStorage || require('react-native').AsyncStorage || null
});
```
+### Deprecate displayName parameter
+
+In 5.2, the story parameter `displayName` was introduced as a publicly visible (but internal) API. Storybook's Component Story Format (CSF) loader used it to modify a story's display name independent of the story's `name`/`id` (which were coupled).
+
+In 5.3, the CSF loader decouples the story's `name`/`id`, which means that `displayName` is no longer necessary. Unfortunately, this is a breaking change for any code that uses the story `name` field. Storyshots relies on story `name`, and the appropriate migration is to simply update your snapshots. Apologies for the inconvenience!
+
+### Unified docs preset
+
+Addon-docs configuration gets simpler in 5.3. In 5.2, each framework had its own preset, e.g. `@storybook/addon-docs/react/preset`. Starting in 5.3, everybody should use `@storybook/addon-docs/preset`.
+
+### Simplified hierarchy separators
+
+We've deprecated the ability to specify the hierarchy separators (how you control the grouping of story kinds in the sidebar). From Storybook 6.0 we will have a single separator `/`, which cannot be configured.
+
+If you are currently using using custom separators, we encourage you to migrate to using `/` as the sole separator. If you are using `|` or `.` as a separator currently, (we will soon provide) a codemod that can be used to rename all your components.
+
+If you were using `|` and wish to keep the "root" behaviour, use the `showRoots: true` option to re-enable roots:
+
+```js
+addParameters({ options: { showRoots: true } });
+```
+
+NOTE: it is no longer possible to have some stories with roots and others without. If you want to keep the old behaviour, simply add a root called "Others" to all your previously unrooted stories.
+
## From version 5.1.x to 5.2.x
### Source-loader
diff --git a/addons/a11y/README.md b/addons/a11y/README.md
index 584e49f6702..d4d2638a9e6 100755
--- a/addons/a11y/README.md
+++ b/addons/a11y/README.md
@@ -56,7 +56,6 @@ import { withA11y } from '@storybook/addon-a11y';
addDecorator(withA11y)
addParameters({
a11y: {
- // ... axe options
element: '#root', // optional selector which element to inspect
config: {}, // axe-core configurationOptions (https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#parameters-1)
options: {} // axe-core optionsParameter (https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter)
diff --git a/addons/a11y/package.json b/addons/a11y/package.json
index 7625a213231..ac52a597640 100644
--- a/addons/a11y/package.json
+++ b/addons/a11y/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
- "version": "5.3.0-alpha.41",
+ "version": "5.3.0-beta.2",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
@@ -33,12 +33,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "5.3.0-alpha.41",
- "@storybook/api": "5.3.0-alpha.41",
- "@storybook/client-logger": "5.3.0-alpha.41",
- "@storybook/components": "5.3.0-alpha.41",
- "@storybook/core-events": "5.3.0-alpha.41",
- "@storybook/theming": "5.3.0-alpha.41",
+ "@storybook/addons": "5.3.0-beta.2",
+ "@storybook/api": "5.3.0-beta.2",
+ "@storybook/client-logger": "5.3.0-beta.2",
+ "@storybook/components": "5.3.0-beta.2",
+ "@storybook/core-events": "5.3.0-beta.2",
+ "@storybook/theming": "5.3.0-beta.2",
"axe-core": "^3.3.2",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/addons/a11y/src/components/A11YPanel.test.js b/addons/a11y/src/components/A11YPanel.test.js
index 5c57664c573..2f84b31afd3 100644
--- a/addons/a11y/src/components/A11YPanel.test.js
+++ b/addons/a11y/src/components/A11YPanel.test.js
@@ -63,7 +63,7 @@ function ThemedA11YPanel(props) {
}
describe('A11YPanel', () => {
- it('should register STORY_RENDERED and RESULT updater on mount', () => {
+ it('should register STORY_RENDERED, RESULT and ERROR updater on mount', () => {
// given
const api = createApi();
expect(api.on).not.toHaveBeenCalled();
@@ -72,9 +72,10 @@ describe('A11YPanel', () => {
mount(