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

Release: Prerelease 8.0.0-alpha.3 #25169

Merged
merged 56 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
df2e7d8
Addon-docs: Fix storybook MDX check
shilman Nov 3, 2023
5294dd3
Set engines field to Node.js >= 18 for packages
valentinpalkovic Dec 4, 2023
a82ccbe
Merge branch 'next' into valentin/set-engines-field-to-node-18
valentinpalkovic Dec 4, 2023
b8d1ccc
Merge remote-tracking branch 'origin/next' into valentin/set-engines-…
valentinpalkovic Dec 6, 2023
e2fb5b3
Merge branch 'next' into shilman/24644-is-story-mdx
kasperpeulen Dec 7, 2023
458afe7
Remove unused postinstall package
shilman Dec 8, 2023
ad74c87
Update yarn.lock
shilman Dec 8, 2023
61f4fa2
Update Angular cli templates
Marklb Dec 8, 2023
2f26beb
fix(Subtitle): crash on unattached docs pages
kripod Dec 8, 2023
dcd8f3c
Change more cli templates to standalone and remove more unnecessary
Marklb Dec 8, 2023
91496f3
Merge branch 'next' into marklb/update-ng-cli-templates
Marklb Dec 8, 2023
4a349de
Remove another unnecessary function
Marklb Dec 8, 2023
1883a75
Change Angular story files to lowercase
Marklb Dec 8, 2023
3fcbe02
Add ember template
francois2metz Jul 3, 2023
fbd6c2f
Add framework name parameter when calling the baseGenerator
francois2metz Jul 3, 2023
b25d83d
Remove findDistEsm
nlepage Jul 3, 2023
2b868c0
Use webpack5 by default with ember
francois2metz Jul 3, 2023
20064d5
Disable framework-preset-ember-docs for now
francois2metz Jul 4, 2023
9472245
Try to restore the previous integration
francois2metz Jul 4, 2023
be94cfd
Switch to ember-cli 3.28
francois2metz Jul 10, 2023
eec3ee4
Fix global use
francois2metz Jul 11, 2023
f81ab94
Extract a loadEmberApp function
francois2metz Jul 11, 2023
581590e
Update peer dependencies
francois2metz Jul 13, 2023
21a961e
Add empty components and stories template directories
francois2metz Jul 13, 2023
ad47e3c
Fix docs addon
francois2metz Jul 13, 2023
c81bacc
Fix link
francois2metz Jul 13, 2023
7ad4c8e
Use global env.
francois2metz Jul 15, 2023
ebe052d
Test with ember 4.12.
francois2metz Jul 17, 2023
a5a1a08
Update hbs templates to work with newer releases of ember
francois2metz Jul 17, 2023
5c8acb2
Split ember 3 and ember 4 templates
francois2metz Jul 18, 2023
735affa
Add empty components file to avoid the build to fail
francois2metz Jul 27, 2023
1fa0aca
Proxy @storybook/ember-cli-storybook on verdaccio
francois2metz Aug 16, 2023
4090ac4
Fix the ember sandbox template to work without any manual updates
francois2metz Aug 16, 2023
18f71dd
Add ember/default-js to normal tests
francois2metz Aug 16, 2023
4f416d8
Additional fixes to ember for sb7
gossi Sep 9, 2023
c3d59e5
Update name
francois2metz Oct 31, 2023
aac2526
Fix template formatting
shilman Dec 10, 2023
88b86c8
Merge branch 'next' into marklb/update-ng-cli-templates
valentinpalkovic Dec 11, 2023
4860f4b
Fix e2e tests
valentinpalkovic Dec 11, 2023
6281718
Merge remote-tracking branch 'origin/next' into valentin/set-engines-…
valentinpalkovic Dec 11, 2023
986f86b
Merge pull request #25152 from Marklb/marklb/update-ng-cli-templates
valentinpalkovic Dec 11, 2023
e1aa42e
Merge branch 'next' into valentin/set-engines-field-to-node-18
valentinpalkovic Dec 11, 2023
7dedaf4
Merge pull request #23435 from 1024pix/fix-ember-3.28
shilman Dec 11, 2023
8fc4c4e
Merge branch 'next' into shilman/remove-postinstall
ndelangen Dec 11, 2023
f73898f
Merge branch 'next' into shilman/24644-is-story-mdx
shilman Dec 11, 2023
47e969a
Merge pull request #25150 from storybookjs/shilman/remove-postinstall
ndelangen Dec 11, 2023
0d6da75
Fix flakey unit test
shilman Dec 11, 2023
58ff473
Use yarn1 for sandbox generation
valentinpalkovic Dec 11, 2023
46ce8d1
Merge branch 'next' into valentin/set-engines-field-to-node-18
valentinpalkovic Dec 11, 2023
fcd5cb8
Merge pull request #25171 from storybookjs/valentin/fix-sandbox-gener…
valentinpalkovic Dec 11, 2023
b6c438a
Add Node.js dropping note to migration
valentinpalkovic Dec 11, 2023
1fe208e
Merge pull request #25105 from storybookjs/valentin/set-engines-field…
valentinpalkovic Dec 11, 2023
02c2765
Fixed linting & added test doc
shilman Dec 11, 2023
c82e136
Merge pull request #25157 from kripod/patch-1
shilman Dec 11, 2023
ed8a223
Merge pull request #24696 from storybookjs/shilman/24644-is-story-mdx
ndelangen Dec 11, 2023
3023d69
Write changelog for 8.0.0-alpha.3 [skip ci]
storybook-bot Dec 11, 2023
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
9 changes: 9 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 8.0.0-alpha.3

