-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat(core): allow opting out of HTML minification #7581
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
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.
When we were discussing over Discord, I'm not really sure whether we want a simple env var that toggles minification on/off, or a full config option. I'm strongly leaning towards the former because it isn't that well-used at all and making that many options for it seems like an overkill. Remember that we try to minimize the API surface as much as possible.
That's my strong opinion, not sure about @slorber's, but I think we definitely need to use env vars instead, maybe even 6 env vars, but never a config option.
I get that you're trying to keep the API surface as simple as possible, but a single "on" or "off" switch that enables or disables the optimization / minification of everything (html, css and js) is just not useful. There is a bug (that I described in the PR) that happens when a particular optimization is performed. That doesn't mean that I want absolutely every optimization disabled. Plus, the API surface is still simple, the entire |
No, only a single env var that toggles HTML minification. CSS and JS minification is controlled by another argument ( |
Oh, I see. Okey! Should I use a single env var in order to skip the entire
|
I'm fine with either, but not sure about @slorber's preference. Let's use a single env var first to skip the entire |
@Josh-Cena I just force-pushed the new changes, 🙏👀 |
I'm fine with env vars with very explicit names used as escape hatches here and there 👍 To me, those things do not even have to be documented at all, as most users don't need it anyway, and not documenting it is also an opportunity for us to collect feedback on how it is or will be used. If it becomes useful to a lot of users and we have enough feedback, we can move it to a first-class option. |
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.
LGTM—@slorber wants to remove the documentation, so I'll see if he absolutely want that change before merge.
that should be fine thanks 👍 |
Pre-flight checklist
Motivation
The current build process is "optimizing" the HTML in a way that breaks bootstrap. More specifically, it removes some "worthless" attributes (such as
type="text"
frominput
fields), which breaks Bootstrap's[type="text"]
selectors (probably selectors of other css frameworks aswell).This change will allow users to specify the exact options that they want to be passed to the minifier. It won't introduce any breaking changes since it's merging the existing opts with any user-provided opts.
Test Plan
N/A
Test links
Related issues/PRs
N/A