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

Benefits over jsdom? #2

Open
ctrlplusb opened this issue Jul 15, 2016 · 1 comment
Open

Benefits over jsdom? #2

ctrlplusb opened this issue Jul 15, 2016 · 1 comment

Comments

@ctrlplusb
Copy link

ctrlplusb commented Jul 15, 2016

Not trying to sound snarky or unappreciative here. Purely from a place of ignorance and interest, what are the main benefits that this library would hold over an alternative like jsdom?

@developit
Copy link
Owner

developit commented Jul 15, 2016

Just a different and much smaller implementation, specifically focussed on a few primitives that make up the base that many libraries depend on. JSDOM is targeted specifically at Node, and acts as a polyfill on top of Node's features (example: emulating XMLHttpRequest). This is fairly major overkill for any browser usage.

There is an open issue to better define what "minimal" means in terms of the project's goals, which I think would help explain why undom exists.

Personally, my use-case is similar to the JSFiddle linked in the readme - being able to render virtual DOM into a mock DOM. That means there is no need for the rest of the BOM, and much of DOM level 3. Since undom can be used in any JS environment, my plan is to render to it in a WebWorker or on the server, then sync changes to the real DOM using MutationObserver events.

To sum up: jsdom is an implementation of the BOM, undom is an implementation of Document interface only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants