Skip to content

Sandboxes: RN add missing prop-types#34854

Merged
valentinpalkovic merged 1 commit into
nextfrom
norbert/sandbox-rn-expo-prop-types
May 21, 2026
Merged

Sandboxes: RN add missing prop-types#34854
valentinpalkovic merged 1 commit into
nextfrom
norbert/sandbox-rn-expo-prop-types

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented May 20, 2026

What I did

Two of our react-native-web-vite sandbox templates were missing prop-types from modifications.extraDependencies:

  • react-native-web-vite/expo-ts
  • react-native-web-vite/rn-cli-ts

The React renderer's template-stories include js-argtypes.stories.jsx, which imports prop-types directly. Every other React-renderer sandbox in code/lib/cli-storybook/src/sandbox-templates.ts already declares prop-types explicitly via extraDependencies — these two were the only outliers and were relying on a transitive hoist that doesn't reliably survive the RN/Expo install paths.

This surfaced on the ci:daily run for the 10.5.0-alpha.1 release PR (#34822) as:

Error: [vite]: Rolldown failed to resolve import "prop-types" from "./src/stories/renderers/react/js-argtypes.stories.jsx".

See CI log:
https://app.circleci.com/pipelines/github/storybookjs/storybook/122653/workflows/3c6828c3-e3ec-4ca8-9244-f3213b480fb9/jobs/1485401

Only expo-ts actually runs in ci:daily today (rn-cli-ts is commented out of the daily array), but both templates have the identical gap, so I'm fixing both to keep the React-renderer sandbox configs consistent and avoid the same trap when rn-cli-ts is re-enabled.

This is a sandbox/CI-only fix. Real users of these templates who actually use PropTypes in their components already install prop-types themselves; this only affects our synthetic test sandboxes that copy the React renderer's template-stories in.

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

The change is verified by the existing react-native-web-vite/expo-ts sandbox E2E in ci:daily — the same job that surfaced the failure on #34822. No new test is needed; the failing job becomes the passing job.

Manual testing

I did not manual testing, I'm depending on the CI running this correctly, I ensured it's ran with the daily label

Documentation

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

No user-facing docs need to change — prop-types is only added to internal sandbox templates, not to anything shipped to users.

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

    Use ci:daily — the affected templates (react-native-web-vite/*) only run in the daily cadence, so ci:normal / ci:merged will not exercise this fix.

  • 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.

    Label: build — internal sandbox/CI fix; should not appear in the release changelog.

🦋 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
    • Updated React Native Web Vite sandbox templates to include prop-types as a default dependency, ensuring prop validation support is available out of the box for new projects.

Review Change Stack

…templates

This update ensures that the React renderer's template-stories correctly declare `prop-types`, aligning with other React-renderer sandboxes. The addition is made in both the baseTemplates and modifications sections.
Copilot AI review requested due to automatic review settings May 20, 2026 14:15
@ndelangen ndelangen self-assigned this May 20, 2026
@ndelangen ndelangen added react-native build Internal-facing build tooling & test updates ci:daily Run the CI jobs that normally run in the daily job. labels May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a missing dependency declaration in the React Native Web (Vite) sandbox templates so CI sandboxes don’t fail when React renderer template stories import prop-types.

Changes:

  • Add prop-types to modifications.extraDependencies for react-native-web-vite/expo-ts.
  • Add prop-types to modifications.extraDependencies for react-native-web-vite/rn-cli-ts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 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: 4eedb8ce-36b9-4c20-b0c9-58eb3cc163a1

📥 Commits

Reviewing files that changed from the base of the PR and between 8d9719c and 075e74c.

📒 Files selected for processing (1)
  • code/lib/cli-storybook/src/sandbox-templates.ts

📝 Walkthrough

Walkthrough

This PR adds the prop-types dependency to the modifications.extraDependencies configuration for two react-native-web-vite sandbox templates: react-native-web-vite/expo-ts and react-native-web-vite/rn-cli-ts. Both templates now explicitly include prop-types as an extra dependency.

Changes

Add missing prop-types dependency

Layer / File(s) Summary
Template modifications for prop-types
code/lib/cli-storybook/src/sandbox-templates.ts
Both react-native-web-vite/expo-ts and react-native-web-vite/rn-cli-ts templates are updated to include prop-types in their modifications.extraDependencies configuration. The expo-ts template includes inline comments explaining the dependency source.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • storybookjs/storybook#32549: Both PRs modify the react-native-web-vite/expo-ts template configuration by adding different entries to its modifications block.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@valentinpalkovic valentinpalkovic merged commit 94ab7b4 into next May 21, 2026
326 of 333 checks passed
@valentinpalkovic valentinpalkovic deleted the norbert/sandbox-rn-expo-prop-types branch May 21, 2026 11:31
@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 21, 2026
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 22, 2026
RuBrock pushed a commit to RuBrock/storybook that referenced this pull request May 23, 2026
…-rn-expo-prop-types

Sandboxes: RN add missing `prop-types`
(cherry picked from commit 94ab7b4)
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. patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch react-native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants