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

allow DOMParser to be passed in #18

Open
derhuerst opened this issue Feb 8, 2017 · 3 comments
Open

allow DOMParser to be passed in #18

derhuerst opened this issue Feb 8, 2017 · 3 comments

Comments

@derhuerst
Copy link

It would be nice to be able to pass DOMParser into parse. Right now, I have to mutate global in Node.js in order to be able to use this library.

@derhuerst
Copy link
Author

derhuerst commented Feb 8, 2017

Also, I noticed that vdom-parser implicitly relies on document to exist. Like with window.DOMParser, taking it as an optional parameter would be better.

Otherwise requiring global might be a good solution.

@bitinn
Copy link
Owner

bitinn commented Feb 9, 2017 via email

@derhuerst
Copy link
Author

derhuerst commented Feb 9, 2017

Nevertheless, it's a nice design goal to have isomorphic modules that both in the Browser and in Node. This makes Server-side rendering, tests and automation easier. This is why the global module has been made.

Taking in an opt parameter wouldn't that of a problem right?

I tried vdom-to-html afterwards and it works fine, but I also want other devs not to have to dig into all available modules.

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

2 participants