fix: add react-dom support.#124
Merged
knightedcodemonkey merged 1 commit intomainfrom May 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class react-dom module support to the preview runtime so workspace code can import from react-dom (in addition to the existing react-dom/client) while keeping runtime specifier resolution and module preloading consistent across CDN providers.
Changes:
- Adds a
reactDomruntime specifier and wires it into the preview render runtime controller. - Rewrites
react-domimports in virtual workspace modules to the resolved runtime URL/specifier. - Adds CDN import specs + preload entry for
react-dom, and documents preview root lifecycle behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/preview/render-runtime.js | Includes reactDom in the runtime specifier set passed into the iframe preview execution flow. |
| src/modules/preview-runtime/virtual-workspace-modules.js | Adds import rewrite support for react-dom so workspace imports resolve correctly. |
| src/modules/cdn.js | Defines reactDom in cdnImportSpecs for import map / esm / jspm providers. |
| src/bootstrap.js | Preloads react-dom alongside existing core runtime + React runtime modules. |
| docs/preview-root-lifecycle.md | New documentation explaining when/why <knighted-preview-root> is created/removed during preview renders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.