Skip to content

Commit

Permalink
Merge pull request #25066 from storybookjs/version-patch-from-7.6.2
Browse files Browse the repository at this point in the history
Release: Patch 7.6.3
  • Loading branch information
valentinpalkovic authored Dec 1, 2023
2 parents afc89aa + 5828d09 commit 29e2870
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 51 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.6.3

- Next.js: Fix next/font/local usage in babel mode - [#25045](https://github.com/storybookjs/storybook/pull/25045), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!

## 7.6.2

- CLI: Improve dependency metadata detection in storybook doctor - [#25037](https://github.com/storybookjs/storybook/pull/25037), thanks [@yannbf](https://github.com/yannbf)!
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Storybook comes with a lot of [addons](https://storybook.js.org/docs/react/confi

### Community

For additional help, join us in the [Storybook Discord](https://discord.gg/storybook).
For additional help, share your issue in [the repo's GitHub Discussions](https://github.com/storybookjs/storybook/discussions/new?category=help).

## Projects

Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Addon-knobs is one of Storybook's most popular addons with over 1M weekly downlo

Therefore, rather than deprecating addon-knobs immediately, we will continue to release knobs with the Storybook core distribution until 7.0. This will give us time to improve Controls based on user feedback, and also give knobs users ample time to migrate.

If you are somehow tied to knobs or prefer the knobs interface, we are happy to take on maintainers for the knobs project. If this interests you, hop on our [Discord](https://discord.gg/storybook).
If you are somehow tied to knobs or prefer the knobs interface, we are happy to take on maintainers for the knobs project. If this interests you, please get in touch with us in the [`#contributing`](https://discord.com/channels/486522875931656193/839297503446695956) Discord channel.

### How do I migrate from addon-knobs?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import type { LoaderOptions } from '../types';

type LocalFontSrc = string | Array<{ path: string; weight?: string; style?: string }>;

export async function getFontFaceDeclarations(options: LoaderOptions, rootContext: string) {
export async function getFontFaceDeclarations(
options: LoaderOptions,
rootContext: string,
swcMode: boolean
) {
const localFontSrc = options.props.src as LocalFontSrc;

// Parent folder relative to the root context
const parentFolder = path
.dirname(path.join(getProjectRoot(), options.filename))
.replace(rootContext, '');
const parentFolder = swcMode
? path.dirname(path.join(getProjectRoot(), options.filename)).replace(rootContext, '')
: path.dirname(options.filename).replace(rootContext, '');

const { validateData } = require('../utils/local-font-utils');
const { weight, style, variable } = validateData('', options.props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type FontFaceDeclaration = {

export default async function storybookNextjsFontLoader(this: any) {
const loaderOptions = this.getOptions() as LoaderOptions;
let swcMode = false;
let options;

if (Object.keys(loaderOptions).length > 0) {
Expand All @@ -23,6 +24,7 @@ export default async function storybookNextjsFontLoader(this: any) {
} else {
// handles SWC mode
const importQuery = JSON.parse(this.resourceQuery.slice(1));
swcMode = true;

options = {
filename: importQuery.path,
Expand All @@ -42,7 +44,7 @@ export default async function storybookNextjsFontLoader(this: any) {
}

if (options.source.endsWith('next/font/local') || options.source.endsWith('@next/font/local')) {
fontFaceDeclaration = await getLocalFontFaceDeclarations(options, rootCtx);
fontFaceDeclaration = await getLocalFontFaceDeclarations(options, rootCtx, swcMode);
}

if (typeof fontFaceDeclaration !== 'undefined') {
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "7.6.3"
}
2 changes: 1 addition & 1 deletion docs/addons/addon-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ We also recommend releasing your own addon using the `next` tag to test it out i

## Support

If you’ve followed this guide and your addon is still not working, please reach out on the [Storybook Discord](https://discord.gg/storybook) in the `#addons` channel and we’ll help you get to the bottom of it and upgrade the guide accordingly.
If you're still having issues with your addon after following this guide, please open a [new discussion](https://github.com/storybookjs/storybook/discussions/new?category=help) in our GitHub repository.
2 changes: 1 addition & 1 deletion docs/addons/integration-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Not finding the recipe that you want? If it's popular in the community, our docs

### Request a recipe

If you'd like to request a recipe, head over to the [#maintenance channel](https://discord.com/channels/486522875931656193/490070912448724992) of our community Discord and ask.
If you'd like to request a recipe, open a [new discussion](https://github.com/storybookjs/storybook/discussions/new?category=ideas) in our GitHub repo. We'll review your request, and if it's popular, we'll add it to our backlog and prioritize it.

## Learn more about the Storybook addon ecosystem

Expand Down
13 changes: 11 additions & 2 deletions docs/api/arg-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Type:
```ts
{
[key: string]: {
control?: ControlType | { type: ControlType; /* See below for more */ };
control?: ControlType | { type: ControlType; /* See below for more */ } | false;
description?: string;
if?: Conditional;
mapping?: { [key: string]: { [option: string]: any } };
Expand All @@ -91,6 +91,7 @@ Type:
table?: {
category?: string;
defaultValue?: { summary: string; detail?: string };
disable?: boolean;
subcategory?: string;
type?: { summary?: string; detail?: string };
},
Expand All @@ -116,6 +117,7 @@ Type:
presetColors?: string[];
step?: number;
}
| false
```

Default:
Expand All @@ -124,7 +126,7 @@ Default:
2. Else, inferred from [`type`](#type)
3. Else, `'object'`

Specify the behavior of the [controls addon](../essentials/controls.md) for the arg. If you specify a string, it's used as the [`type`](#controltype) of the control. If you specify an object, you can provide additional configuration.
Specify the behavior of the [controls addon](../essentials/controls.md) for the arg. If you specify a string, it's used as the [`type`](#controltype) of the control. If you specify an object, you can provide additional configuration. Specifying `false` will prevent the control from rendering.

<!-- prettier-ignore-start -->

Expand Down Expand Up @@ -345,6 +347,7 @@ Type:
detail?: string;
summary: string;
};
disable?: boolean;
subcategory?: string;
type?: {
detail?: string;
Expand Down Expand Up @@ -387,6 +390,12 @@ Default: [Inferred](#automatic-argtype-inference)

The documented default value of the argType. `summary` is typically used for the value itself, while `detail` is used for additional information.

#### `table.disable`

Type: `boolean`

Set to `true` to remove the argType's row from the table.

#### `table.subcategory`

Type: `string`
Expand Down
2 changes: 1 addition & 1 deletion docs/builders/builder-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ While running in development mode, the builder's development server must be able

### More information

This area is under rapid development, so the documented is still in progress and subject to change. If you are interested in writing your builder, we encourage you to check [webpack](https://github.com/storybookjs/storybook/tree/next/code/builders/builder-webpack5), [Vite](https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite), and Modern Web's [dev-server-storybook](https://github.com/modernweb-dev/web/blob/master/packages/dev-server-storybook/src/serve/storybookPlugin.ts) source code. In addition, we have a wonderful contributor community on [Storybook Discord](https://discord.gg/storybook) if you have questions. Ping us in the [#contributing](https://discord.com/channels/486522875931656193/839297503446695956) channel.
This area is under rapid development, and the associated documentation is still in progress and subject to change. If you are interested in creating a builder, you can learn more about implementing a builder in Storybook by checking the source code for [Vite](https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite), [Webpack](https://github.com/storybookjs/storybook/tree/next/code/builders/builder-webpack5), or Modern Web's [dev-server-storybook](https://github.com/modernweb-dev/web/blob/master/packages/dev-server-storybook/src/serve/storybookPlugin.ts). When you're ready, open an [RFC](../contribute/RFC.md) to discuss your proposal with the Storybook community and maintainers.

#### Learn more about builders

Expand Down
2 changes: 1 addition & 1 deletion docs/configure/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Storybook is a framework-agnostic tool. It can be used with any framework. Howev

### Legacy framework support

We're deprecating support for several frameworks, including [Aurelia](https://github.com/aurelia/framework), [Marionette](https://github.com/marionettejs/backbone.marionette), [Mithril](https://github.com/MithrilJS/mithril.js), [Rax](https://github.com/alibaba/rax), and [Riot](https://github.com/riot/riot). Nevertheless, we're always looking for help maintaining these frameworks. If you're working with one of them and you want to continue supporting them, visit the dedicated [Storybook End-of-Life repository](https://github.com/storybook-eol) to learn more about the sunsetting process and for instructions on how to contribute visit our [Discord server](https://discord.gg/storybook).
We're deprecating support for several frameworks, including [Aurelia](https://github.com/aurelia/framework), [Marionette](https://github.com/marionettejs/backbone.marionette), [Mithril](https://github.com/MithrilJS/mithril.js), [Rax](https://github.com/alibaba/rax), and [Riot](https://github.com/riot/riot). Nevertheless, we're always looking for help maintaining these frameworks. If you're working with one of them and you want to continue supporting them, visit the dedicated [Storybook End-of-Life repository](https://github.com/storybook-eol). To learn more about the sunsetting process and view instructions on how to contribute, read our [documentation](../contribute/index.md).

### Learn about configuring Storybook

Expand Down
2 changes: 1 addition & 1 deletion docs/configure/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Now, when you define a story or update an existing one, you'll automatically get

### The `satisfies` operator is not working as expected

Out of the box, Storybook supports the `satisfies` operator for almost every framework already using TypeScript version 4.9 or higher. However, due to the constraints of the Angular and Web Components framework, you might run into issues when applying this operator for additional type safety. This is primarily due to how both frameworks are currently implemented, making it almost impossible for Storybook to determine if the component property is required. If you encounter this issue, we recommend reaching out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub discussion](https://github.com/storybookjs/storybook/discussions/20988)).
Out of the box, Storybook supports the `satisfies` operator for almost every framework already using TypeScript version 4.9 or higher. However, due to the constraints of the Angular and Web Components framework, you might run into issues when applying this operator for additional type safety. This is primarily due to how both frameworks are currently implemented, making it almost impossible for Storybook to determine if the component property is required. If you encounter this issue, please open up a support request on [GitHub Discussions](https://github.com/storybookjs/storybook/discussions/new?category=help).

### The TypeScript auto-completion is not working on my editor

Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Test it in a fresh project using a Storybook set up as close as possible to your

### 6. Let us know!

Once it's fully tested and released, please let us know about your framework by either announcing it in the `#showcase` channel of the [Storybook Discord](https://discord.gg/storybook) or tweeting it and mentioning `@storybookjs`. It's our hope that well-made community frameworks can eventually move into the Storybook codebase and be considered "officially" supported.
Once it's fully tested and released, please let us know about your framework by either announcing it in the [`#showcase`](https://discord.com/channels/486522875931656193/1048740936953376859) Discord channel or tweeting it and mentioning `@storybookjs`. It's our hope that well-made community frameworks can eventually move into the Storybook codebase and be considered "officially" supported.

## Learn more about contributing to Storybook

Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ In the interest of fostering an open and welcoming environment, we as contributo

## Not sure how to get started?

- [Chat in Discord #contributing](https://discord.gg/storybook)
- [Chat in Discord `#contributing`](https://discord.com/channels/486522875931656193/839297503446695956)
- [Browse "good first issues" to fix](https://github.com/storybookjs/storybook/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
- [Submit a bug report or feature request](https://github.com/storybookjs/storybook/issues)
1 change: 0 additions & 1 deletion docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ The automatic upgrade should get your Storybook into a working state. If you enc
2. Check [the full migration notes](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700), which contains an exhaustive list of noteworthy changes in Storybook 7. Many of these are already handled by automigrations when you upgrade, but not all are. It’s also possible that you’re experiencing a corner case that we’re not aware of.
3. Search [Storybook issues on GitHub](https://github.com/storybookjs/storybook/issues). If you’re seeing a problem, there’s a good chance other people are too. If so, upvote the issue, try out any workarounds described in the comments, and comment back if you have useful info to contribute.
4. If there’s no existing issue, you can [file one](https://github.com/storybookjs/storybook/issues/new/choose), ideally with a reproduction attached. We’ll be on top of Storybook 7 issues as we’re stabilizing the release.
5. If you prefer a more interactive medium, try out the `#prerelease` forum in the [Storybook Discord](https://discord.gg/storybook). We have Storybook maintainers and a large community of users who should be able to give you a hand.

If you prefer to debug yourself, here are a few useful things you can do to help narrow down the problem:

Expand Down
2 changes: 2 additions & 0 deletions docs/snippets/common/main-config-swc-jsx-transform.ts.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
```ts
// .storybook/main.ts

// Replace your-framework with the webpack-based framework you are using (e.g., react-webpack5)
import type { StorybookConfig } from '@storybook/your-framework';

Expand Down
12 changes: 0 additions & 12 deletions docs/snippets/common/test-runner-snapshot.js.mdx

This file was deleted.

16 changes: 0 additions & 16 deletions docs/snippets/common/test-runner-snapshot.ts.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/versions/latest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"7.6.2","info":{"plain":"- CLI: Improve dependency metadata detection in storybook doctor - [#25037](https://github.com/storybookjs/storybook/pull/25037), thanks [@yannbf](https://github.com/yannbf)!"}}
{"version":"7.6.3","info":{"plain":"- Next.js: Fix next/font/local usage in babel mode - [#25045](https://github.com/storybookjs/storybook/pull/25045), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- React-Docgen: Make error-handling more gentle - [#25055](https://github.com/storybookjs/storybook/pull/25055), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!"}}
4 changes: 2 additions & 2 deletions docs/writing-docs/autodocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ This is not a Storybook issue but a breaking change introduced with MDX 2. For m

### The table of contents doesn't render as expected

When using Autodocs's table of contents, you may encounter situations where it appears differently than expected. To help you resolve these problems, we have compiled a list of possible scenarios that may cause issues. If you've run into any of the items listed below and you're interested in helping us improve the support for this feature, we encourage you to reach out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)).
When using Autodocs's table of contents, you may encounter situations where it appears differently than expected. To help you resolve these problems, we have compiled a list of possible scenarios that may cause issues.

#### With simple documentation pages

Expand Down Expand Up @@ -283,7 +283,7 @@ Additionally, if you're developing using TypeScript, you may need to update Stor

<!-- prettier-ignore-end -->

If you're still encountering issues, we recommend reaching out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)).
If you're still encountering issues, we recommend reaching out to the community using the default communication channels (e.g., [GitHub discussions](https://github.com/storybookjs/storybook/discussions/new?category=help)).

#### Learn more about Storybook documentation

Expand Down
4 changes: 2 additions & 2 deletions docs/writing-docs/mdx.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The [`remark-gfm`](https://github.com/remarkjs/remark-gfm) package isn't provide

### Automigration

To help you transition to the new version, we've created a migration helper in our CLI. We recommend using it and reaching out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)) for problems you encounter.
To help you transition to the new version, we've created a migration helper in our CLI. We recommend using it and reaching out using the default communication channels (e.g., [GitHub discussions](https://github.com/storybookjs/storybook/discussions/new?category=help)) for problems you encounter.

```shell
npx storybook@latest automigrate mdx1to2
Expand Down Expand Up @@ -453,7 +453,7 @@ Additionally, if you're working with VSCode, you can add the [MDX extension](htt
}
```

If you're still encountering issues, we recommend reaching out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)).
If you're still encountering issues, we recommend reaching out to the community using the default communication channels (e.g., [GitHub discussions](https://github.com/storybookjs/storybook/discussions/new?category=help)).

#### Learn more about Storybook documentation

Expand Down

0 comments on commit 29e2870

Please sign in to comment.