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

Features: For 7.2 #23446

Merged
merged 252 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
e46838b
fix mockdata by adding the type property
ndelangen Jul 3, 2023
3e1637a
revert unintended change (bit of a sneak peak, I guess)
ndelangen Jul 3, 2023
581e422
change to jsdoc over normal code-comment
ndelangen Jul 3, 2023
a45faea
improve types of manager api add & addPanel
ndelangen Jul 3, 2023
8972649
improve api for manager addon registration, deprecate the extra `id` …
ndelangen Jul 3, 2023
ad6103a
make router more powerful by supporting regex in the Route component,…
ndelangen Jul 4, 2023
8f74991
Improve code
ndelangen Jul 4, 2023
0a1e471
improve interactions: make use of the title being a FC and share stat…
ndelangen Jul 4, 2023
5b43645
Merge branch 'next' into norbert/ui-tabs-types-improvements
ndelangen Jul 4, 2023
a4b97a5
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
1b290c1
Merge branch 'next' into norbert/improve-router
ndelangen Jul 4, 2023
f3f38c3
improve
ndelangen Jul 4, 2023
8d284ca
Merge branch 'release/7.2' into norbert/improve-router
ndelangen Jul 4, 2023
db062cc
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 4, 2023
05d628a
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
104b680
improve controls and actions
ndelangen Jul 4, 2023
2ee9393
improve a11y
ndelangen Jul 4, 2023
65f3695
cleanup
ndelangen Jul 4, 2023
7721371
make state persisted with useAddonState
ndelangen Jul 4, 2023
0effc6d
improve and fix test
ndelangen Jul 4, 2023
692f9c1
Merge branch 'release/7.2' into norbert/improve-router
ndelangen Jul 4, 2023
8afab86
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 4, 2023
210de88
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
b7975e9
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
683c480
add a new addon type: Page, refactor manager layout to allow for pages
ndelangen Jul 4, 2023
f28c739
apply router changes from https://github.com/storybookjs/storybook/pu…
ndelangen Jul 4, 2023
d31d7cb
make `/` the default path, even when there's no query in the URL
ndelangen Jul 4, 2023
2724a96
cleanup
ndelangen Jul 4, 2023
dbc587f
fix an ancient bug where navigating before preview load, the preview …
ndelangen Jul 4, 2023
66d75aa
make `/` the default path, even when there's no query in the URL
ndelangen Jul 4, 2023
e6bbdee
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 4, 2023
09d0f55
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
4d34d0a
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 4, 2023
40daf32
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 4, 2023
e55036d
Merge branch 'release/7.2' into norbert/improve-router
ndelangen Jul 4, 2023
6c26daf
cleanup
ndelangen Jul 4, 2023
c0a18af
Merge pull request #23292 from storybookjs/norbert/improve-router
ndelangen Jul 4, 2023
4486548
fix
ndelangen Jul 4, 2023
ca586a4
fix
ndelangen Jul 4, 2023
7f518f2
add more jsdoc
ndelangen Jul 4, 2023
a175244
types refactor & cleanup
ndelangen Jul 4, 2023
a51e2ef
fixes
ndelangen Jul 4, 2023
82f3a92
cleaning up types, make a special case for PREVIEW types addons, beca…
ndelangen Jul 5, 2023
ce322de
miniscule improvements in jsdoc/types
ndelangen Jul 5, 2023
fe2ac2f
overhaul addon types a bit more, make type for preview wrapper correc…
ndelangen Jul 5, 2023
fac7c0c
cleanup
ndelangen Jul 5, 2023
d39674f
fixes
ndelangen Jul 5, 2023
c5b5e09
Merge branch 'next' into release/7.2
ndelangen Jul 5, 2023
ca90ce3
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 5, 2023
15f143b
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 5, 2023
ed8abf2
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 5, 2023
3837bdc
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 5, 2023
343f7ad
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 5, 2023
2d6592e
restructure the LeadNode in Sidebar to allow for extra items
ndelangen Jul 5, 2023
7050fff
pass status into Tree Nodes
ndelangen Jul 5, 2023
5e6d4cf
improve stories
ndelangen Jul 5, 2023
2f270ff
cleanup
ndelangen Jul 5, 2023
612ff20
optimize
ndelangen Jul 5, 2023
ad88799
add cascade up coloring & tooltip
ndelangen Jul 6, 2023
54eae22
cleanup
ndelangen Jul 6, 2023
c429c1f
make it prettier
ndelangen Jul 6, 2023
e5189a1
Merge branch 'norbert/ui-tabs-types-improvements' of github.com:story…
ndelangen Jul 6, 2023
909a851
simplify code
ndelangen Jul 6, 2023
899380e
Merge branch 'next' into release/7.2
ndelangen Jul 6, 2023
967e09d
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 6, 2023
39b6094
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 6, 2023
b5072b2
Merge branch 'release/7.2' into norbert/improve-interaction-addon
ndelangen Jul 6, 2023
47c1356
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
b5818f4
Merge branch 'norbert/improve-interaction-addon' of github.com:storyb…
ndelangen Jul 6, 2023
8d82df3
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
13e053c
Merge branch 'norbert/improve-more-addons' of github.com:storybookjs/…
ndelangen Jul 6, 2023
87e8e14
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
2a8fe23
Merge branch 'norbert/page-addons-refactor' of github.com:storybookjs…
ndelangen Jul 6, 2023
cc39db8
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 6, 2023
ae3a05b
Merge branch 'norbert/addon-types-follow-up' of github.com:storybookj…
ndelangen Jul 6, 2023
f32ead4
cleanup
ndelangen Jul 6, 2023
14184de
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
9d0940d
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
155eb12
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
3b6b8aa
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 6, 2023
8f5a5b0
cleanup
ndelangen Jul 6, 2023
b7cee93
fix
ndelangen Jul 6, 2023
25b35ef
Merge branch 'next' into release/7.2
ndelangen Jul 6, 2023
9facdc3
Merge branch 'release/7.2' into norbert/ui-tabs-types-improvements
ndelangen Jul 6, 2023
4731d96
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
f457720
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
2a22fc6
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
cef21fc
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 6, 2023
7bc5a19
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 6, 2023
2964e4b
fix
ndelangen Jul 6, 2023
3f2bc43
cleanup
ndelangen Jul 6, 2023
e6aa8c9
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
ca0d813
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/improv…
ndelangen Jul 6, 2023
c9dcee1
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
c863eb7
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 6, 2023
baf05dc
fix
ndelangen Jul 6, 2023
05a8f30
fix
ndelangen Jul 6, 2023
4f3bd7b
fixes
ndelangen Jul 6, 2023
8e1dbba
Merge pull request #23288 from storybookjs/norbert/ui-tabs-types-impr…
ndelangen Jul 6, 2023
36abf93
Merge pull request #23298 from storybookjs/norbert/improve-more-addons
ndelangen Jul 6, 2023
6436789
Hopefully stabilize interactions e2e test
ndelangen Jul 7, 2023
b3bbb2b
Merge branch 'next' into release/7.2
ndelangen Jul 7, 2023
aaaf575
Adding the new Button props
cdedreuille Jul 7, 2023
f524baa
fixes for e2e tests
ndelangen Jul 7, 2023
2c9b425
Merge pull request #23291 from storybookjs/norbert/improve-interactio…
ndelangen Jul 7, 2023
ad0a0fa
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 7, 2023
4b705f6
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 7, 2023
3e17581
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 7, 2023
8549fee
Merge branch 'next' into release/7.2
ndelangen Jul 7, 2023
13ec5f6
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 7, 2023
bce1c1e
rename
ndelangen Jul 7, 2023
d67aeba
cleanup
ndelangen Jul 7, 2023
630b913
Button updates
cdedreuille Jul 7, 2023
ccf22aa
I like tests
ndelangen Jul 7, 2023
defe8c2
Improve the button style
cdedreuille Jul 9, 2023
7099b19
Update Button story
cdedreuille Jul 9, 2023
060106c
Add missing Link
cdedreuille Jul 9, 2023
6c25e59
Improve styling for link
cdedreuille Jul 9, 2023
a06b8bb
fix util, to find selected story element
ndelangen Jul 9, 2023
44da7e8
Merge branch 'next' into release/7.2
ndelangen Jul 9, 2023
969861f
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 9, 2023
2f84ecc
Merge branch 'next' into release/7.2
ndelangen Jul 10, 2023
2397b46
Improve theme layout to work with docs
cdedreuille Jul 10, 2023
2cd1e0a
Fix dark theme button
cdedreuille Jul 10, 2023
f749b6a
Update preview.tsx
cdedreuille Jul 10, 2023
86ef325
Merge branch 'next' into release/7.2
ndelangen Jul 10, 2023
506e5ac
Merge branch 'next' into release/7.2
ndelangen Jul 10, 2023
d462df5
remove references to `api` and the 2 deprecated channel packages
ndelangen Jul 10, 2023
3a92db6
fix, by removing it from the preview-builder for webpack in it's crea…
ndelangen Jul 10, 2023
9b503c7
Merge branch 'next' into release/7.2
ndelangen Jul 10, 2023
1af8f33
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 10, 2023
0e572a2
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 10, 2023
fb18823
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 10, 2023
cab5fcb
regen lockfile for scripts
ndelangen Jul 10, 2023
d61fb80
regen lockfile code
ndelangen Jul 10, 2023
7e0843c
Add missing props
cdedreuille Jul 10, 2023
9292465
Update Button.stories.tsx
cdedreuille Jul 10, 2023
2b5ee72
Merge branch 'next' into charles/update-button
cdedreuille Jul 11, 2023
e7755c6
Update Button.tsx
cdedreuille Jul 11, 2023
870d4d7
fix typing
ndelangen Jul 11, 2023
ad444c7
Update code/lib/preview-api/src/modules/preview-web/PreviewWithSelect…
ndelangen Jul 11, 2023
7ede443
fixes
ndelangen Jul 11, 2023
8b33973
remove the fake generic type argument
ndelangen Jul 11, 2023
dde330c
improve readability of api's stories module init
ndelangen Jul 11, 2023
8c636e0
Add new command line
cdedreuille Jul 11, 2023
7c73321
Add package.json
cdedreuille Jul 11, 2023
fad9520
Add new button
cdedreuille Jul 11, 2023
435e825
Add tsconfig and readme
cdedreuille Jul 11, 2023
841798b
Add missing files
cdedreuille Jul 11, 2023
36f4a7a
fix cyclical state setting
ndelangen Jul 11, 2023
9f79059
addon render function are now called like React elements, thus keys a…
ndelangen Jul 11, 2023
5d48c34
Bring back old component
cdedreuille Jul 11, 2023
ab7fd6d
Update preview.tsx
cdedreuille Jul 11, 2023
b030f45
Remove Chromatic as a dependency
cdedreuille Jul 11, 2023
d9e2984
fix type issues
ndelangen Jul 11, 2023
011be25
Update styles.ts
cdedreuille Jul 11, 2023
7953660
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 11, 2023
f84cef2
Improve styling for all buttons
cdedreuille Jul 11, 2023
942d40c
textarea size fix
ndelangen Jul 11, 2023
6404233
Update CircleCi
cdedreuille Jul 11, 2023
d722f4b
move to types, move to utils
ndelangen Jul 11, 2023
95a10ec
Merge branch 'norbert/story-status-ui' of github.com:storybookjs/stor…
ndelangen Jul 11, 2023
1bfd471
refactor
ndelangen Jul 11, 2023
ff2e4cc
add tests
ndelangen Jul 11, 2023
685614e
Merge branch 'next' into release/7.2
ndelangen Jul 11, 2023
7130577
Merge branch 'release/7.2' into norbert/lockfiles-regen-2
ndelangen Jul 11, 2023
d054cd6
Merge branch 'next' into release/7.2
ndelangen Jul 11, 2023
33b69c7
Merge branch 'release/7.2' into norbert/lockfiles-regen-2
ndelangen Jul 11, 2023
c267b55
Merge branch 'release/7.2' into norbert/story-status-ui
ndelangen Jul 11, 2023
80e9be5
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 11, 2023
5acde6d
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 11, 2023
1a5be45
fix file input height
ndelangen Jul 11, 2023
0ecb3f4
make color for search text item of document correct
ndelangen Jul 12, 2023
ec36ee4
move ui/components/src into ui/components/src/legacy
ndelangen Jul 12, 2023
013ac74
Merge branch 'next' into charles/update-button
ndelangen Jul 12, 2023
1d918f8
Merge branch 'charles/update-button' of https://github.com/storybookj…
cdedreuille Jul 12, 2023
4ad8d8e
Fix Storybook
cdedreuille Jul 12, 2023
9223ba6
Update main.ts
cdedreuille Jul 12, 2023
a3b01c7
Remove old button
cdedreuille Jul 12, 2023
fe41328
Merge pull request #23391 from storybookjs/norbert/lockfiles-regen-2
ndelangen Jul 12, 2023
cf2e485
Merge branch 'next' into release/7.2
ndelangen Jul 12, 2023
47f5168
Merge branch 'release/7.2' of github.com:storybookjs/storybook into r…
ndelangen Jul 12, 2023
e981fb2
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 12, 2023
9027184
Merge branch 'norbert/page-addons-refactor' of github.com:storybookjs…
ndelangen Jul 12, 2023
428e6ce
add test for early setting of selection in preview-web
ndelangen Jul 12, 2023
701d560
add migration documentation
ndelangen Jul 12, 2023
8573eb1
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 12, 2023
2e2f7dd
Merge pull request #23342 from storybookjs/norbert/story-status-ui
ndelangen Jul 12, 2023
477ac69
Styles
cdedreuille Jul 12, 2023
f7c0e64
Cleanup Button
kasperpeulen Jul 12, 2023
cf0168c
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
3e53034
Remove unnecessary commands
cdedreuille Jul 12, 2023
f0b368d
move test
ndelangen Jul 12, 2023
24abad2
fix
ndelangen Jul 12, 2023
f9b1bf4
Merge branch 'next' into release/7.2
ndelangen Jul 12, 2023
f2b43c9
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 12, 2023
69dd3d4
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
6382df6
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 12, 2023
4f3f156
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
7bb7db7
Merge branch 'next' into release/7.2
ndelangen Jul 12, 2023
d45d3c9
Merge branch 'release/7.2' into charles/update-button
ndelangen Jul 12, 2023
2aa315e
Straighten out behaviour when messages are received during init
tmeasday Jul 13, 2023
df8bf31
fix
ndelangen Jul 13, 2023
d5b712b
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 13, 2023
a80b1ff
Merge branch 'norbert/page-addons-refactor' into norbert/addon-types-…
ndelangen Jul 13, 2023
82afbe6
Merge pull request #23307 from storybookjs/norbert/page-addons-refactor
ndelangen Jul 13, 2023
c74ed74
Merge pull request #23311 from storybookjs/norbert/addon-types-follow-up
ndelangen Jul 13, 2023
6b7f4c9
Merge branch 'next' into release/7.2
ndelangen Jul 13, 2023
1869636
rough draft of adding status indicators to search results
ndelangen Jul 13, 2023
5dcce1f
cleanup
ndelangen Jul 13, 2023
3cf9e3e
fix bugs, add story for search
ndelangen Jul 13, 2023
30b0252
cleanup
ndelangen Jul 13, 2023
b8d8465
Merge branch 'next' into release/7.2
ndelangen Jul 13, 2023
3684ff1
fixes
ndelangen Jul 13, 2023
03d1e1f
Merge branch 'next' into release/7.2
ndelangen Jul 13, 2023
b3ec10e
Merge branch 'release/7.2' into norbert/status-in-search-item
ndelangen Jul 13, 2023
b0a8da6
change to icon circle
ndelangen Jul 13, 2023
84af37e
Merge branch 'next' into release/7.2
ndelangen Jul 14, 2023
29be84d
Merge pull request #23356 from storybookjs/charles/update-button
ndelangen Jul 14, 2023
312c23f
Create new TextField component
cdedreuille Jul 16, 2023
f56ded7
Add Textarea component
cdedreuille Jul 16, 2023
f9b9e9a
Rename TextField component into Input
cdedreuille Jul 16, 2023
be6ad7b
First pass at creating a new Select component
cdedreuille Jul 17, 2023
42ba728
Improve styling + api of the Select component
cdedreuille Jul 17, 2023
4d2bcad
Update Select.stories.tsx
cdedreuille Jul 17, 2023
8d0c8b0
Merge branch 'next' into release/7.2
ndelangen Jul 18, 2023
6c45e62
cleanup
ndelangen Jul 18, 2023
be295d3
Merge branch 'release/7.2' into norbert/remove-references-to-api
ndelangen Jul 18, 2023
cda899b
Merge pull request #23384 from storybookjs/norbert/remove-references-…
ndelangen Jul 18, 2023
e691ba4
Merge branch 'next' into release/7.2
ndelangen Jul 18, 2023
f17dce7
fix visual s
ndelangen Jul 18, 2023
5da09e9
selected one is white
ndelangen Jul 18, 2023
afdc58a
Merge pull request #23441 from storybookjs/norbert/status-in-search-item
ndelangen Jul 18, 2023
d3dad50
Merge branch 'next' into charles/update-form-ui
cdedreuille Jul 18, 2023
4a21186
Merge branch 'release/7.2' into charles/update-form-ui
cdedreuille Jul 18, 2023
a164fd1
Some cleaning
cdedreuille Jul 18, 2023
53276b5
Merge pull request #23469 from storybookjs/charles/update-form-ui
cdedreuille Jul 18, 2023
b1bff00
add a check script so most packages can be checked without linking
ndelangen Jul 18, 2023
1af46cf
set skipLibCheck to true for perf, and checking .d.ts files doesn't r…
ndelangen Jul 18, 2023
7910e2d
update check task to allow for running with linking
ndelangen Jul 18, 2023
67fe094
chmod check script
ndelangen Jul 18, 2023
77193b0
change codemod entrypoint to ts
ndelangen Jul 18, 2023
d8b514c
fix a global type issue
ndelangen Jul 18, 2023
92a494e
regen lockfiles
ndelangen Jul 18, 2023
28de51d
sync versions in testing-storybooks
ndelangen Jul 18, 2023
a14325c
Merge pull request #23500 from storybookjs/norbert/lockfiles-again
ndelangen Jul 18, 2023
8356877
Merge pull request #23498 from storybookjs/norbert/improve-check-script
ndelangen Jul 19, 2023
1f0bdde
Merge branch 'next' into release/7.2
ndelangen Jul 19, 2023
99f784f
Merge branch 'next' into release/7.2
ndelangen Jul 19, 2023
ac0f1de
Update MIGRATION.md
ndelangen Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Migration</h1>

