AriaMinaei/pretty-error

Suggestion: Create web and node versions separately

nyteshade opened this issue · 2 comments

In an attempt to keep unnecessary package creep from happening, it would be very nice if there were two versions or a plugin architecture where we could depend on a version that included or did not included web/browser based rendering.

Some of the dependencies (22 packages in total once flattened; including pretty-error) are not at all needed in a server only environment.

Hmm, I actually made pretty-error only for node, but yes, the dependencies could have browser-specific code.

Taking a look at the dependencies, through RenderKid, we get to htmlparser2 and css-select. The first one parses XML which is one of the inputs that RenderKid accepts. The second one is a simple utility to parse and apply css selectors. Since RenderKid creates XML documents and styles them with CSS, I don't see how we can skip either of these dependencies.

@AriaMinaei wow, ok, I admit I didn't look at the code but I never suspected you'd be using XML of all things to make it work. I guess that makes sense.