Closed gjaskiewicz closed 3 weeks ago
Latest commit: 21352acab331ef749c12ef4dd857157db60cac7b
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
PR Preview Action v1.4.8 :---: Preview removed because the pull request was closed. 2024-11-05 23:44 UTC
We close caause we need first to migrate the jsonviewer component and also codeblock
@edda Can you take a look?
(Requested Change)
The
AppShellProvider
has a few breaking changes 🐞:See screenshots (JS code on left, TS on right)
- Setting
theme-dark
andtheme-light
is broken.theme
Story control has changed fromstring
toobject
.theme
type has changed fromstring
tostring|null
. If thetheme
can only betheme-light
andtheme-dark
, let's create a custom type containing these (instead of juststring
)?theme
default value should betheme-dark
?
It seems like a potential breaking change in apps to me. If type discrepency is problem in storybook I could just change a control type there. Otherwise it works when theme-light or theme-dark is entered with quotes.
@gjaskiewicz Nice that it's just a Storybook issue. I think that the storybook documentation should stay unchanged though after the migration. At least to me, it's confusing why I can't just enter text and would have to use quotes, since type
is only string|null
. Please also consider the other suggestions regarding custom type and type default, I think it would be an appropriate time for the improvements. 🚀
@gjaskiewicz Nice that it's just a Storybook issue. I think that the storybook documentation should stay unchanged though after the migration. At least to me, it's confusing why I can't just enter text and would have to use quotes, since
type
is onlystring|null
. Please also consider the other suggestions regarding custom type and type default, I think it would be an appropriate time for the improvements. 🚀
Agreed in this case. It is not a breaking change if we ensure that by default the prop is set to "theme-dark"
. It's also more correct and helps people understand what is happening under the hood.
@gjaskiewicz Nice that it's just a Storybook issue. I think that the storybook documentation should stay unchanged though after the migration. At least to me, it's confusing why I can't just enter text and would have to use quotes, since
type
is onlystring|null
. Please also consider the other suggestions regarding custom type and type default, I think it would be an appropriate time for the improvements. 🚀
I removed null value as it resolves to "theme-dark" anyway.
(Improvement)
For AppShellProvider
, the children
type is an array
in Storybook
but React.ReactNode
in the code.
I think we could improve this for AppShellProvider
(left old .JS code, right new .TSX code) :
In other components, it's any
, as Storybook doesn't have an appropriate type with a comment.
Example of what we do in Message
:
Summary
Migrate AppShellProvider and CodeBlock to TypeScript
Changes Made
Related Issues
Testing Instructions
npm i
npm run storybook
Checklist