Skip to content

Build: Fix CI issues for expo and sveltekit sandboxes#34135

Merged
yannbf merged 3 commits into
nextfrom
yann/expo-sandbox-workaround
Mar 13, 2026
Merged

Build: Fix CI issues for expo and sveltekit sandboxes#34135
yannbf merged 3 commits into
nextfrom
yann/expo-sandbox-workaround

Conversation

@yannbf
Copy link
Copy Markdown
Member

@yannbf yannbf commented Mar 13, 2026

Closes #

What I did

Temporary workaround while we report the issue to rolldown maintainers

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

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Improved detection of Vite-based sandboxes using template metadata for more reliable build handling.
    • Added a targeted Vite downgrade workaround for a specific Expo-related sandbox to restore compatibility.
    • Simplified Svelte Kit skeleton templates by removing an explicit extra-dependency requirement.

@yannbf yannbf requested a review from Sidnioulz March 13, 2026 14:38
@yannbf yannbf self-assigned this Mar 13, 2026
@yannbf yannbf added the ci:daily Run the CI jobs that normally run in the daily job. label Mar 13, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 13, 2026

View your CI Pipeline Execution ↗ for commit 797afae

Command Status Duration Result
nx run-many -t compile -c production --parallel=1 ✅ Succeeded 4m 47s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-13 19:34:54 UTC

@yannbf yannbf added the build Internal-facing build tooling & test updates label Mar 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c142d60-0146-4074-a128-241ea599d85d

📥 Commits

Reviewing files that changed from the base of the PR and between 3a66397 and 797afae.

📒 Files selected for processing (2)
  • code/lib/cli-storybook/src/sandbox-templates.ts
  • scripts/utils/yarn.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/utils/yarn.ts

📝 Walkthrough

Walkthrough

Replaces heuristic Vite sandbox detection with a template lookup and adds a targeted Vite downgrade for a specific Expo sandbox. Also removes certain template modifications and adds a new svelte-kit skeleton template entry in the sandbox templates.

Changes

Cohort / File(s) Summary
Sandbox detection & workaround logic
scripts/utils/yarn.ts
Imports allTemplates and rewrites isViteSandbox() to check allTemplates[key].expected.builder. Removes the previous heuristic-based Vite 8 beta override and adds a specific downgrade to vite@8.0.0-beta.4 for react-native-web-vite/expo-ts; preserves other existing resolution branches.
Sandbox templates
code/lib/cli-storybook/src/sandbox-templates.ts
Removes modifications entries (extraDependencies) from svelte-vite/default-js and svelte-vite/default-ts; replaces/introduces svelte-kit/skeleton-ts base template without the previous extraDependencies modification.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #33788: Modifies the same yarn utility functions (isViteSandbox, addWorkaroundResolutions) with related control-flow changes.
  • #33310: Touches scripts/utils/yarn.ts and adds special-case handling for react-native-web-vite/expo-ts.
  • #32791: Updates sandbox-templates.ts entries, related to the template changes in this PR.
✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/utils/yarn.ts (1)

106-125: ⚠️ Potential issue | 🔴 Critical

Expo Vite downgrade branch is unreachable.

Line 106 already matches react-native-web-vite/expo-ts, so the else if at Line 120 never runs. That means the intended vite: '8.0.0-beta.4' workaround is never applied.

💡 Proposed fix
   } else if (key === 'react-rsbuild/default-ts') {
     additionalResolutions = {
       'react-docgen': '^8.0.2',
     };
-  } else if (key === 'react-native-web-vite/expo-ts') {
-    additionalResolutions = {
+  }
+
+  if (key === 'react-native-web-vite/expo-ts') {
+    additionalResolutions = {
+      ...additionalResolutions,
       // The expo sandbox started to break in beta 5, yet to investigate the root cause
       // in the meantime, we downgrade to the version where things worked.
       vite: '8.0.0-beta.4',
     };
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/utils/yarn.ts` around lines 106 - 125, The branch for applying the
Expo Vite downgrade is unreachable because the first if already matches
'react-native-web-vite/expo-ts'; update the conditional logic around the
variable key and additionalResolutions so the expo-specific resolution is
applied: either remove the duplicate 'react-native-web-vite/expo-ts' from the
first if and keep the later else-if that sets vite: '8.0.0-beta.4', or merge the
vite entry into the first branch where 'react-native-web-vite/expo-ts' is
handled; edit the conditionals around key and the additionalResolutions
assignments (the key variable and additionalResolutions object) to ensure the
vite override is actually set for the expo case.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@scripts/utils/yarn.ts`:
- Around line 106-125: The branch for applying the Expo Vite downgrade is
unreachable because the first if already matches
'react-native-web-vite/expo-ts'; update the conditional logic around the
variable key and additionalResolutions so the expo-specific resolution is
applied: either remove the duplicate 'react-native-web-vite/expo-ts' from the
first if and keep the later else-if that sets vite: '8.0.0-beta.4', or merge the
vite entry into the first branch where 'react-native-web-vite/expo-ts' is
handled; edit the conditionals around key and the additionalResolutions
assignments (the key variable and additionalResolutions object) to ensure the
vite override is actually set for the expo case.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 407eba25-68e3-4ad0-af23-6409bf8b87f0

📥 Commits

Reviewing files that changed from the base of the PR and between 89e203f and 3a66397.

📒 Files selected for processing (1)
  • scripts/utils/yarn.ts

@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 797afae, ran on 13 March 2026 at 16:05:36 UTC

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

storybook

Before After Difference
Dependency count 49 49 0
Self size 20.43 MB 20.22 MB 🎉 -212 KB 🎉
Dependency size 16.54 MB 16.54 MB 0 B
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 183 183 0
Self size 780 KB 779 KB 🎉 -276 B 🎉
Dependency size 67.62 MB 67.40 MB 🎉 -212 KB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 176 176 0
Self size 32 KB 32 KB 0 B
Dependency size 66.14 MB 65.93 MB 🎉 -212 KB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 50 50 0
Self size 1.04 MB 1.04 MB 🎉 -144 B 🎉
Dependency size 36.97 MB 36.76 MB 🎉 -212 KB 🎉
Bundle Size Analyzer node node

@yannbf yannbf changed the title Build: Downgrade vite on expo sandboxes Build: Fix CI issues for expo and svelte sandboxes Mar 13, 2026
@yannbf yannbf changed the title Build: Fix CI issues for expo and svelte sandboxes Build: Fix CI issues for expo and sveltekit sandboxes Mar 13, 2026
@yannbf yannbf merged commit c293dd4 into next Mar 13, 2026
303 of 309 checks passed
@yannbf yannbf deleted the yann/expo-sandbox-workaround branch March 13, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:daily Run the CI jobs that normally run in the daily job.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants