Closed15

Storybook 8 が出たらしい

hajimismhajimism

Built-in visual testing

Chromatic の機能が降りてきたらしい。Storybook 駆動開発がより強力に。

hajimismhajimism

ほんとにchromaticの機能を使うんだな

npx storybook@latest add @chromatic-com/storybook
hajimismhajimism

Storybook側からChromaticの機能を呼べるだけで、実質有料機能かな?

hajimismhajimism

React Server Component (RSC) support

実質 Next.js 対応なので experimental 扱いだが、対応しているらしい。

hajimismhajimism

If you follow the space closely, you might ask, ‘Isn’t MSW currently incompatible with Next.js app directory?’ This is true. However, since we’re running it in the browser rather than in Next.js, there’s no problem using MSW with Storybook.

ミソ

hajimismhajimism

いいねー

export const Mocked = {
  ...Home,
  parameters: {
    msw: {
      handlers: [
        http.get('https://hacker-news.firebaseio.com/v0/topstories.json', () => {
          return HttpResponse.json([1]);
        }),
        http.get('https://hacker-news.firebaseio.com/v0/item/1.json', () => {
          return HttpResponse.json({
            id: 1,
            time: Date.now(),
            user: 'shilman',
            url: 'http://storybook.js.org',
            title: 'Storybook + Next.js = ❤️',
            score: 999,
          });
        }),
      ],
    },
  },
};
hajimismhajimism
  1. Build a simplified in-memory database
  2. Create MSW handlers that read from the database and generate the desired network responses
  3. Write stories to populate the database with test cases

これめちゃいいな

hajimismhajimism

Improved React and Vue control autogeneration

はやくなったらしい

hajimismhajimism

Rearchitected Vite support, a Vitest-powered testing framework, and Vite 5 compatibility

7 のころに Vite に乗り換えて、今回設定をpluggableにしたらしい?

hajimismhajimism

2-4x faster test builds

We observed that when you build Storybook for use with testing tool like Storybook’s Test Runner or Chromatic, you might not require Storybook features like documentation or auto-generated controls.

賢い。でもPlaywright使ってる限りは結局遅いみたいなところありそう。play functionに書いたテストをVitestで動かすためのオプションが欲しい。

このスクラップは2024/04/29にクローズされました