Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Write a config minifier #23

Closed bob2517 closed 9 months ago

bob2517 commented 4 years ago

There isn't a minifier for Active CSS config yet, so this needs writing.

bob2517 commented 3 years ago

If anyone want to have a crack at this then go for it. This is one of the few issues that people can do without knowing about the core internals.

Test config would be the full one from the activecss.org website which should cover a lot of scenarios: https://activecss.org/activecss-config/all-config.txt

You need to understand how the config works though. It doesn't parse with a CSS minifier. It's got the target selector, which is a new concept. And there's loads of other differences too, like inline JS and inline HTML.

It's mainly just removing the unnecessary whitespace. That would be a start and enough to release it as a minifier. Use whatever best practices make you feel warm and fuzzy.

Let me know if you are doing it and I'll assign you to the issue. It will need to get a separate npm package so it integrates with Node and I'll put up links to your repo on the docs website and on the readme of this repo. You'll also be on the credit page of the main website if it does the job :)

Do it how you want but please do a grunt minifier or some sort of command line tool so I can use it on my stuff :)

If anyone has a question on config rules, regex madness or anything, let me know via this issue or directly via support from the docs website.

bob2517 commented 3 years ago

This isn't a good first issue, unless the person is familiar with Active CSS. Removing tag.

bob2517 commented 3 years ago

Gonna do this for 2.5.0 myself as a grunt plugin. Not done a grunt plugin before - should be fun.

bob2517 commented 3 years ago

Starting this now. Need it for the offline docs site to keep the ACSS file size small. Everything's going into one file so the browsing experience can stay awesome.

bob2517 commented 3 years ago

Not going to bother using source maps - no point at the moment as it won't be compatible with any viewer anyway. May as well get the extension done first, which displays unminified config file lines. The core already records line numbers for use in the extension anyway. Later on work out a sourcemap handling if and when the need arises.

bob2517 commented 3 years ago

The starting grunt plugin template is in place with working tests. Will be back on it at the weekend to wrap up the minifier. It's not going to do much.

bob2517 commented 3 years ago

Don't technically need this now as I need a PHP minifier, not a grunt one. So pending work on this until later on. More than happy to revisit this though if anyone needs it urgently.

bob2517 commented 9 months ago

Closing this for now as it hasn't come up as a necessity.