- [From version 7.0.0 to 7.2.0](#from-version-700-to-720)
- [Addon API are more type-strict](#addon-api-are-more-type-strict)
- [From version 6.5.x to 7.0.0](#from-version-65x-to-700)
- [7.0 breaking changes](#70-breaking-changes)
- [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below)
Expand Down Expand Up @@ -300,6 +302,31 @@
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)

## From version 7.0.0 to 7.2.0

#### Addon API are more type-strict

When registering an addon using `@storybook/manager-api`, the addon API is now more type-strict. This means if you use typescript to compile your addon before publishing it might start giving you errors.

The `type` property is now required field, and the `id` property should not be set anymore.
ndelangen marked this conversation as resolved.
Show resolved Hide resolved

Here's a correct example:
```tsx
import { addons, types } from '@storybook/manager-api';

addons.register('my-addon', () => {
addons.add('my-addon/panel', {
type: types.PANEL,
title: 'My Addon',
render: ({ active }) => active ? <div>Hello World</div> : null,
});
});
```

The API: `addons.addPanel()` is now deprecated, and will be removed in 8.0.0. Please use `addons.add()` instead.

The `render` method can now be a `React.FunctionComponent` (without the `children` prop). Storybook will now render it, rather than calling it as a function.

## From version 6.5.x to 7.0.0

A number of these changes can be made automatically by the Storybook CLI. To take advantage of these "automigrations", run `npx storybook@latest upgrade --prerelease` or `pnpx dlx storybook@latest upgrade --prerelease`.
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
68 changes: 57 additions & 11 deletions code/addons/a11y/src/manager.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import * as api from '@storybook/manager-api';
import type { Addon_BaseType } from '@storybook/types';
import { PANEL_ID } from './constants';
import './manager';

jest.mock('@storybook/manager-api');
const mockedApi = api as unknown as jest.Mocked<api.API>;
mockedApi.getAddonState = jest.fn();
mockedApi.useAddonState = jest.fn();
const mockedAddons = api.addons as jest.Mocked<typeof api.addons>;
const registrationImpl = mockedAddons.register.mock.calls[0][1];

const isPanel = (input: Parameters<typeof mockedAddons.add>[1]): input is Addon_BaseType =>
input.type === api.types.PANEL;
describe('A11yManager', () => {
it('should register the panels', () => {
// when
Expand All @@ -29,25 +32,68 @@ describe('A11yManager', () => {

it('should compute title with no issues', () => {
// given
mockedApi.getAddonState.mockImplementation(() => undefined);
mockedApi.useAddonState.mockImplementation(() => [undefined]);
registrationImpl(api as unknown as api.API);
const title = mockedAddons.add.mock.calls
.map(([_, def]) => def)
.find(({ type }) => type === api.types.PANEL)?.title as Function;
const title = mockedAddons.add.mock.calls.map(([_, def]) => def).find(isPanel)
?.title as Function;

// when / then
expect(title()).toBe('Accessibility');
expect(title()).toMatchInlineSnapshot(`
<div>
<Spaced
col={1}
>
<span
style={
Object {
"display": "inline-block",
"verticalAlign": "middle",
}
}
>
Accessibility
</span>

</Spaced>
</div>
`);
});

it('should compute title with issues', () => {
// given
mockedApi.getAddonState.mockImplementation(() => ({ violations: [{}], incomplete: [{}, {}] }));
mockedApi.useAddonState.mockImplementation(() => [
{
violations: [{}],
incomplete: [{}, {}],
},
]);
registrationImpl(mockedApi);
const title = mockedAddons.add.mock.calls
.map(([_, def]) => def)
.find(({ type }) => type === api.types.PANEL)?.title as Function;
const title = mockedAddons.add.mock.calls.map(([_, def]) => def).find(isPanel)
?.title as Function;

// when / then
expect(title()).toBe('Accessibility (3)');
expect(title()).toMatchInlineSnapshot(`
<div>
<Spaced
col={1}
>
<span
style={
Object {
"display": "inline-block",
"verticalAlign": "middle",
}
}
>
Accessibility
</span>
<Badge
status="neutral"
>
3
</Badge>
</Spaced>
</div>
`);
});
});
34 changes: 23 additions & 11 deletions code/addons/a11y/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
import React from 'react';
import { addons, types } from '@storybook/manager-api';
import { addons, types, useAddonState } from '@storybook/manager-api';
import { Badge, Spaced } from '@storybook/components';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
import { VisionSimulator } from './components/VisionSimulator';
import { A11YPanel } from './components/A11YPanel';
import type { Results } from './components/A11yContext';
import { A11yContextProvider } from './components/A11yContext';

const Title = () => {
const [addonState] = useAddonState<Results>(ADDON_ID);
const violationsNb = addonState?.violations?.length || 0;
const incompleteNb = addonState?.incomplete?.length || 0;
const count = violationsNb + incompleteNb;

const suffix = count === 0 ? '' : <Badge status="neutral">{count}</Badge>;

return (
<div>
<Spaced col={1}>
<span style={{ display: 'inline-block', verticalAlign: 'middle' }}>Accessibility</span>
{suffix}
</Spaced>
</div>
);
};

addons.register(ADDON_ID, (api) => {
addons.add(PANEL_ID, {
title: '',
Expand All @@ -15,17 +34,10 @@ addons.register(ADDON_ID, (api) => {
});

addons.add(PANEL_ID, {
title() {
const addonState: Results = api?.getAddonState(ADDON_ID);
const violationsNb = addonState?.violations?.length || 0;
const incompleteNb = addonState?.incomplete?.length || 0;
const totalNb = violationsNb + incompleteNb;
return totalNb !== 0 ? `Accessibility (${totalNb})` : 'Accessibility';
},
id: 'accessibility',
title: Title,
type: types.PANEL,
render: ({ active = true, key }) => (
<A11yContextProvider key={key} active={active}>
render: ({ active = true }) => (
<A11yContextProvider active={active}>
<A11YPanel />
</A11yContextProvider>
),
Expand Down
1 change: 1 addition & 0 deletions code/addons/a11y/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["jest", "@testing-library/jest-dom"],
"skipLibCheck": true,
"strict": true
},
"include": ["src/**/*"]
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
48 changes: 20 additions & 28 deletions code/addons/actions/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,42 @@
import React, { useState } from 'react';
import { addons, types, useChannel } from '@storybook/manager-api';
import React from 'react';
import { addons, types, useAddonState, useChannel } from '@storybook/manager-api';
import { STORY_CHANGED } from '@storybook/core-events';
import { Badge, Spaced } from '@storybook/components';
import ActionLogger from './containers/ActionLogger';
import { ADDON_ID, CLEAR_ID, EVENT_ID, PANEL_ID, PARAM_KEY } from './constants';

function Title({ count }: { count: { current: number } }) {
// eslint-disable-next-line @typescript-eslint/naming-convention
const [_, setRerender] = useState(false);
function Title() {
const [{ count }, setCount] = useAddonState(ADDON_ID, { count: 0 });

// Reactivity hack - force re-render on STORY_CHANGED, EVENT_ID and CLEAR_ID events
useChannel({
[EVENT_ID]: () => {
setRerender((r) => !r);
setCount((c) => ({ ...c, count: c.count + 1 }));
},
[STORY_CHANGED]: () => {
setRerender((r) => !r);
setCount((c) => ({ ...c, count: 0 }));
},
[CLEAR_ID]: () => {
setRerender((r) => !r);
setCount((c) => ({ ...c, count: 0 }));
},
});

const suffix = count.current === 0 ? '' : ` (${count.current})`;
return <>Actions{suffix}</>;
const suffix = count === 0 ? '' : <Badge status="neutral">{count}</Badge>;

return (
<div>
<Spaced col={1}>
<span style={{ display: 'inline-block', verticalAlign: 'middle' }}>Actions</span>
{suffix}
</Spaced>
</div>
);
}

addons.register(ADDON_ID, (api) => {
const countRef = { current: 0 };

api.on(STORY_CHANGED, (id) => {
countRef.current = 0;
});

api.on(EVENT_ID, () => {
countRef.current += 1;
});

api.on(CLEAR_ID, () => {
countRef.current = 0;
});

addons.add(PANEL_ID, {
title: <Title count={countRef} />,
id: 'actions',
title: Title,
type: types.PANEL,
render: ({ active, key }) => <ActionLogger key={key} api={api} active={!!active} />,
render: ({ active }) => <ActionLogger api={api} active={!!active} />,
paramKey: PARAM_KEY,
});
});
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion code/addons/backgrounds/src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { GridSelector } from './containers/GridSelector';
addons.register(ADDON_ID, () => {
addons.add(ADDON_ID, {
title: 'Backgrounds',
id: 'backgrounds',
type: types.TOOL,
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
render: () => (
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
20 changes: 13 additions & 7 deletions code/addons/controls/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { addons, types, useArgTypes } from '@storybook/manager-api';
import { AddonPanel } from '@storybook/components';
import { AddonPanel, Badge, Spaced } from '@storybook/components';
import { ControlsPanel } from './ControlsPanel';
import { ADDON_ID, PARAM_KEY } from './constants';

Expand All @@ -9,23 +9,29 @@ function Title() {
const controlsCount = Object.values(rows).filter(
(argType) => argType?.control && !argType?.table?.disable
).length;
const suffix = controlsCount === 0 ? '' : ` (${controlsCount})`;
const suffix = controlsCount === 0 ? '' : <Badge status="neutral">{controlsCount}</Badge>;

return <>Controls{suffix}</>;
return (
<div>
<Spaced col={1}>
<span style={{ display: 'inline-block', verticalAlign: 'middle' }}>Controls</span>
{suffix}
</Spaced>
</div>
);
}

addons.register(ADDON_ID, (api) => {
addons.add(ADDON_ID, {
title: <Title />,
id: 'controls',
title: Title,
type: types.PANEL,
paramKey: PARAM_KEY,
render: ({ key, active }) => {
render: ({ active }) => {
if (!active || !api.getCurrentStoryData()) {
return null;
}
return (
<AddonPanel key={key} active={active}>
<AddonPanel active={active}>
<ControlsPanel />
</AddonPanel>
);
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
Expand Down
Loading