angular icon indicating copy to clipboard operation
angular copied to clipboard

Switch to Cheerio instead of JSDom?

Open scottmas opened this issue 9 years ago • 1 comments

JSDom has major issues compiling to the various platforms (e.g. See the bottom several paragraphs on their npm page detailing how to ensure it builds). The root cause of this is its "contextify" dependency which natively sandboxes the runtime. As useful as that sounds I'm skeptical its truly necessary for most use cases, especially given the many hoops one must jump through to get JSDom to build. On my machine I STILL can't get it working 5 gbs of downloads later. Am I crazy to think this is an unacceptably high hurdle for the majority of developers simple wanting to require Angular from NPM rather than bower?

So an alternative solution to JSDom is the Cheerio library. This module is compatible with all major platforms out of the box, is actually MORE popular than JSDom judging from download numbers, is faster than JSDom, and comes out of the box with its own port of the the jQuery selector library.

I recognize this may NOT be possible if Angular is super strict on the browser like environment it demands. But it would be worth looking into. Any thoughts?

scottmas avatar Sep 24 '14 22:09 scottmas

I'm pretty pessimistic Cheerio would work, though it's a nice thought.

@scottmas Perhaps if you ever do get JSDom to build, you should distribute a binary of it. :smile:

boneskull avatar Nov 23 '14 11:11 boneskull