Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAP5-2708/2753: CssCompressor updates and CSS variable fixes #40

Closed
wants to merge 8 commits into from

Conversation

benweidig
Copy link
Contributor

I've updated the CssCompressor with the latest commit yui/yuicompressor@cf0497e and moved all CSS related tests and create a Spec.

The YUI Compressor is dead, and not in a nice state...
To make it work I had to fix some compile and runtime issues:

  • Duplicate variable declaration of "oldCss"
  • Faulty non-escaped regex
  • zeros.css test failed

I'm not 100% sure the CssCompressor behaves 100% as before, but it's a necessary trade-off so it can be improved further.
We had multiple issues with it before, and I looked for possible replacements, but only found quite large dependencies compared to the single Java file right now.

The next steps would be going over the issues of YUI Compressor, create test files, and adapt our code accordingly.
After that, I may want to improve it by cleaning it up and pre-compiling Regexes, etc.
Also, an easier way to disable compression for single files would be nice.

…iginal tests

The CssCompressor in tapestry-webresources is now based on the latest YUI commit cf0497e.
To make it work some errors had to be fixed:
- Duplicate variable declaration of "oldCss"
- Faulty non-escaped regex
- zeros.css test failed

I'm not 100% sure the CssCompressor behaves 100% as before, but it's a necessary trade-off so it can be improved further, as the original YUI project is dead.
@benweidig benweidig requested review from thiagohp and vjlamp May 18, 2023 11:22
benweidig and others added 6 commits May 20, 2023 14:02
* compress now static instead of instance-bound
* compress accepts String and InputStream
* bootstrap.css added to Spec for better integrity
* StringBuffer -> StringBuilder
* Generic types added
benweidig added a commit that referenced this pull request Jun 23, 2023
The CssCompressor in tapestry-webresources is now based on the latest YUI commit cf0497e.

To make the original code work it needed some error fixing:
- Duplicate variable declaration of "oldCss"
- Faulty non-escaped regex
- zeros.css test failed

I'm not 100% sure the CssCompressor behaves 100% as before, but it's a necessary trade-off so it can be improved further, as the original YUI project is dead.
All the pre-existing tests from YUI are now run directly in Tapestry, and we can add our own tests easily.

Furthermore, the code was cleaned up with pre-compiled Patterns, and no longer converting between Strings/Readers/Writers.

Co-authored-by: Volker Lamp <vlamp@apache.org>
@benweidig
Copy link
Contributor Author

The PR was merged manually.

@benweidig benweidig closed this Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants