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

Is normalizeAttributeValues a safe minification strategy? #241

Open
awerlang opened this issue Feb 13, 2023 · 2 comments
Open

Is normalizeAttributeValues a safe minification strategy? #241

awerlang opened this issue Feb 13, 2023 · 2 comments

Comments

@awerlang
Copy link

Since it cannot know future valid enumerated values for an attribute, and may not be practical even to keep it up-to-date, should it be deemed safe?
It has shown to break user code: parcel-bundler/parcel#8828

Ref: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete

@SukkaW
Copy link
Contributor

SukkaW commented Feb 13, 2023

Since it cannot know future valid enumerated values for an attribute, and may not be practical even to keep it up-to-date, should it be deemed safe?

Normalizing the value is essential for further modification. And if something is not up to date, you can always submit a PR to fix it.

@awerlang
Copy link
Author

I notice a PR to remove autocomplete from the module, that's one case.

I'm saying in general this feature can lead to observable change, wouldn't the max preset a better preset for it?

safe — a default preset for minifying a regular HTML in a safe way (without breaking anything)
ampSafe - same as safe preset but for AMP pages
max - maximal minification (might break some pages)

Moving it the the max preset still enables further minification, while keeping the safe preset honoring its description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants