NXT-4206: Updated storybook to version 10#850
Merged
Conversation
# Conflicts: # samples/sampler/npm-shrinkwrap.json # samples/sampler/package.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #850 +/- ##
========================================
Coverage 85.06% 85.06%
========================================
Files 118 118
Lines 4493 4493
Branches 1226 1226
========================================
Hits 3822 3822
Misses 518 518
Partials 153 153 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # samples/sampler/custom-addon/ToolbarTab.js # samples/sampler/npm-shrinkwrap.json # samples/sampler/package.json
ion-andrusciac-lgp
approved these changes
Feb 27, 2026
Contributor
|
Please list the breaking changes between Storybook v9 -> v10 in |
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
hong6316
reviewed
Mar 6, 2026
# Conflicts: # CHANGELOG.md # samples/sampler/npm-shrinkwrap.json # samples/sampler/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Issue Resolved / Feature Added
Latest storybook is 10.x
Resolution
Updated storybook to version 10
Update configuration to work with ESM
Changed custom addon configuration to work in ESM
In the release notes for storybook 10 it denotes as the only breaking change that Storybook is now ESM only:
https://github.com/storybookjs/storybook/releases/tag/v10.0.0
Additional Considerations
Migration guide made by storybook team: https://storybook.js.org/docs/releases/migration-guide
fileURLToPathhas been imported fromurlanddirnamehas been imported frompath. This imports will be used to create similar files in ESM as we had in commonJS thus minimizing the changes made to this repo.fileURLToPathwill be used to create the__filenamewe use as a parameter fordirname(const __filename = fileURLToPath(import.meta.url)).We use
dirnameto create the variable__dirnamewhich used to be a global variable and pass it to thewebpackfunction as a parameter (const __dirname = dirname(__filename)).This is the node documentation for this functions:
https://nodejs.org/api/url.html#urlfileurltopathurl-options
https://nodejs.org/api/path.html#pathdirnamepath
When it comes to our custom addons, it is recommended to switch from
exportEntriestomanagerEntries(https://storybook.js.org/docs/addons/addon-migration-guide). For this reason we added a new property in our export object calledmanagerEntriessuch:managerEntries: [resolve(__dirname, '../custom-addon/manager.js')].We also needed to change syntax from JSX to React.createComponent because, since the change to ESM, storybook does not permit use of JSX in addons. This components are used in the same way as before, just the return statement was changed from
return () => <Component {...props} />toreturn React.createElement(Component, {...props}).Links
NXT-4206
Comments
Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)