posthtml / htmlnano

Modular HTML minifier, built on top of the PostHTML

Home Page:https://htmlnano.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove uncss?

devongovett opened this issue · comments

It seems pretty much unmaintained, and purgecss is already supported as an alternative. Currently, the dependency on uncss causes a bunch of deprecated packages to be installed via a very old JSDOM dependency, including request, request-promise-native, and har-validator. These show up during an npm install of htmlnano or any other tool using htmlnano (like Parcel).

@NovaAtWarren maintains a fork of uncss with updated dependencies (#152). Also, some people, I guess, might still use it. Maybe instead of removing we could move it to optionalDependencies? So it won't be installed by default, but if someone wants to use it, they can install it.

Just had a quick look at what's needed. I see that uncss is currently the default tool so would be a breaking change. I'm surprised at that patch file too: I've not tried it, but surely that doesn't work?

Would it make sense to remove uncss entirely and release a new major version?

I've not tried it, but surely that doesn't work?

I guess it works.

Would it make sense to remove uncss entirely and release a new major version?

I don't think we should remove it entirely. Some people are still using it. Instead, I'd suggest switching to PurgeCSS as a default option and let people install uncss as an optional dependency and use it as well. What do you think? 

commented

@maltsev

What about making them peer dependencies? Anyone who wants to use will have to install it by him/herself.

Also cc @thewilkybarkid

What about making them peer dependencies? Anyone who wants to use will have to install it by him/herself.

Yes, that's a great idea! I'm not 100% sure it'd work seamlessly though. It'd be awesome if someone could create a PR with that :-)

Fixed in #168.

This is now causing a security issue for all downstream dependencies of htmlnano due to an old version of postcss. See GHSA-566m-qj78-rww5. Any chance this could be released?

Any chance this could be released?

Sure. I'll do it this evening.

commented

But uncss is still used in lib/modules/removeUnusedCss.es6? What is it I don't understand?
It's also listed in package.json and my build system is still complaining about uncss 0.17.3 depending on old, unmaintainted, unsupported, and explicitly deprecated package versions.

EDIT: Nevermind, I see how it works now. Thank you.