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

Core: Remove project root babel.config.js loading #7573

Merged
merged 1 commit into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
127 changes: 68 additions & 59 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,69 @@
# Migration

- [Migration](#Migration)
- [From version 5.1.x to 5.2.x](#From-version-51x-to-52x)
- [Docs mode docgen](#Docs-mode-docgen)
- [storySort option](#storySort-option)
- [From version 5.0.x to 5.1.x](#From-version-50x-to-51x)
- [React native server](#React-native-server)
- [Angular 7](#Angular-7)
- [CoreJS 3](#CoreJS-3)
- [From version 5.0.1 to 5.0.2](#From-version-501-to-502)
- [Deprecate webpack extend mode](#Deprecate-webpack-extend-mode)
- [From version 4.1.x to 5.0.x](#From-version-41x-to-50x)
- [sortStoriesByKind](#sortStoriesByKind)
- [Webpack config simplification](#Webpack-config-simplification)
- [Theming overhaul](#Theming-overhaul)
- [Story hierarchy defaults](#Story-hierarchy-defaults)
- [Options addon deprecated](#Options-addon-deprecated)
- [Individual story decorators](#Individual-story-decorators)
- [Addon backgrounds uses parameters](#Addon-backgrounds-uses-parameters)
- [Addon cssresources name attribute renamed](#Addon-cssresources-name-attribute-renamed)
- [Addon viewport uses parameters](#Addon-viewport-uses-parameters)
- [Addon a11y uses parameters, decorator renamed](#Addon-a11y-uses-parameters-decorator-renamed)
- [New keyboard shortcuts defaults](#New-keyboard-shortcuts-defaults)
- [New URL structure](#New-URL-structure)
- [Rename of the `--secure` cli parameter to `--https`](#Rename-of-the---secure-cli-parameter-to---https)
- [Vue integration](#Vue-integration)
- [From version 4.0.x to 4.1.x](#From-version-40x-to-41x)
- [Private addon config](#Private-addon-config)
- [React 15.x](#React-15x)
- [From version 3.4.x to 4.0.x](#From-version-34x-to-40x)
- [React 16.3+](#React-163)
- [Generic addons](#Generic-addons)
- [Knobs select ordering](#Knobs-select-ordering)
- [Knobs URL parameters](#Knobs-URL-parameters)
- [Keyboard shortcuts moved](#Keyboard-shortcuts-moved)
- [Removed addWithInfo](#Removed-addWithInfo)
- [Removed RN packager](#Removed-RN-packager)
- [Removed RN addons](#Removed-RN-addons)
- [Storyshots Changes](#Storyshots-Changes)
- [Webpack 4](#Webpack-4)
- [Babel 7](#Babel-7)
- [Create-react-app](#Create-react-app)
- [Upgrade CRA1 to babel 7](#Upgrade-CRA1-to-babel-7)
- [Migrate CRA1 while keeping babel 6](#Migrate-CRA1-while-keeping-babel-6)
- [Migration](#migration)
- [From version 5.1.x to 5.2.x](#from-version-51x-to-52x)
- [Grid toolbar-feature](#grid-toolbar-feature)
- [Docs mode docgen](#docs-mode-docgen)
- [storySort option](#storysort-option)
- [From version 5.1.x to 5.1.10](#from-version-51x-to-5110)
- [babel.config.js support](#babelconfigjs-support)
- [From version 5.0.x to 5.1.x](#from-version-50x-to-51x)
- [React native server](#react-native-server)
- [Angular 7](#angular-7)
- [CoreJS 3](#corejs-3)
- [From version 5.0.1 to 5.0.2](#from-version-501-to-502)
- [Deprecate webpack extend mode](#deprecate-webpack-extend-mode)
- [From version 4.1.x to 5.0.x](#from-version-41x-to-50x)
- [sortStoriesByKind](#sortstoriesbykind)
- [Webpack config simplification](#webpack-config-simplification)
- [Theming overhaul](#theming-overhaul)
- [Story hierarchy defaults](#story-hierarchy-defaults)
- [Options addon deprecated](#options-addon-deprecated)
- [Individual story decorators](#individual-story-decorators)
- [Addon backgrounds uses parameters](#addon-backgrounds-uses-parameters)
- [Addon cssresources name attribute renamed](#addon-cssresources-name-attribute-renamed)
- [Addon viewport uses parameters](#addon-viewport-uses-parameters)
- [Addon a11y uses parameters, decorator renamed](#addon-a11y-uses-parameters-decorator-renamed)
- [New keyboard shortcuts defaults](#new-keyboard-shortcuts-defaults)
- [New URL structure](#new-url-structure)
- [Rename of the `--secure` cli parameter to `--https`](#rename-of-the---secure-cli-parameter-to---https)
- [Vue integration](#vue-integration)
- [From version 4.0.x to 4.1.x](#from-version-40x-to-41x)
- [Private addon config](#private-addon-config)
- [React 15.x](#react-15x)
- [From version 3.4.x to 4.0.x](#from-version-34x-to-40x)
- [React 16.3+](#react-163)
- [Generic addons](#generic-addons)
- [Knobs select ordering](#knobs-select-ordering)
- [Knobs URL parameters](#knobs-url-parameters)
- [Keyboard shortcuts moved](#keyboard-shortcuts-moved)
- [Removed addWithInfo](#removed-addwithinfo)
- [Removed RN packager](#removed-rn-packager)
- [Removed RN addons](#removed-rn-addons)
- [Storyshots Changes](#storyshots-changes)
- [Webpack 4](#webpack-4)
- [Babel 7](#babel-7)
- [Create-react-app](#create-react-app)
- [Upgrade CRA1 to babel 7](#upgrade-cra1-to-babel-7)
- [Migrate CRA1 while keeping babel 6](#migrate-cra1-while-keeping-babel-6)
- [start-storybook opens browser](#start-storybook-opens-browser)
- [CLI Rename](#CLI-Rename)
- [Addon story parameters](#Addon-story-parameters)
- [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)
- [CLI Rename](#cli-rename)
- [Addon story parameters](#addon-story-parameters)
- [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)
- [`babel-core` is now a peer dependency (#2494)](#babel-core-is-now-a-peer-dependency-2494)
- [Base webpack config now contains vital plugins (#1775)](#Base-webpack-config-now-contains-vital-plugins-1775)
- [Refactored Knobs](#Refactored-Knobs)
- [From version 3.1.x to 3.2.x](#From-version-31x-to-32x)
- [Moved TypeScript addons definitions](#Moved-TypeScript-addons-definitions)
- [Updated Addons API](#Updated-Addons-API)
- [From version 3.0.x to 3.1.x](#From-version-30x-to-31x)
- [Moved TypeScript definitions](#Moved-TypeScript-definitions)
- [Deprecated head.html](#Deprecated-headhtml)
- [From version 2.x.x to 3.x.x](#From-version-2xx-to-3xx)
- [Webpack upgrade](#Webpack-upgrade)
- [Packages renaming](#Packages-renaming)
- [Deprecated embedded addons](#Deprecated-embedded-addons)
- [Base webpack config now contains vital plugins (#1775)](#base-webpack-config-now-contains-vital-plugins-1775)
- [Refactored Knobs](#refactored-knobs)
- [From version 3.1.x to 3.2.x](#from-version-31x-to-32x)
- [Moved TypeScript addons definitions](#moved-typescript-addons-definitions)
- [Updated Addons API](#updated-addons-api)
- [From version 3.0.x to 3.1.x](#from-version-30x-to-31x)
- [Moved TypeScript definitions](#moved-typescript-definitions)
- [Deprecated head.html](#deprecated-headhtml)
- [From version 2.x.x to 3.x.x](#from-version-2xx-to-3xx)
- [Webpack upgrade](#webpack-upgrade)
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)

## From version 5.1.x to 5.2.x

Expand Down Expand Up @@ -89,6 +92,12 @@ addParameters({
});
```

## From version 5.1.x to 5.1.10

### babel.config.js support

SB 5.1.0 added [support for project root `babel.config.js` files](https://github.com/storybookjs/storybook/pull/6634), which was an [unintentional breaking change](https://github.com/storybookjs/storybook/issues/7058#issuecomment-515398228). 5.1.10 fixes this, but if you relied on project root `babel.config.js` support, this bugfix is a breaking change. The workaround is to copy the file into your `.storybook` config directory. We may add back project-level support in 6.0.

## From version 5.0.x to 5.1.x

### React native server
Expand Down
6 changes: 4 additions & 2 deletions lib/core/src/server/utils/load-custom-babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ function isBabelLoader8() {
}

export default async function(configDir, getDefaultConfig) {
const projectRoot = process.cwd();
// Between versions 5.1.0 - 5.1.9 this loaded babel.config.js from the project
// root, which was an unintentional breaking change. We can add back project support
// in 6.0.
const babelConfig =
loadFromPath(path.resolve(configDir, '.babelrc')) ||
loadFromPath(path.resolve(projectRoot, 'babel.config.js'));
loadFromPath(path.resolve(configDir, 'babel.config.js'));

if (babelConfig) {
// If the custom config uses babel's `extends` clause, then replace it with
Expand Down