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

CPC: Fix Vite builder had wrong conditions #28581

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Jul 12, 2024

Closes #28545

What I did

I removed the "extra conditions" added during CPC work, as it appear to be causing #28545

Repro:
https://stackblitz.com/edit/storybook-interoprequiredefault2-error-rvpcnf?file=src%2FComponent.stories.jsx,package.json,src%2FComponent.jsx,package-lock.json

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

I downloaded the repro:
https://stackblitz.com/edit/storybook-interoprequiredefault2-error-rvpcnf?file=src%2FComponent.stories.jsx,package.json,src%2FComponent.jsx,package-lock.json

I copied the node_modules/@storybook/builder-vite/dist to <monorepo>/code/builders/vite-builder/dist

And that got things working.

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/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 pull request has been released as version 0.0.0-pr-28581-sha-1dc31136. Try it out in a new sandbox by running npx storybook@0.0.0-pr-28581-sha-1dc31136 sandbox or in an existing project with npx storybook@0.0.0-pr-28581-sha-1dc31136 upgrade.

More information
Published version 0.0.0-pr-28581-sha-1dc31136
Triggered by @ndelangen
Repository storybookjs/storybook
Branch norbert/cpc-remove-vite-extra
Commit 1dc31136
Datetime Fri Jul 12 17:02:14 UTC 2024 (1720803734)
Workflow run 9911464747

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=28581

name before after diff %
createTime 17.6s 23.7s 6.1s 🔺25.8%
generateTime 22.2s 23s 787ms 3.4%
initTime 22.3s 23.8s 1.5s 🔺6.4%
createSize 0 B 0 B 0 B -
generateSize 76.5 MB 76.5 MB 0 B 0%
initSize 198 MB 198 MB -76 B 0%
diffSize 122 MB 122 MB -76 B 0%
buildTime 13.5s 16.4s 2.8s 🔺17.4%
buildSize 7.59 MB 7.59 MB 0 B 0%
buildSbAddonsSize 1.63 MB 1.63 MB 0 B 0%
buildSbCommonSize 195 kB 195 kB 0 B 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B 0%
buildSbPreviewSize 349 kB 349 kB 0 B 0%
buildStaticSize 0 B 0 B 0 B -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 0%
buildPreviewSize 3.12 MB 3.12 MB 0 B 0%
testBuildTime 0ms 0ms 0ms -
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 -
devPreviewResponsive 10s 8.2s -1s -810ms 🔰-22%
devManagerResponsive 5.8s 5.4s -390ms 🔰-7.1%
devManagerHeaderVisible 843ms 1s 247ms 🔺22.7%
devManagerIndexVisible 847ms 1.1s 290ms 🔺25.5%
devStoryVisibleUncached 1.7s 970ms -744ms 🔰-76.7%
devStoryVisible 891ms 1.1s 272ms 🔺23.4%
devAutodocsVisible 728ms 798ms 70ms 🔺8.8%
devMDXVisible 731ms 735ms 4ms 0.5%
buildManagerHeaderVisible 715ms 881ms 166ms 🔺18.8%
buildManagerIndexVisible 722ms 893ms 171ms 🔺19.1%
buildStoryVisible 767ms 954ms 187ms 🔺19.6%
buildAutodocsVisible 676ms 1s 337ms 🔺33.3%
buildMDXVisible 658ms 879ms 221ms 🔺25.1%

@ndelangen ndelangen self-assigned this Jul 12, 2024
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.

PR Summary

  • Removed extra conditions in vite builder causing errors
  • Verified fix with provided reproduction steps
  • No documentation updates required
  • No major changes found since last review

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@ndelangen ndelangen added bug patch:yes Bugfix & documentation PR that need to be picked to main branch builder-vite ci:normal labels Jul 12, 2024
@ndelangen ndelangen requested review from shilman and yannbf July 12, 2024 17:00
Copy link

nx-cloud bot commented Jul 12, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1dc3113. 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 2 targets

Sent with 💌 from NxCloud.

@ndelangen
Copy link
Member Author

@ndelangen
Copy link
Member Author

I traced the problem to babel-runtime

It seems having these conditions, causes different files from babel to get loaded:
https://github.com/babel/babel/blob/main/packages/babel-runtime/package.json#L20-L1026

And then where an CJS file is expected, and ESM file is provided.

@ndelangen ndelangen merged commit a0a031e into next Jul 12, 2024
61 of 63 checks passed
@ndelangen ndelangen deleted the norbert/cpc-remove-vite-extra branch July 12, 2024 18:25
@github-actions github-actions bot mentioned this pull request Jul 12, 2024
33 tasks
storybook-bot pushed a commit that referenced this pull request Jul 12, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
@github-actions github-actions bot mentioned this pull request Jul 12, 2024
13 tasks
storybook-bot pushed a commit that referenced this pull request Jul 12, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
storybook-bot pushed a commit that referenced this pull request Jul 12, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
storybook-bot pushed a commit that referenced this pull request Jul 12, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
storybook-bot pushed a commit that referenced this pull request Jul 13, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
storybook-bot pushed a commit that referenced this pull request Jul 15, 2024
CPC: Fix vite builder had wrong conditions
(cherry picked from commit a0a031e)
@valentinpalkovic valentinpalkovic changed the title CPC: Fix vite builder had wrong conditions CPC: Fix Vite builder had wrong conditions Jul 15, 2024
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug builder-vite ci:normal 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Using material ui with storybooks results with "_interopRequireDefault2 is not a function" error.
2 participants