Skip to content

feat: exclude Feedback component from SSR #172

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 2 commits into from
Oct 31, 2023

Conversation

fvsch
Copy link
Contributor

@fvsch fvsch commented Oct 30, 2023

PR Description

This PR wraps the Feedback component, which relies on client-side UI and JS to save user feedback, within VitePress's ClientOnly component.

This avoids generating the base HTML structure of this component in the VitePress build, and showing buttons that don't work when JavaScript is not loaded. It might also be a tiny SEO improvement, though it’s probably trivial.

Self-check

Please check all that apply:

  • My code follows the style guidelines of this project
  • I have reviewed my code or content update and edited it to the best of my abilities
  • I have commented my code, particularly in hard-to-understand areas; my comments are concise

Contributors list

Would you like your contribution to be celebrated? Please check all that apply:

  • I would like to be featured on the future contributors list in the README. If so, please tell us:

    • what name you'd like to be shown there?
    • we usually link GitHub profile pic -- is that ok? If not, provide another url:
    • we usually link your GitHub profile but if you have a portfolio page, provide a link:
  • I would like to get a shoutout in the next monthly updates post. If so, please provide your twitter handle (or we will link to your GitHub profile).

⚡️ ⚡️ ⚡️ Thank you for contributing to StackBlitz ⚡️ ⚡️ ⚡️

@stackblitz-staging
Copy link

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

@bolt-new-by-stackblitz
Copy link

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

@netlify
Copy link

netlify bot commented Oct 30, 2023

Deploy Preview for stackblitz-docs ready!

Name Link
🔨 Latest commit 0364cf9
🔍 Latest deploy log https://app.netlify.com/sites/stackblitz-docs/deploys/6540df8e7dab770008149b66
😎 Deploy Preview https://deploy-preview-172--stackblitz-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +10 to +12
<ClientOnly>
<Feedback />
</ClientOnly>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that the <ClientOnly> component is globally registered and does not need to be imported. (It's not exported from 'vitepress' either.) Seems to work in my tests. I wish the VitePress docs were clearer about that.

@fvsch fvsch requested review from sulco and ykmsd October 31, 2023 10:51
@ykmsd ykmsd merged commit 2328a79 into main Oct 31, 2023
@ykmsd ykmsd deleted the fvsch/feedback-component-client-only branch October 31, 2023 11:08
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.

2 participants