Closed Haroenv closed 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 8a21a6fbf2d376a894455845be8762ba2d30a13d:
Sandbox | Source |
---|---|
react-instantsearch-app | Configuration |
hooks-example | Configuration |
hooks-next-example | Issue #3633 |
Name | Link |
---|---|
Latest commit | 8a21a6fbf2d376a894455845be8762ba2d30a13d |
Latest deploy log | https://app.netlify.com/sites/react-instantsearch/deploys/63510a599181f20007de96c6 |
Deploy Preview | https://deploy-preview-3658--react-instantsearch.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Don't we want to be more cautious and have it in a param object?
await getServerState(<App/>, { renderToString });
Summary
There are some cases where the combination of trying to make sure renderToString doesn't end up in a browser bundle, being runnable on esm + cjs, react 17 and 18, .js extension etc. blows up.
One of those is pnpm/vercel removing "unused" packages.
Result
This PR introduces a new argument
renderToString
togetServerState
so you can inject the dependency yourself, meaning the import is within your own code and won't be purged.fixes #3633 closes #3618 see vercel/next.js#40067 FX-1869