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

fix(code-block): only render HiddenCopyContent after hydration #834

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

brkalow
Copy link
Contributor

@brkalow brkalow commented Nov 30, 2022

🎟️ Asana Task
πŸ” Preview Link


Description

Adjust HiddenCopyContent to only render after hydration as occurred. This helps avoid some tricky hydration issues, and also avoids duplicative markup being shipped from the server. As the element is only used by the copy-to-clipboard interaction, it's safe to defer rendering.

PR Checklist πŸš€

Items in this checklist may not may not apply to your PR, but please consider each item carefully.

  • Add Asana and Preview links above.
  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Conduct reasonable cross browser testing for both compatibility and responsive behavior (We have a Sauce Labs account for this, if you don't have access, just ask!).
  • Conduct reasonable accessibility review (use the WAS as a guide or an axe browser plugin until we establish more formal checks).
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

Sorry, something went wrong.

@brkalow brkalow requested review from a team November 30, 2022 17:31
@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2022

πŸ¦‹ Changeset detected

Latest commit: bb47840

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/react-code-block Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Nov 30, 2022

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
react-components βœ… Ready (Inspect) Visit Preview Nov 30, 2022 at 5:31PM (UTC)

@brkalow brkalow added the release:canary Triggers a canary release for commits to this pull request label Nov 30, 2022
@github-actions
Copy link
Contributor

πŸ“¦ Canary Packages Published

Latest commit: bb47840

Published 1 packages

@hashicorp/react-code-block@6.2.2-canary-20221130173256

npm install @hashicorp/react-code-block@canary

Copy link
Contributor

@thiskevinwang thiskevinwang left a comment β€’

Choose a reason for hiding this comment

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

Side: i wonder if a helper-wrapper β€” something like Next's dynamic( ..., { ssr: false}) β€” would be a useful utility for this Client-only guard

@brkalow brkalow merged commit 3d138a8 into main Nov 30, 2022
@brkalow brkalow deleted the brk.fix/code-block-hidden-copy-content branch November 30, 2022 19:17
@hashibot-web hashibot-web mentioned this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:canary Triggers a canary release for commits to this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants