From 96ae3935195fbf4e27b5e37eec3749ea70099d68 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 4 Mar 2024 12:43:30 -0600 Subject: [PATCH 1/2] chore(deps): remove @react-aria/ssr package --- package-lock.json | 7 +++---- packages/react/package.json | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cfe9ee9b7bb..1a29a702801 100644 --- a/package-lock.json +++ b/package-lock.json @@ -448,7 +448,7 @@ "examples/app-router": { "name": "example-app-router", "dependencies": { - "@primer/react": "36.9.0", + "@primer/react": "36.10.0", "next": "^14.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -530,7 +530,7 @@ "version": "0.0.0", "dependencies": { "@primer/octicons-react": "^18.2.0", - "@primer/react": "36.9.0", + "@primer/react": "36.10.0", "next": "^14.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -60327,7 +60327,7 @@ }, "packages/react": { "name": "@primer/react", - "version": "36.9.0", + "version": "36.10.0", "license": "MIT", "dependencies": { "@github/combobox-nav": "^2.1.5", @@ -60339,7 +60339,6 @@ "@primer/behaviors": "^1.5.1", "@primer/octicons-react": "^19.8.0", "@primer/primitives": "7.15.3", - "@react-aria/ssr": "^3.5.0", "@styled-system/css": "^5.1.5", "@styled-system/props": "^5.1.5", "@styled-system/theme-get": "^5.1.2", diff --git a/packages/react/package.json b/packages/react/package.json index a5545f48eb1..5e6ac4d5247 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -92,7 +92,6 @@ "@primer/behaviors": "^1.5.1", "@primer/octicons-react": "^19.8.0", "@primer/primitives": "7.15.3", - "@react-aria/ssr": "^3.5.0", "@styled-system/css": "^5.1.5", "@styled-system/props": "^5.1.5", "@styled-system/theme-get": "^5.1.2", From b77530e931ff8b8593f185ee0db8f137e696c984 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 4 Mar 2024 12:47:29 -0600 Subject: [PATCH 2/2] docs: remove ssr docs --- docs/content/ssr.mdx | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 docs/content/ssr.mdx diff --git a/docs/content/ssr.mdx b/docs/content/ssr.mdx deleted file mode 100644 index f799aa033fc..00000000000 --- a/docs/content/ssr.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Server-side rendering with Primer React ---- - -## SSR-safe ID generation - -Some Primer components generate their own DOM IDs. Those IDs must be isomorphic (so that server-side rendering and client-side rendering yield the same ID, avoiding hydration issues) and unique across the DOM. We use [@react-aria/ssr](https://react-spectrum.adobe.com/react-aria/ssr.html) to generate those IDs. In client-only rendering, this doesn't require any additional work. In SSR contexts, you must wrap your application with at least one `SSRProvider`: - -``` -import {SSRProvider} from '@primer/react'; - -function App() { - return ( - - - - ) -} -``` - -`SSRProvider` maintains the context necessary to ensure IDs are consistent. In cases where some parts of the react tree are rendered asynchronously, you should wrap an additional `SSRProvider` around the conditionally rendered elements: - -``` -function MyApplication() { - const [dataA] = useAsyncData('a'); - const [dataB] = useAsyncData('b'); - - return ( - <> - - {dataA && } - - - {dataB && } - - - ) -} -``` - -This will ensure that the IDs are consistent for any sequencing of `dataA` and `dataB` being resolved. - -See also [React Aria's server side rendering documentation](https://react-spectrum.adobe.com/react-aria/ssr.html).