AriaMinaei / pretty-error

See node.js errors with less clutter
MIT License
1.52k stars 48 forks source link

Suggestion: Create web and node versions separately #52

Closed nyteshade closed 6 years ago

nyteshade commented 6 years ago

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.

AriaMinaei commented 6 years ago

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.

nyteshade commented 6 years ago

@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.