Storybook 8 が出たらしい
けっこう前なんですけれども
Built-in visual testing
Chromatic の機能が降りてきたらしい。Storybook 駆動開発がより強力に。
React Server Component (RSC) support
実質 Next.js 対応なので experimental 扱いだが、対応しているらしい。
ここに詳しく書いてあると
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.
ミソ
いいねー
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,
});
}),
],
},
},
};
- Build a simplified in-memory database
- Create MSW handlers that read from the database and generate the desired network responses
- Write stories to populate the database with test cases
これめちゃいいな
Improved React and Vue control autogeneration
はやくなったらしい
Rearchitected Vite support, a Vitest-powered testing framework, and Vite 5 compatibility
7 のころに Vite に乗り換えて、今回設定をpluggableにしたらしい?
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で動かすためのオプションが欲しい。
気になったところはこんなもんかな