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 and potentially remove dependencies on browser-only APIs #9

Open
mstade opened this issue Sep 22, 2015 · 6 comments
Open

Comments

@mstade
Copy link
Member

mstade commented Sep 22, 2015

From @mstade on September 18, 2015 13:37

Currently, nap depends on at least window.document.matchesSelector but possibly others as well. This dependency causes some issues in supporting execution in both server side and client side contexts, and should possibly be removed altogether. If it can't be removed, care must be taken not to include superfluous dependencies in client side contexts.

Copied from original issue: sammyt/nap#21

@mstade
Copy link
Member Author

mstade commented Sep 23, 2015

@websdk/contributors is anyone using the nap.is API? I'm keen to remove it otherwise, it'd reduce nap's exposure to browser APIs, and limit it to the matches check in bySelector.

@aaronhaines
Copy link
Contributor

I don' think so, but I'll check and get back to you

@mstade
Copy link
Member Author

mstade commented Sep 24, 2015

Much obliged @aaronhaines!

@sammyt
Copy link
Contributor

sammyt commented Sep 26, 2015

Ah yes, browser dependencies. Would be nice if there was an easy way to include/exclude platform specific extension like this. I just put everything in one file, because, well, files.

@sammyt
Copy link
Contributor

sammyt commented Sep 26, 2015

Also, as I recall it made my life much harder when I was trying to get this to run in node, but I guess no one is doing that at the moment(?), but could well be valuable.

@mstade
Copy link
Member Author

mstade commented Sep 28, 2015

I've got #10 running in node. Removing the dependency on window did the trick, but it obviously fails if you don't have something DOM-y to run views against. Probably fair, and not unlike how for example d3 deals with things.

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

3 participants