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

feat: make preserveComments effective in DOM renderer #7182

Merged
merged 2 commits into from
Mar 27, 2023
Merged

feat: make preserveComments effective in DOM renderer #7182

merged 2 commits into from
Mar 27, 2023

Conversation

esthedebeste
Copy link
Contributor

@esthedebeste esthedebeste commented Jan 24, 2022

When the option preserveComments is given in a DOM render context, it'll add Comment nodes.

Also added tests.

Tests

  • Run the tests with npm test and lint the project with npm run lint

Multiple comments are separated by --><!--, so prefix matching isn't required.
@dummdidumm
Copy link
Member

If we add this, it probably should be through enhancing the option to make it backwards compatible - e.g. an enum like "ssr" | "dom" | "both"

@benmccann benmccann changed the title [feat] Make preserveComments effective in DOM renderer feat: make preserveComments effective in DOM renderer Mar 14, 2023
@Rich-Harris
Copy link
Member

I think an enum would probably be weird, given that you're providing this option alongside generate: 'dom' | 'ssr'. We should either merge this on the basis that it's not really a breaking change (no user-observable behaviour would change, it would just enable whatever use case motivated this change in the first place), or include it in v4

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point regarding the enum - I'll merge this then

@dummdidumm dummdidumm merged commit 95c4655 into sveltejs:master Mar 27, 2023
@Conduitry
Copy link
Member

This has been released in 3.58.0 - thank you!

@esthedebeste esthedebeste deleted the dom-comments branch March 31, 2023 11:23
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

Successfully merging this pull request may close these issues.

None yet

4 participants