Skip to content

Conversation

@joshblack
Copy link
Member

Background for these changes: https://github.com/github/primer/issues/1715#issuecomment-1830411602

Update SSRProvider, useSSRSafeId to use the native React 18 useId() instead of @react-aria/ssr

Changelog

New

Changed

  • Update SSRProvider to noop
  • Update useSSRSafeId to use our internal useId
  • Update useId to use the native React.useId() hook
  • Update snapshots to use new useId generation

Removed

  • Remove @react-aria/ssr from the project

Rollout strategy

  • Minor release

Hopefully this can be contained in a minor release as the changes should all be compatible 🤞 This PR does end up removing support for @react-aria/ssr and replaces it but we could also keep the dependency in the project and remove it later if it ends up being problematic. This work should definitely be tested out in dotcom to see what the impact is.

Testing & Reviewing

  • Would appreciate a look at the type signatures for the changed exports to make sure they are equivalent
  • Verify that id generation still works as expected in components which use this hook
  • Double-check the rollout plan to see if I missed anything 👀

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: d10aa5f

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.08 KB (-0.45% 🔽)
dist/browser.umd.js 104.61 KB (-0.46% 🔽)

@joshblack joshblack changed the title Refactor/remove react aria ssr refactor(useId): update useId to use native useId, update ssr utils Nov 28, 2023
@joshblack joshblack changed the title refactor(useId): update useId to use native useId, update ssr utils refactor(useId): update useId to use React.useId, update ssr utils Nov 28, 2023
@joshblack joshblack marked this pull request as ready for review November 28, 2023 18:31
@joshblack joshblack requested review from a team and broccolinisoup November 28, 2023 18:31
Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

TL;DR

Looks beautiful! ✨

Would appreciate a look at the type signatures for the changed exports to make sure they are equivalent

All makes sense to me ✅

Verify that id generation still works as expected in components which use this hook

Checked the Tooltip and UnderlineNav, both are golden ⭐

Double-check the rollout plan to see if I missed anything 👀

Based on https://github.com/github/primer/issues/1715#issuecomment-1830411602, I just wanted to say that I LOVE the migration plan. Great example of how to gradually move from A to B and from B to C 😊

One question about the deprecating the SSRProvider and the useSSRSafeId , should we do it in this PR or a follow up PR is better? Curious to hear your thoughts.

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Very nice!

@joshblack joshblack added this pull request to the merge queue Dec 4, 2023
Merged via the queue into main with commit 968d4ef Dec 4, 2023
@joshblack joshblack deleted the refactor/remove-react-aria-ssr branch December 4, 2023 18:50
@primer primer bot mentioned this pull request Dec 4, 2023
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.

4 participants