8000 Replace JSDOM with linkedom by tushuhei · Pull Request #905 · google/budoux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace JSDOM with linkedom #905

8000 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

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Replace JSDOM with linkedom #905

merged 1 commit into from
Feb 7, 2025

Conversation

tushuhei
Copy link
Member
@tushuhei tushuhei commented Feb 7, 2025

Fix #888. This change replaces JSDOM with linkedom to support SSR.

JSDOM has been used for HTML processing in Node.js environments, but it doesn't work well with SSR (e.g., Vite) because the library is written in CommonJS. Linkedom seems like a good alternative to JSDOM, with a lighter implementation and a design that keeps SSR in mind.

Although the behavior is not 100% identical to JSDOM (see test cases for white-space: nowrap), I believe this satisfies most use cases required for Node.js environments. If users need elaborate HTML processing considering style cascades etc., they can let the client-side code to do the process.

@tushuhei tushuhei requested a review from kojiishi February 7, 2025 01:14
@tushuhei tushuhei added the javascript Pull requests that update Javascript code label Feb 7, 2025
Copy link
Collaborator
@kojiishi kojiishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice!

@tushuhei tushuhei merged commit 2ab598a into main Feb 7, 2025
26 checks passed
@tushuhei tushuhei deleted the linkedom branch March 11, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken using SSR - Hydrogen
2 participants
0