Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

logotip4ik
Copy link
Contributor

@logotip4ik logotip4ik commented Jan 3, 2024

๐Ÿ”— Linked issue

#24866

โ“ Type of change

  • ๐Ÿ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • โœจ New feature (a non-breaking change that adds functionality)
  • ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

resolves #24866

๐Ÿ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

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

Copy link
Contributor

nuxt-studio bot commented Jan 3, 2024

โœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio โ†—๏ธŽ View Live Preview 821a9c8

@github-actions github-actions bot added the 3.x label Jan 3, 2024
@logotip4ik logotip4ik marked this pull request as draft January 3, 2024 20:29
@logotip4ik logotip4ik marked this pull request as ready for review January 3, 2024 22:31
@huang-julien huang-julien self-requested a review January 4, 2024 09:14
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.

Whoa - thank you! โค๏ธ

I wonder if we can implement this at build-time to avoid even including these pages in the server bundle (at the moment, they will be).

So, when we scan pages here:

route.component = genDynamicImport(file, { interopDefault: true })

we could instead use a virtual file that is handled by a build plugin. That build plugin would generate code that wraps the pages with createClientOnly.

I'm suggesting this because I think it will pair better with the implementation of server pages, which can be done in the same way (cc: @huang-julien)

@logotip4ik logotip4ik marked this pull request as draft January 4, 2024 16:34
@logotip4ik
Copy link
Contributor Author

logotip4ik commented Jan 4, 2024

@danielroe Implemented something like what you said. But it has one issue, when wrapped in Transition it will log that: "component inside Transition is rendering non root component". That's why later i moved _wrapIf from user page component to transition.

wdyt about build file that reexports ClientOnly component or plain function and moving _wrapIf back to Transition ?

@danielroe
Copy link
Member

I think that would probably be a good solution ๐Ÿ‘Œ

@huang-julien huang-julien mentioned this pull request Feb 20, 2024
11 tasks
@logotip4ik logotip4ik marked this pull request as ready for review March 1, 2024 21:09
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.

Client-only page
4 participants