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

Provide way to opt out of attributes on SSR'd <head> elements used for hydration #4258

Closed
Conduitry opened this issue Jan 14, 2020 · 1 comment · Fixed by #4260
Closed

Provide way to opt out of attributes on SSR'd <head> elements used for hydration #4258

Conduitry opened this issue Jan 14, 2020 · 1 comment · Fixed by #4260
Labels
awaiting submitter needs a reproduction, or clarification

Comments

@Conduitry
Copy link
Member

Is your feature request related to a problem? Please describe.
#4082 was a good solution for fixing <head> hydration, but unfortunately it adds unneeded attributes if one is using Svelte solely as a static site templating engine.

Describe the solution you'd like
I'm not sure. Maybe we only add the attributes if the user has specified generate: 'ssr' and hydratable: true? (Would this be considered a breaking change? Maybe technically?) As far as I know, hydratable: true has no effect currently when compiling in SSR mode. To make Sapper also take advantage of this would involving updating the template so that the SSR compilation is also called with hydratable: true.

Describe alternatives you've considered
Doing nothing and living with these would certainly work. Some sort of post-processing of the generated HTML would also work, but would be hacky.

How important is this feature to you?
Eh, it would be nice. I would imagine that purely static HTML generation (with no hydration) represents a small fraction of Svelte's usage.

Additional context
Not much. My personal websites, which use Svelte as a static site generator, now have unnecessary attributes on their head elements.

@Conduitry Conduitry added awaiting submitter needs a reproduction, or clarification proposal labels Jan 14, 2020
@tanhauhau
Copy link
Member

Only add attribute when ssr:true and hydratable:true sounds great. Anyway before #4082 hydration in head tags doesn't work anyway.
Let's make this as a necessary upgrade step, to make hydrating head tags work 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants