Slate: Remove Cheerio

Created on 1 May 2017  Â·  4Comments  Â·  Source: ianstormtaylor/slate

Proposing this, not sure of how hard it will be, but cheerio is designed for the server and comes with a ton of node core dependencies it wants. It was causing me some headaches in terms of build size (Buffer and other files coming in are huge).

Separately, recently tried to use webpackbin to show some code on Slate, and it failed. See this issue: https://github.com/cerebral/webpackbin/issues/17#issuecomment-298134310

For a browser-focused lib, seems we could do better.

♥ help ⚑ filesize

Most helpful comment

I'd be open to using a DOMParser-compatible API, so that in the browser we can just use DOMParser directly, and on the server we can use something that implements DOMParser's API, like parse5?

All 4 comments

Ah that is annoying. Any ideas for a Cheerio replacement that offers a simple API?

This will also be solved (depending on your use case) with https://github.com/ianstormtaylor/slate/issues/55

Yea, removing it as an option seems like a good first step. We don't use it in our stack at all so that would fix our use case.

On first look, parse5 seems legit, and doesn't seem to have any deps:

https://github.com/inikulin/parse5

Ok, since cheerio is breaking my favorite js bundler, and my favorite online code sharing env, going to try and submit a PR for this :)

I'd be open to using a DOMParser-compatible API, so that in the browser we can just use DOMParser directly, and on the server we can use something that implements DOMParser's API, like parse5?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianstormtaylor picture ianstormtaylor  Â·  3Comments

markolofsen picture markolofsen  Â·  3Comments

bengotow picture bengotow  Â·  3Comments

Slapbox picture Slapbox  Â·  3Comments

ianstormtaylor picture ianstormtaylor  Â·  3Comments