-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Build: Upgrade typescript
#30354
Build: Upgrade typescript
#30354
Conversation
View your CI Pipeline Execution ↗ for commit c605c85.
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 17 | 17 | 0 |
Self size | 2.20 MB | 2.26 MB | 🚨 +61 KB 🚨 |
Dependency size | 7.92 MB | 7.92 MB | 0 B |
Bundle Size Analyzer | Link | Link |
@storybook/addon-essentials
Before | After | Difference | |
---|---|---|---|
Dependency count | 36 | 36 | 0 |
Self size | 12 KB | 12 KB | 0 B |
Dependency size | 13.87 MB | 13.93 MB | 🚨 +61 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-storysource
Before | After | Difference | |
---|---|---|---|
Dependency count | 7 | 7 | 0 |
Self size | 1.89 MB | 1.89 MB | 0 B |
Dependency size | 10.74 MB | 10.80 MB | 🚨 +63 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/builder-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 237 | 237 | 0 |
Self size | 80 KB | 80 KB | 🚨 +5 B 🚨 |
Dependency size | 31.15 MB | 31.14 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/angular
Before | After | Difference | |
---|---|---|---|
Dependency count | 266 | 266 | 0 |
Self size | 366 KB | 367 KB | 🚨 +904 B 🚨 |
Dependency size | 33.73 MB | 33.71 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/ember
Before | After | Difference | |
---|---|---|---|
Dependency count | 256 | 256 | 0 |
Self size | 22 KB | 22 KB | 🎉 -33 B 🎉 |
Dependency size | 31.18 MB | 31.17 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/html-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 247 | 247 | 0 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 31.70 MB | 31.68 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/preact-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 245 | 245 | 0 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 31.27 MB | 31.26 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 323 | 323 | 0 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 42.48 MB | 42.47 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 255 | 255 | 0 |
Self size | 14 KB | 14 KB | 0 B |
Dependency size | 32.68 MB | 32.66 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 310 | 310 | 0 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 39.27 MB | 39.25 MB | 🎉 -13 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 495 | 495 | 0 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 55.68 MB | 55.67 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 245 | 245 | 0 |
Self size | 5 KB | 5 KB | 0 B |
Dependency size | 31.32 MB | 31.31 MB | 🎉 -12 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 388 | 388 | 0 |
Self size | 503 KB | 503 KB | 🎉 -310 B 🎉 |
Dependency size | 75.28 MB | 75.35 MB | 🚨 +75 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 277 | 277 | 0 |
Self size | 612 KB | 617 KB | 🚨 +6 KB 🚨 |
Dependency size | 65.36 MB | 65.43 MB | 🚨 +70 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/source-loader
Before | After | Difference | |
---|---|---|---|
Dependency count | 5 | 5 | 0 |
Self size | 41 KB | 41 KB | 0 B |
Dependency size | 10.68 MB | 10.75 MB | 🚨 +63 KB 🚨 |
Bundle Size Analyzer | Link | Link |
…torybook into norbert/typescript-upgrade
…torybook into norbert/typescript-upgrade
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.
83 file(s) reviewed, 17 comment(s)
Edit PR Review Bot Settings | Greptile
"@types/webpack-env": "^1.16.0", | ||
"typescript": "^5.3.2" | ||
"typescript": "^5.7.3" |
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.
style: Consider adding a ~ instead of ^ to prevent auto-updating to TypeScript 5.8+ when it releases, which could introduce breaking changes
@@ -141,7 +141,7 @@ export const getInteractions = (finalStatus: CallStates) => | |||
.filter((call) => call.interceptable) | |||
.map((call) => ({ | |||
...call, | |||
childCallIds: [], | |||
childCallIds: [] as any[], |
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.
style: consider using a more specific type than any[]
for childCallIds, such as Call['id'][]
to maintain type safety
childCallIds: [] as any[], | |
childCallIds: [] as Call['id'][], |
"devDependencies": { | ||
"@types/node": "^22.0.0", | ||
"next": "^15.0.3", | ||
"typescript": "^5.3.2" | ||
"typescript": "^5.7.3" | ||
}, |
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.
style: Consider adding an explicit minimum TypeScript version requirement in peerDependencies since this upgrade enables new functionality that may not work with older versions
@@ -57,10 +57,10 @@ | |||
"typescript": "^4.9.4 || ^5.0.0" |
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.
style: dependency version range for typescript should be updated to match devDependency version ^5.7.3 for consistency
"typescript": "^5.7.3", | ||
"vue-component-meta": "^2.0.0", | ||
"vue-docgen-api": "^4.75.1" | ||
}, | ||
"devDependencies": { | ||
"@types/find-package-json": "^1.2.6", | ||
"@types/node": "^22.0.0", | ||
"typescript": "^5.3.2", | ||
"typescript": "^5.7.3", | ||
"vite": "^4.0.0" |
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.
style: TypeScript is listed in both dependencies and devDependencies. Consider removing it from one location to avoid potential version conflicts and duplicate installations.
"typescript": "^5.7.3", | |
"vue-component-meta": "^2.0.0", | |
"vue-docgen-api": "^4.75.1" | |
}, | |
"devDependencies": { | |
"@types/find-package-json": "^1.2.6", | |
"@types/node": "^22.0.0", | |
"typescript": "^5.3.2", | |
"typescript": "^5.7.3", | |
"vite": "^4.0.0" | |
"magic-string": "^0.30.0", | |
"vue-component-meta": "^2.0.0", | |
"vue-docgen-api": "^4.75.1" | |
}, | |
"devDependencies": { | |
"@types/find-package-json": "^1.2.6", | |
"@types/node": "^22.0.0", | |
"typescript": "^5.7.3", | |
"vite": "^4.0.0" |
@@ -89,7 +89,7 @@ const isCurrentVersionPublished = async ({ | |||
`Unexpected status code when checking the current version on npm: ${response.status}` | |||
); | |||
} | |||
const data = await response.json(); | |||
const data: any = await response.json(); |
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.
style: Consider creating an interface for the npm registry response instead of using 'any'. This would provide better type safety.
@@ -10,11 +10,11 @@ const getTheLastCommitHashThatUpdatedTheSandboxRepo = async (branch: string) => | |||
const repo = 'sandboxes'; | |||
|
|||
try { | |||
const branchData = await ( | |||
const branchData: any = await ( |
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.
style: Using 'any' type here bypasses type safety. Consider creating an interface for the GitHub API branch response structure.
await fetch(`https://api.github.com/repos/${owner}/${repo}/branches/${branch}`) | ||
).json(); | ||
const latestCommitSha = branchData.commit.sha; | ||
const commitData = await ( | ||
const commitData: any = await ( |
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.
style: Using 'any' type here bypasses type safety. Consider creating an interface for the GitHub API commit response structure.
"target": "es2022", | ||
"module": "ES2022", | ||
"target": "ESNext", | ||
"module": "Preserve", |
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.
style: Setting module to 'Preserve' may affect how modules are processed. Ensure this doesn't break existing module resolution behavior.
"module": "Preserve", | |
"module": "ESNext", |
@@ -13,7 +13,7 @@ export const githubClient = (apiKey: string) => { | |||
}), | |||
}); | |||
|
|||
const result = await res.json(); | |||
const result: any = await res.json(); |
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.
style: Consider defining a proper type for the GraphQL response instead of using 'any'. Could use a generic type parameter based on the expected query result.
What I did
I want to use module mocking via the pacjage.json imports field.
However to do that I need a higher version of typescript from what we current use.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
Greptile Summary
Upgraded TypeScript across the Storybook monorepo from 5.3.2 to 5.7.3 to enable module mocking via package.json imports field, with notable performance impacts in development mode.
verbatimModuleSyntax
compiler option incode/renderers/svelte/tsconfig.json
to support module mockingcode/renderers/svelte/src/mount.ts
from{ type X }
totype { X }
syntaxtoEqualTypeOf
totoMatchTypeOf
for more flexible type checkingany
type annotations in several files to satisfy stricter type checking requirements