Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate moving away from jsdom #25

Open
strogonoff opened this issue Dec 10, 2024 · 0 comments
Open

Investigate moving away from jsdom #25

strogonoff opened this issue Dec 10, 2024 · 0 comments

Comments

@strogonoff
Copy link
Contributor

Our use for JSDOM is to provide a substitute for browser’s Document interface at build time. Perhaps the two main uses for it are:

  1. Store adapters: parsing XML sources (they get passed the decodeXML() function, which returns a Document). Occasionally MN XML adapter uses querySelector(), for example.
  2. Content adapters: generating DOM elements in ProseMirror schema. This is not always needed, but it is technically allowed for schema nodes toDOM() implementations to return actual DOM elements (document.createElement(…)) instead of a spec, and sometimes it comes in useful.

JSDOM provides extensive coverage of selectors and such, but it’s unclear whether all of it is needed and is worth the cost of including this massive library.

The steps would be to try to supplant uses of new JSDOM() with corresponding xmldom or other DOM parser/manipulator implementations, and see if it works for MN.

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

No branches or pull requests

1 participant