Skip to content

NXT-4206: Updated storybook to version 10#850

Merged
hong6316 merged 15 commits intodevelopfrom
feature/NXT-4206
Apr 9, 2026
Merged

NXT-4206: Updated storybook to version 10#850
hong6316 merged 15 commits intodevelopfrom
feature/NXT-4206

Conversation

@daniel-stoian-lgp
Copy link
Copy Markdown
Contributor

@daniel-stoian-lgp daniel-stoian-lgp commented Dec 15, 2025

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

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

fileURLToPath has been imported from url and dirname has been imported from path. This imports will be used to create similar files in ESM as we had in commonJS thus minimizing the changes made to this repo. fileURLToPath will be used to create the __filename we use as a parameter for dirname (const __filename = fileURLToPath(import.meta.url)).
We use dirname to create the variable __dirname which used to be a global variable and pass it to the webpack function 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 exportEntries to managerEntries (https://storybook.js.org/docs/addons/addon-migration-guide). For this reason we added a new property in our export object called managerEntries such: 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} /> to return React.createElement(Component, {...props}).

Links

NXT-4206

Comments

Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)

# Conflicts:
#	samples/sampler/npm-shrinkwrap.json
#	samples/sampler/package.json
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.06%. Comparing base (4c8861f) to head (895714d).
⚠️ Report is 1 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hong6316
Copy link
Copy Markdown
Contributor

hong6316 commented Mar 6, 2026

Please list the breaking changes between Storybook v9 -> v10 in Resolution.

Comment thread samples/sampler/.qa-storybook/main.js
Comment thread samples/sampler/.qa-storybook/main.js
Comment thread samples/sampler/.qa-storybook/main.js
Comment thread samples/sampler/.qa-storybook/main.js
Comment thread samples/sampler/.qa-storybook/main.js
Comment thread samples/sampler/custom-addon/DefaultSkinToolbarTab.js
Comment thread samples/sampler/custom-addon/manager.js
Comment thread samples/sampler/custom-addon/manager.js
Comment thread samples/sampler/custom-addon/manager.js
Comment thread samples/sampler/custom-addon/Toolbar.js
Comment thread samples/sampler/custom-addon/Toolbar.js
Comment thread samples/sampler/custom-addon/Toolbar.js
Comment thread samples/sampler/custom-addon/ToolbarTab.js
@hong6316 hong6316 merged commit 5d8b27f into develop Apr 9, 2026
8 checks passed
@hong6316 hong6316 deleted the feature/NXT-4206 branch April 9, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants