Repository navigation
React Native Web: Fix TypeScript 6 peer conflict - #36445
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 120 | 117 | 🎉 -3 🎉 |
| Self size | 29 KB | 104 KB | 🚨 +75 KB 🚨 |
| Dependency size | 26.29 MB | 26.10 MB | 🎉 -198 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/vue3-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 95 | 95 | 0 |
| Self size | 32 KB | 32 KB | 🎉 -24 B 🎉 |
| Dependency size | 18.77 MB | 18.75 MB | 🎉 -20 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/web-components-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 6 | 6 | 0 |
| Self size | 19 KB | 19 KB | 🎉 -12 B 🎉 |
| Dependency size | 515 KB | 454 KB | 🎉 -62 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/vue3
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 91 | 91 | 0 |
| Self size | 229 KB | 209 KB | 🎉 -20 KB 🎉 |
| Dependency size | 18.21 MB | 18.21 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/web-components
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 4 | 4 | 0 |
| Self size | 182 KB | 121 KB | 🎉 -62 KB 🎉 |
| Dependency size | 126 KB | 126 KB | 0 B |
| Bundle Size Analyzer | Link | Link |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⛔ Files ignored due to path filters (1)
⚙️ Run configuration
⛔ Files ignored due to path filters (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. WalkthroughThe package moves ChangesPackage dependencies
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The TypeScript 6 peer conflict appears resolved, with no identified issue requiring a change before merge. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #36305
Problem
@storybook/react-native-web-viteinstalledvite-tsconfig-pathsin consumer projects. That package installs deprecatedtsconfck@3.1.6, whose optional peer accepts only TypeScript 5. A React Native Web project using TypeScript 6 with strict pnpm peer checks therefore could not install Storybook, even though Storybook itself supports TypeScript 6:Reproduce before this fix
The public reproduction is https://github.com/NiGhTTraX/sb-rnw-ts-peer-dep.
git clone https://github.com/NiGhTTraX/sb-rnw-ts-peer-dep cd sb-rnw-ts-peer-dep pnpm install pnpm peers checkWith the affected package,
pnpm peers checkreports thetsconfck@3.1.6/ TypeScript 6 conflict shown above.This PR keeps
vite-tsconfig-pathsinside the Storybook bundle instead of installing it into the consumer dependency graph. TypeScript remains external as an optional>=5.9peer, so strict installs accept both TypeScript 5.9 and 6 while the existing Vite 6/7/8 path-resolution behavior is preserved.What I did
vite-tsconfig-pathsimplementation into@storybook/react-native-web-viteinstead of installing it in consumer projects.>=5.9as an optional peer so the build keeps TypeScript external while accepting both TypeScript 5.9 and 6..web.*extension precedence across Vite 6, 7, and 8.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
yarn nx compile react-native-web-vite --skip-nx-cache.yarn workspace @storybook/react-native-web-vite pack -o "$PWD/react-native-web-vite.tgz".pnpm add --save-exact /absolute/path/to/react-native-web-vite.tgz --strict-peer-dependencies.tsconfck/TypeScript peer error. Repeat with TypeScript 5.9 if desired..web.tsor.web.tsxfile and confirm a Vite build resolves an extensionless aliased import.Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH 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.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake 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 - 🚫 Not run
This PR does not have a canary release associated.
In-repo PRs: add the
ci:canarylabel. Later pushes republish while the label remains.Fork PRs: the label does nothing (a later push must not auto-publish). A maintainer publishes from this repository with Run workflow and the
prinput.branchandshaare optional; if more than one is set, they must be the same commit. The fork author does not need to do anything.