[lexical-headless][lexical-html] Bug Fix: Fix entrypoint for @lexical/headless/dom and generalize $generateNodesFromDOM#7859
Merged
etrepum merged 11 commits intofacebook:mainfrom Sep 29, 2025
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… getComputedStyle to withDOM globals
zurfyx
approved these changes
Sep 29, 2025
Merged
etrepum
added a commit
to etrepum/lexical
that referenced
this pull request
Oct 21, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 27, 2025
Co-authored-by: Christopher Norman <normtronics@gmail.com>
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
Fixes the issue with the generate package.json for the new lexical-headless DOM module, the browser condition exports had the extensions in the wrong order.
Also generalizes the
@lexical/html$generateNodesFromDOMto work with anyParentNodenot just aDocument, which is useful in situations where the HTML is not being parsed directly from a string (e.g. hydration, or only generating from a subtree of the parsed HTML)For www it's hard to know if this works being on the outside of haste but this gives the capability to add a special combined
.www.cjsentrypoint instaed of the dual.ts+.browser.tsfiles. It's up to the www dev to come up with these special cases, but I don't think we'll really need more of them than here?Test plan
Before
Produced code that would require jsdom unconditionally even if not used (e.g. in the browser) when the LexicalHeadlessDom module was loaded.
After
Produces code that requires jsdom conditionally by doing an unholy combination of a specially written entrypoint plus a hack to effectively un-hoist the require.