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] Compiler option css: 'none'
support
#7890
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.
I like this change. The true
/false
values have always been confusing to me and the performance enhancement will be nice as well
@benmccann I have changed the code based on your comments. Don't know why some CI task failed, it seems to be something "random". The previous CI test passed and nothing significant changed. |
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.
don't worry about the test failures. they're probably just flaky tests. I'll rerun the failing jobs and expect they'll pass
src/compiler/parse/read/style.ts
Outdated
@@ -16,6 +16,12 @@ export default function read_style(parser: Parser, start: number, attributes: No | |||
|
|||
const content_end = parser.index; | |||
|
|||
// discard styles when css is disabled | |||
if (parser.css_mode === 'none') { | |||
parser.read(/<\/style\s*>/); |
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.
Maybe put the regex in a const
so that the three (line 11 and 76) will never diverge?
@maxiruani it looks like there's a merge conflict in the docs now. Can you update against the latest |
@benmccann I made a rebase from master. Don't know why the diff tab shows changes that are already on master. Do you know how to avoid that? |
@maxiruani it looks like there's a couple things that may have gone wrong, but probably the biggest mistake was making the PR on the I would first recommend creating a new branch as a backup so that you have a copy of the code should anything else go wrong:
And then create a new branch to work on:
At this point there's a few things you can try. You could try rewinding the branch to remove the latest commits:
You're going to have to close this PR and open a new one on the new branch. I'd also recommend blasting away your
I'm on Discord under the same username. Feel free to ask in #contributing and hopefully we can help get you sorted |
Why?
I found that generating client side hydratable code with
css: false
orcss: true
end up processing styles entirely unnecessary.When hydrating SSR components, the styles are commonly already generated and there is no need to generate it again for the client side bundle.
This will speed up the build development process because it completely avoids processing it.
Details
'internal'
(formerlytrue
) and'external'
(formerlyfalse
) css option values. It still supports boolean values but it raises deprecated warning.'none'
css option.css: 'none'
option.References
css
option #7270 rename compilercss
optionBefore submitting the PR, please make sure you do the following
[feat]
,[fix]
,[chore]
, or[docs]
.Tests
npm test
and lint the project withnpm run lint