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

RNW-Vite: Add tsconfig path aliases support #29953

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented Dec 8, 2024

Closes N/A

What I did

New Expo projects use tsconfig path aliases by default, so support it out of the box.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Run the expo sandbox and create a story for a component that uses tsconfig path imports, e.g. import Component from '@/components/Component'.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-29953-sha-bbfabab3. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-29953-sha-bbfabab3
Triggered by @shilman
Repository storybookjs/storybook
Branch shilman/rnw-add-typescript-paths
Commit bbfabab3
Datetime Sun Dec 8 15:25:23 UTC 2024 (1733671523)
Workflow run 12223003343

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=29953

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B -1.09 0%
initSize 130 MB 130 MB 0 B 1.98 0%
diffSize 52.7 MB 52.7 MB 0 B 1.98 0%
buildSize 6.87 MB 6.87 MB 0 B 2 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 1.16 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.57 MB 3.57 MB 0 B 1.16 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B 2 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 6.4s 6.7s 342ms -0.78 5.1%
generateTime 18.2s 19s 793ms -0.83 4.2%
initTime 11.6s 13.1s 1.4s -0.39 11.2%
buildTime 8.8s 8.6s -174ms -0.45 -2%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6s 4.5s -1s -427ms -0.7 -31.1%
devManagerResponsive 4s 3.3s -662ms -0.66 -19.6%
devManagerHeaderVisible 646ms 553ms -93ms -0.22 -16.8%
devManagerIndexVisible 718ms 629ms -89ms -0.17 -14.1%
devStoryVisibleUncached 1.3s 1.8s 519ms 0.39 28.2%
devStoryVisible 719ms 628ms -91ms -0.04 -14.5%
devAutodocsVisible 570ms 541ms -29ms 0.47 -5.4%
devMDXVisible 425ms 539ms 114ms 0.41 21.2%
buildManagerHeaderVisible 629ms 552ms -77ms -0.19 -13.9%
buildManagerIndexVisible 708ms 637ms -71ms -0.14 -11.1%
buildStoryVisible 571ms 508ms -63ms -0.16 -12.4%
buildAutodocsVisible 456ms 408ms -48ms -0.57 -11.8%
buildMDXVisible 494ms 384ms -110ms -0.94 -28.6%

Greptile Summary

Adds TypeScript path alias support for React Native Web Vite projects, enabling default path aliases in new Expo projects through the integration of vite-tsconfig-paths plugin.

  • Added vite-tsconfig-paths dependency (^5.1.4) in code/frameworks/react-native-web-vite/package.json
  • Integrated tsconfigPaths() plugin in code/frameworks/react-native-web-vite/src/vite-plugin.ts and preset.ts
  • Configured plugin to run before React and React Native Web plugins for proper path resolution

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

code/frameworks/react-native-web-vite/src/preset.ts Outdated Show resolved Hide resolved
@shilman shilman force-pushed the shilman/rnw-add-typescript-paths branch from f973344 to bbfabab Compare December 8, 2024 14:54
Copy link

nx-cloud bot commented Dec 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bbfabab. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@storybook-pr-benchmarking
Copy link

Package Benchmarks

Commit: bbfabab, ran on 8 December 2024 at 15:07:23 UTC

The following packages have significant changes to their size or dependencies:

@storybook/react-native-web-vite

Before After Difference
Dependency count 102 105 🚨 +3 🚨
Self size 41 KB 41 KB 🚨 +389 B 🚨
Dependency size 17.86 MB 18.01 MB 🚨 +154 KB 🚨
Bundle Size Analyzer Link Link

@dannyhw
Copy link
Member

dannyhw commented Dec 8, 2024

Tested this, works 👍

@shilman shilman merged commit f545849 into next Dec 9, 2024
59 checks passed
@shilman shilman deleted the shilman/rnw-add-typescript-paths branch December 9, 2024 06:50
@shilman shilman self-assigned this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants