-
Notifications
You must be signed in to change notification settings - Fork 0
First version of minifier docs. #675
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
vale
docs/docs/configuration/minifier-plugin.md|471 col 5| [Google.Headings] 'Security Warnings' should use sentence-style capitalization.
docs/docs/configuration/minifier-plugin.md|478 col 1| [Google.Colons] ': T' should be in lowercase.
docs/docs/configuration/minifier-plugin.md|480 col 1| [Google.Colons] ': U' should be in lowercase.
docs/docs/configuration/minifier-plugin.md|482 col 4| [Google.Headings] 'Frequently Asked Questions' should use sentence-style capitalization.
docs/docs/configuration/minifier-plugin.md|486 col 174| [Google.Contractions] Use 'can't' instead of 'cannot'.
docs/docs/configuration/minifier-plugin.md|488 col 11| [Google.FirstPerson] Avoid first-person pronouns such as ' I '.
| title: Minifier Plugin | ||
| --- | ||
|
|
||
| # Minifier Plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Minifier Plugin' should use sentence-style capitalization.
| [INFO] Minification complete. Processed 2 file(s) in 335 ms | ||
| ``` | ||
|
|
||
| ## How It Works {#how-it-works} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'How It Works' should use sentence-style capitalization.
|
|
||
| For projects with more than 10 files, the plugin automatically processes assets in parallel to improve build performance. | ||
|
|
||
| ### Protocol Resolution {#protocol-resolution} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Protocol Resolution' should use sentence-style capitalization.
| URLs without a protocol (e.g., `css/app.css`) are treated as `static/` paths for minification purposes. The static directory can be configured using the `webforj.assetsDir` property. See [Configuration Properties](../configuration/properties) for more information. | ||
| ::: | ||
|
|
||
| ## Configuration Options {#configuration-options} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Configuration Options' should use sentence-style capitalization.
|
|
||
| ## Configuration Options {#configuration-options} | ||
|
|
||
| ### Disabling Minification {#disabling-minification} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Disabling Minification' should use sentence-style capitalization.
| **Common Causes:** | ||
|
|
||
| 1. **Annotation processor not configured** - Add `webforj-minify-foundation` to `annotationProcessorPaths` in `maven-compiler-plugin` | ||
| 2. **No annotations in source code** - Ensure you're using `@StyleSheet` or `@JavaScript` annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[webforJ.BeDirect] Avoid using 'Ensure you'. Focus more on explicitly giving details about the feature.
| 2. **No annotations in source code** - Ensure you're using `@StyleSheet` or `@JavaScript` annotations | ||
| 3. **Annotation processing disabled** - Remove `<proc>none</proc>` from compiler configuration if present | ||
|
|
||
| **Verification:** After compilation, check that `target/classes/META-INF/webforj-resources.json` exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Colons] ': A' should be in lowercase.
|
|
||
| **Verification:** After compilation, check that `target/classes/META-INF/webforj-resources.json` exists | ||
|
|
||
| ### Asset Files Not Found {#asset-files-not-found} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Asset Files Not Found' should use sentence-style capitalization.
| 2. Check that the URL protocol matches your directory structure: | ||
| - `ws://css/app.css` → `static/css/app.css` | ||
| - `context://css/app.css` → `css/app.css` | ||
| 3. Ensure the file isn't excluded by `.gitignore` or build filters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[webforJ.BeDirect] Avoid using 'Ensure the file'. Focus more on explicitly giving details about the feature.
| - `context://css/app.css` → `css/app.css` | ||
| 3. Ensure the file isn't excluded by `.gitignore` or build filters | ||
|
|
||
| ### Minification Syntax Errors {#minification-syntax-errors} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Headings] 'Minification Syntax Errors' should use sentence-style capitalization.
laurenic0l
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! The structure flows well and the troubleshooting section is really helpful. Just a few clarifications needed and it's good to go.
|
|
||
| The webforJ Minifier Plugin automatically optimizes CSS and JavaScript assets during the build process. The plugin discovers assets referenced through webforJ [asset annotations](../managing-resources/importing-assets) and minifies them in place, reducing file sizes and improving load times without manual intervention. | ||
|
|
||
| For more information about webforJ performance optimization strategies, see [Client/Server Interaction](../architecture/client-server). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cross-reference feels like a stretch here. Client/Server Interaction is about runtime performance (reducing round-trips between browser and server), while this article is about build-time optimization (making files smaller). They're both "performance" topics but in completely different ways.
Consider removing this reference, or rewording to make the connection clearer (e.g., "To understand how minification fits into webforJ's overall architecture...").
| - `@StyleSheet` | ||
| - `@JavaScript` | ||
| - `@InlineStyleSheet` | ||
| - `@InlineJavaScript` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@InlineStyleSheet and @InlineJavaScript contain inline content, not file references. Can the plugin actually minify inline strings embedded in Java code? If so, that's worth explaining. If not, these shouldn't be listed here since they don't reference external files.
No description provided.