fix(kernel-ui): rationalize build externals and dependency declarations#652
Merged
fix(kernel-ui): rationalize build externals and dependency declarations#652
Conversation
rekmarks
requested changes
Oct 1, 2025
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.
Description
This PR rationalizes the build configuration and dependency declarations for the
@metamask/kernel-uipackage to make it a properly self-contained UI library.Problem
The kernel-ui package had several configuration issues:
ses)dependenciesinstead ofdevDependenciesSolution
Build Configuration Changes
react,react-dom, and JSX runtimes are externalDependency Changes
ses- not imported anywhere in the source code@metamask/ocap-kernel- only used for TypeScript type importsreactandreact-dom(removed@metamask/design-system-react- it's bundled)TypeScript Configuration Cleanup
sesfrom types arrays in bothtsconfig.jsonandtsconfig.build.json@metamask/streams,@metamask/kernel-shims)Impact
✅ Simpler consumption: Applications using kernel-ui (like the extension popup) now only need to:
✅ Better dependency management: Clear separation between what's bundled vs what consumers must provide
✅ Cleaner build: No warnings about missing dependencies, all depcheck issues resolved
Testing
Note
Kernel UI now bundles internal deps and only externals React (declared as peer), removes SES/types/references, and the extension build renames the _commonjsHelpers chunk.
react,react-dom, and JSX runtimes inpackages/kernel-ui/vite.config.ts.reactandreact-domtopeerDependencies; removereact,react-dom, andsesfromdependenciesinpackages/kernel-ui/package.json.sesfromtypesarrays; drop unused references to@metamask/kernel-shimsand@metamask/streamsintsconfig.json/tsconfig.build.json.chunkFileNamesinpackages/extension/vite.config.tsto rename_commonjsHelperstocommonjsHelpers.js.Written by Cursor Bugbot for commit 85e7deb. This will update automatically on new commits. Configure here.