- Addon-docs: Fix storybook MDX check - [#24696](https://github.com/storybookjs/storybook/pull/24696), thanks [@shilman](https://github.com/shilman)!
- Addons: Remove unused postinstall package - [#25150](https://github.com/storybookjs/storybook/pull/25150), thanks [@shilman](https://github.com/shilman)!
- Angular: Update Angular cli templates - [#25152](https://github.com/storybookjs/storybook/pull/25152), thanks [@Marklb](https://github.com/Marklb)!
- Blocks: Fix Subtitle block for unattached docs pages - [#25157](https://github.com/storybookjs/storybook/pull/25157), thanks [@kripod](https://github.com/kripod)!
- Ember: Fix @storybook/ember - [#23435](https://github.com/storybookjs/storybook/pull/23435), thanks [@francois2metz](https://github.com/francois2metz)!
- Maintenance: Set engines field to Node.js >= 18 for packages - [#25105](https://github.com/storybookjs/storybook/pull/25105), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!

## 8.0.0-alpha.2

- Core: Maintenance changes for NextJS embedding - [#25086](https://github.com/storybookjs/storybook/pull/25086), thanks [@shilman](https://github.com/shilman)!
Expand Down
10 changes: 10 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
- [From version 7.x to 8.0.0](#from-version-7x-to-800)
- [Implicit actions can not be used during rendering (for example in the play function)](#implicit-actions-can-not-be-used-during-rendering-for-example-in-the-play-function)
- [Core changes](#core-changes)
- [Dropping support for Node.js 16](#dropping-support-for-nodejs-16)
- [Autotitle breaking fixes](#autotitle-breaking-fixes)
- [React v18 in the manager UI (including addons)](#react-v18-in-the-manager-ui-including-addons)
- [Storyshots has been removed](#storyshots-has-been-removed)
- [UI layout state has changed shape](#ui-layout-state-has-changed-shape)
- [New UI and props for Button and IconButton components](#new-ui-and-props-for-button-and-iconbutton-components)
- [Icons is deprecated](#icons-is-deprecated)
- [React-docgen component analysis by default](#react-docgen-component-analysis-by-default)
- [Removed postinstall](#removed-postinstall)
- [Framework-specific changes](#framework-specific-changes)
- [Angular: Drop support for Angular \< 15](#angular-drop-support-for-angular--15)
- [Next.js: Drop support for version \< 13.5](#nextjs-drop-support-for-version--135)
Expand Down Expand Up @@ -379,6 +381,10 @@ To summarize:

### Core changes

#### Dropping support for Node.js 16

In Storybook 8, we have dropped Node.js 16 support since it reached end-of-life on 2023-09-11. Storybook 8 supports Node.js 18 and above.

#### Autotitle breaking fixes

In Storybook 7, the file name `path/to/foo.bar.stories.js` would result in the [autotitle](https://storybook.js.org/docs/react/configure/overview#configure-story-loading) `path/to/foo`. In 8.0, this has been changed to generate `path/to/foo.bar`. We consider this a bugfix but it is also a breaking change if you depended on the old behavior. To get the old titles, you can manually specify the desired title in the default export of your story file. For example:
Expand Down Expand Up @@ -463,6 +469,10 @@ export default {

For more information see: https://storybook.js.org/docs/react/api/main-config-typescript#reactdocgen

#### Removed postinstall

We removed the `@storybook/postinstall` package, which provided some utilities for addons to programmatically modify user configuration files on install. This package was years out of date, so this should be a non-disruptive change. If your addon used the package, you can view the old source code [here](https://github.com/storybookjs/storybook/tree/release-7-5/code/lib/postinstall) and adapt it into your addon.

### Framework-specific changes

#### Angular: Drop support for Angular \< 15
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/ember/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Next, add the following to your `.storybook/preview.js` to load the generated js

```js
import { setJSONDoc } from '@storybook/addon-docs/ember';
import docJson from '../storybook-docgen/index.json';
import docJson from '../dist/storybook-docgen/index.json';
setJSONDoc(docJson);
```

Expand Down
2 changes: 0 additions & 2 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"ember/**/*",
"html/**/*",
"svelte/**/*",
"postinstall/**/*",
"react/**/*",
"vue/**/*",
"web-components/**/*",
Expand All @@ -108,7 +107,6 @@
"@storybook/global": "^5.0.0",
"@storybook/mdx2-csf": "^1.0.0",
"@storybook/node-logger": "workspace:*",
"@storybook/postinstall": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/react-dom-shim": "workspace:*",
"@storybook/theming": "workspace:*",
Expand Down
36 changes: 0 additions & 36 deletions code/addons/docs/postinstall/presets.js

This file was deleted.

2 changes: 1 addition & 1 deletion code/addons/docs/src/plugins/mdx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import remarkExternalLinks from 'remark-external-links';
import { createFilter } from '@rollup/pluginutils';
import { dirname, join } from 'path';

const isStorybookMdx = (id: string) => id.endsWith('stories.mdx') || id.endsWith('story.mdx');
const isStorybookMdx = (id: string) => id.endsWith('.stories.mdx') || id.endsWith('.story.mdx');

/**
* Storybook uses two different loaders when dealing with MDX:
Expand Down
4 changes: 3 additions & 1 deletion code/addons/docs/template/stories/docs2/Title.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Meta } from '@storybook/addon-docs';
import { Meta, Subtitle } from '@storybook/addon-docs';

<Meta title="Yabbadabbadooo" />

# Docs with title

<Subtitle>Subtitle</Subtitle>

hello docs
2 changes: 1 addition & 1 deletion code/e2e-tests/json-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test.describe('JSON files', () => {
entries: expect.objectContaining({
'example-button--primary': expect.objectContaining({
id: 'example-button--primary',
importPath: expect.stringContaining('Button.stories'),
importPath: expect.stringMatching(/button\.stories/i),
name: 'Primary',
title: 'Example/Button',
type: 'story',
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
}
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 0 additions & 2 deletions code/frameworks/angular/template/cli/User.ts

This file was deleted.

3 changes: 2 additions & 1 deletion code/frameworks/angular/template/cli/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
selector: 'storybook-button',
standalone: true,
imports: [CommonModule],
template: ` <button
type="button"
Expand All @@ -14,7 +15,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
</button>`,
styleUrls: ['./button.css'],
})
export default class ButtonComponent {
export class ButtonComponent {
/**
* Is this the principal call to action on the page?
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { Meta, StoryObj } from '@storybook/angular';
import Button from './button.component';

import { ButtonComponent } from './button.component';

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
const meta: Meta<Button> = {
const meta: Meta<ButtonComponent> = {
title: 'Example/Button',
component: Button,
component: ButtonComponent,
tags: ['autodocs'],
render: (args: Button) => ({
render: (args: ButtonComponent) => ({
props: {
backgroundColor: null,
...args,
Expand All @@ -20,7 +21,7 @@ const meta: Meta<Button> = {
};

export default meta;
type Story = StoryObj<Button>;
type Story = StoryObj<ButtonComponent>;

// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Primary: Story = {
Expand Down
12 changes: 8 additions & 4 deletions code/frameworks/angular/template/cli/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import type { User } from './User';
import { CommonModule } from '@angular/common';

import { ButtonComponent } from './button.component';
import type { User } from './user';

@Component({
selector: 'storybook-header',
standalone: true,
imports: [CommonModule, ButtonComponent],
template: `<header>
<div class="storybook-header">
<div>
Expand Down Expand Up @@ -47,9 +52,8 @@ import type { User } from './User';
></storybook-button>
<storybook-button
*ngIf="!user"
primary
size="small"
primary="true"
[primary]="true"
class="margin-left"
(onClick)="onCreateAccount.emit($event)"
label="Sign up"
Expand All @@ -60,7 +64,7 @@ import type { User } from './User';
</header>`,
styleUrls: ['./header.css'],
})
export default class HeaderComponent {
export class HeaderComponent {
@Input()
user: User | null = null;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
import { moduleMetadata } from '@storybook/angular';
import type { Meta, StoryObj } from '@storybook/angular';
import { CommonModule } from '@angular/common';

import Button from './button.component';
import Header from './header.component';
import { HeaderComponent } from './header.component';

const meta: Meta<Header> = {
const meta: Meta<HeaderComponent> = {
title: 'Example/Header',
component: Header,
component: HeaderComponent,
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
render: (args) => ({ props: args }),
decorators: [
moduleMetadata({
declarations: [Button],
imports: [CommonModule],
}),
],
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen',
},
};

export default meta;
type Story = StoryObj<Header>;
type Story = StoryObj<HeaderComponent>;

export const LoggedIn: Story = {
args: {
Expand Down
9 changes: 7 additions & 2 deletions code/frameworks/angular/template/cli/page.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Component } from '@angular/core';
import type { User } from './User';
import { CommonModule } from '@angular/common';

import { HeaderComponent } from './header.component';
import type { User } from './user';

@Component({
selector: 'storybook-page',
standalone: true,
imports: [CommonModule, HeaderComponent],
template: `<article>
<storybook-header
[user]="user"
Expand Down Expand Up @@ -60,7 +65,7 @@ import type { User } from './User';
</article>`,
styleUrls: ['./page.css'],
})
export default class PageComponent {
export class PageComponent {
user: User | null = null;

doLogout() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import { within, userEvent, expect } from '@storybook/test';

import Button from './button.component';
import Header from './header.component';
import Page from './page.component';
import { PageComponent } from './page.component';

const meta: Meta<Page> = {
const meta: Meta<PageComponent> = {
title: 'Example/Page',
component: Page,
component: PageComponent,
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen',
},
decorators: [
moduleMetadata({
declarations: [Button, Header],
imports: [CommonModule],
}),
],
};

export default meta;
type Story = StoryObj<Page>;
type Story = StoryObj<PageComponent>;

export const LoggedOut: Story = {
render: (args: Page) => ({
props: args,
}),
};
export const LoggedOut: Story = {};

// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
export const LoggedIn: Story = {
render: (args: Page) => ({
props: args,
}),
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const loginButton = canvas.getByRole('button', { name: /Log in/i });
Expand Down
3 changes: 3 additions & 0 deletions code/frameworks/angular/template/cli/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface User {
name: string;
}
12 changes: 7 additions & 5 deletions code/frameworks/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "workspace:*",
"@storybook/types": "workspace:*",
"find-up": "^5.0.0",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
Expand All @@ -46,13 +47,14 @@
},
"peerDependencies": {
"@babel/core": "*",
"@types/ember__component": "4.0.8",
"babel-plugin-ember-modules-api-polyfill": "^2.12.0",
"babel-plugin-htmlbars-inline-precompile": "2 || 3",
"ember-source": "~3.28.1"
"babel-plugin-ember-modules-api-polyfill": "^3.5.0",
"babel-plugin-htmlbars-inline-precompile": "^5.3.1",
"ember-source": "~3.28.1 || ^4.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion code/frameworks/ember/src/client/docs/index.js

This file was deleted.

2 changes: 2 additions & 0 deletions code/frameworks/ember/src/client/preview/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './globals';

export { renderToCanvas } from './render';

export const parameters = { renderer: 'ember' as const };
9 changes: 0 additions & 9 deletions code/frameworks/ember/src/client/preview/docs/config.js

This file was deleted.

Loading