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

Add reference to dom2hscript in Readme #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AkeemMcLennon
Copy link

Hello everyone,

I ended up creating a client side version of twilson63/html2hscript that uses the browser's built in DOM and CSS parser at https://github.com/AkeemMcLennon/dom2hscript

Although I'm still using html2hscript in the backend, the 200kb dependency on htmlparser2 was too large for use in production. However, this dependency is no longer necessary in the browser context.

@Zolmeister
Copy link
Contributor

How does this compare to https://github.com/bitinn/vdom-parser ?

@AkeemMcLennon
Copy link
Author

@Zolmeister Thanks for the link!

To be honest, I haven't actually done much research into vdom-parser. It may not have existed when I first started using Virtual DOM in my project.

Superficially, dom2hscript has a smaller footprint, but I'll be sure to compare the unit tests in order to investigate further.

@AkeemMcLennon
Copy link
Author

@Zolmeister After taking a closer look, the biggest meaningful difference is that vdom-parser outputs a VNode object and therefore has a dependency on virtual-dom itself. On the other hand, dom2hyperscript outputs a valid hyperscript string and has no external dependencies outside of testing. Obviously you are probably using virtual-dom anyway, but that's one thing to consider.

However, the two projects are fairly similar and I've submitted a pull request to fix a few bugs that I've discovered in the meantime.

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

Successfully merging this pull request may close these issues.

2 participants