Skip to content

Commit

Permalink
fix: exclude SSRProvider from build (#1174)
Browse files Browse the repository at this point in the history
## 📝 Changes

- Remove `@react-aria/ssr` from being embedded in the build to allow for
apps to have a singleton instance of `SSRProvider`. Addresses `When
server rendering, you must wrap your application in an <SSRProvider> to
ensure consistent ids are generated between the client and server.`
warnings.

## ✅ Checklist

- [x] Visuals are complete and match Figma
- [x] Code is complete and in accordance with our style guide
- [x] Design and theme tokens are audited for any relevant changes
- [x] Unit tests are written and passing
- [x] TSDoc is written or updated for any component API surface area
- [x] Stories in Storybook accompany any relevant component changes
- [x] Ensure no accessibility violations are reported in Storybook
- [x] Specs and documentation are up-to-date
- [x] Cross-browser check is performed (Chrome, Safari, Firefox)
- [x] Changeset is added
  • Loading branch information
stephenjwatkins authored May 8, 2024
1 parent 005c6fb commit 45cfcef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-singers-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@easypost/easy-ui": patch
---

fix: exclude SSRProvider from build
4 changes: 4 additions & 0 deletions easy-ui-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ ReactDOM.render(
);
```

### Server Rendering

When server rendering an app that uses Easy UI and React <18, your app must be wrapped with a single instance of React Aria's `SSRProvider`. If an app is using an additional version of React Aria, ensure there's only one version of `@react-aria/ssr` using NPM's `overrides` or Yarn's `resolutions` property.

## Development

We use Storybook to create a simple, hot-reloading playground for development on these components.
Expand Down
2 changes: 1 addition & 1 deletion easy-ui-react/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default defineConfig({
]),
},
rollupOptions: {
external: ["react", "react-dom"],
external: ["react", "react-dom", "@react-aria/ssr"],
output: [
{
format: "cjs",
Expand Down

0 comments on commit 45cfcef

Please sign in to comment.