Skip to content

perf(nuxt)!: return island earlier in renderer #27889

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

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Conversation

huang-julien
Copy link
Member

🔗 Linked issue

📚 Description

Hey 👋 This PR makes island returned earlier in the nitro renderer. render:html won't be called anymore for islands as we have render:island hook

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@huang-julien huang-julien marked this pull request as draft June 28, 2024 09:34
@huang-julien huang-julien marked this pull request as ready for review June 28, 2024 09:39
@huang-julien huang-julien changed the title perf(nuxt): return island earlier in renderer perf(nuxt)!: return island earlier in renderer Jun 30, 2024
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

As a positive, what kind of performance difference does this make?

The potential negative is that if users rely on a render:html hook, things might stop working. For example, I guess this will now bypass html validator - or other modules which aim to manipulate rendered HTML.

A potential solution might be a 'lite' call to render:html, but missing all the irrelevant things we won't use in rendering the island, like bodyAttrs, etc.

@huang-julien
Copy link
Member Author

Yes this is intended. render:html feels more adequate to only hook for pages while render:island hook for islands.

As an example, html validator would validate twice the island in SSR.
There's also @nuxt/devtools that adds some additionnal scripts we don't want to be duplicated (by the page and the island). This is currently not going client-side but with a future PR for head manipulation with islands, we need to isolate a maximum islands to avoid having duplicated tags injected into the DOM

@danielroe danielroe merged commit 5ac6aa5 into main Jul 1, 2024
39 checks passed
@danielroe danielroe deleted the perf/island_early branch July 1, 2024 09:12
@github-actions github-actions bot mentioned this pull request Jul 1, 2024
Kamsou pushed a commit to Kamsou/nuxt that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants