-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA][TS migration] Migrate Storybook files #37771
[No QA][TS migration] Migrate Storybook files #37771
Conversation
.storybook/preview.tsx
Outdated
import './fonts.css'; | ||
|
||
type Parameter = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a built in Storybook type for that
import { Parameters } from '@storybook/addons';
managerHead: (head: string) => string; | ||
}; | ||
|
||
const main: Main = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for this there is a built in type
import { StorybookConfig } from '@storybook/core-common';
import {DefinePlugin} from 'webpack'; | ||
import type {Configuration, RuleSetRule} from 'webpack'; | ||
|
||
type CustomWebpackConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if there is already some webpack
type we can use for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already using Configuration from webpack. CustomWebpackConfig was created to workaround some type issues, without this type we would need to have a lot of condition to TS comply with the correct typing.
I find Configuration from webpack a bit too generic for this specific case.
.storybook/webpack.config.ts
Outdated
}; | ||
}; | ||
|
||
let envFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it any in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this type, thanks!
@ruben-rebelo, the page can't display icons, but it woks on the main branch. BTW, the lint test failed. |
.storybook/webpack.config.ts
Outdated
(rule): rule is RuleSetRule => | ||
typeof rule !== 'boolean' && typeof rule !== 'string' && typeof rule !== 'number' && !!rule?.test && rule.test instanceof RegExp && rule.test.test('.svg'), | ||
); | ||
if (fileLoaderRule?.exclude) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (fileLoaderRule?.exclude) { | |
if (fileLoaderRule) { |
@ntdiary Thank you, I've updated the PR |
Reviewer Checklist
Screenshots/VideosAndroid: Nativen/aAndroid: mWeb Chromen/aiOS: Nativen/aiOS: mWeb Safarin/aMacOS: Chrome / Safari37771-web.mp4MacOS: Desktopn/a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25334 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@ntdiary Would you mind approved a second time? No internal got assigned |
.storybook/webpack.config.ts
Outdated
}; | ||
}; | ||
|
||
let envFile: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
envFile can be of type string only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated removed null
Co-authored-by: Błażej Kustra <46095609+blazejkustra@users.noreply.github.com>
…elo/App into ts-migration/storybook
Thanks! |
@MonilBhavsar looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
All tests were passing! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Details
[TS migration] Migrate *Storybook to TypeScript
Fixed Issues
$ #25334
PROPOSAL: N/A
Tests
Verify that no errors appear in the JS console
Run storybook
Storybook works as before
Offline tests
N/A
QA Steps
Same as in the Tests section.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
N/a
Android: mWeb Chrome
N/a
iOS: Native
N/a
iOS: mWeb Safari
N/a
MacOS: Chrome / Safari
N/a
MacOS: Desktop
N/a