Skip to content

Avoid es-toolkit barrel import in RN UI common#880

Merged
dannyhw merged 2 commits intonextfrom
codex/fix-es-toolkit-rn-import
Apr 23, 2026
Merged

Avoid es-toolkit barrel import in RN UI common#880
dannyhw merged 2 commits intonextfrom
codex/fix-es-toolkit-rn-import

Conversation

@dannyhw
Copy link
Copy Markdown
Member

@dannyhw dannyhw commented Apr 23, 2026

Summary

This updates @storybook/react-native-ui-common so React Native code no longer imports from the top-level es-toolkit barrel. StoryHash.ts now imports only the needed helpers from the package subpath entrypoints.

Root Cause

Fresh consumer installs can resolve the @storybook/react-native-ui-common es-toolkit dependency range to es-toolkit@1.46.0. That version has a top-level entrypoint that eagerly exports error classes extending DOMException. React Native/Hermes does not provide DOMException, so evaluating the unrelated top-level barrel can crash even though StoryHash.ts only needs countBy, isEqual, and mergeWith.

Validation

  • Confirmed the consumer app resolves es-toolkit@1.46.0.
  • Confirmed top-level require("es-toolkit") throws when DOMException is absent.
  • Confirmed es-toolkit/array, es-toolkit/object, and es-toolkit/predicate load without DOMException.
  • Ran pnpm -F @storybook/react-native-ui-common check:types.
  • Searched the repo for remaining top-level es-toolkit imports/requires.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

🦋 Changeset detected

Latest commit: 417e533

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@storybook/react-native-ui-common Patch
@storybook/react-native Patch
@storybook/react-native-ui Patch
@storybook/react-native-ui-lite Patch
@storybook/react-native-theming Patch
@storybook/addon-ondevice-actions Patch
@storybook/addon-ondevice-backgrounds Patch
@storybook/addon-ondevice-controls Patch
@storybook/addon-ondevice-notes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dannyhw dannyhw changed the title [codex] Avoid es-toolkit barrel import in RN UI common Avoid es-toolkit barrel import in RN UI common Apr 23, 2026
@dannyhw dannyhw marked this pull request as ready for review April 23, 2026 22:23
@dannyhw dannyhw merged commit b3e2164 into next Apr 23, 2026
2 checks passed
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.

1 participant