readium / readium-css

🌈 A set of reference stylesheets for EPUB Reading Systems, starting with Readium Mobile
https://readium.org/readium-css/
BSD 3-Clause "New" or "Revised" License
89 stars 20 forks source link

Dist stylesheets and minification #132

Open JayPanoz opened 3 months ago

JayPanoz commented 3 months ago

I'm submitting a topic for discussion.

Short description of the issue/suggestion:

When upgrading dev dependencies locally, I had to replace the PostCSS plugin for minification, postcss-clean, as it basically broke and errored the build process.

It wasn’t hard to find another one but, given times have changed and we’re now seeing people advise to even distribute sourcemaps so that it can be easier to debug, I’m wondering whether we should even minify the dist stylesheets in the first place and just let users do it on their own if they see it necessary.

danielweck commented 3 months ago

my take: let consumers of ReadiumCSS do it themselves. Nowadays I would use LightningCSS anyway, not PostCSS

https://github.com/parcel-bundler/lightningcss

mickael-menu commented 3 months ago

I don't have an opinion on this. We rarely need to debug CSS in the mobile toolkits but minifying it is probably not critical in a local context.

It might be more useful for the Web toolkit? (cc @chocolatkey).

chocolatkey commented 3 months ago

I agree with @danielweck - users of this project should take care of the minfication themselves. We shouldn't burden ourselves with being responsible for this, as there are two many possibilities to take into account. Would we include a sourcemap in the minified bundle? What format would the sourcemap be (inline, external, if external, what name)? In the case of the ts-toolkit, the minification is done by whatever bundler is used in the implementer's project, and it works out fine. @mickael-menu you're right that for local context, minifying doesn't makes sense in terms of file size, but there is the potential for reduction in parsing time to consider.

The bundles should definitely still be made in my opinion, they are very helpful.

mickael-menu commented 3 months ago

The bundles should definitely still be made in my opinion, they are very helpful.

Yep, I agree.