[feat] Compiler option css: 'none' support#7890
[feat] Compiler option css: 'none' support#7890maxiruani wants to merge 0 commit intosveltejs:masterfrom
css: 'none' support#7890Conversation
benmccann
left a comment
There was a problem hiding this comment.
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. |
benmccann
left a comment
There was a problem hiding this comment.
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
|
|
||
| // discard styles when css is disabled | ||
| if (parser.css_mode === 'none') { | ||
| parser.read(/<\/style\s*>/); |
There was a problem hiding this comment.
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: falseorcss: trueend 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
cssoption #7270 rename compilercssoptionBefore submitting the PR, please make sure you do the following
[feat],[fix],[chore], or[docs].Tests
npm testand lint the project withnpm run lint