-
Notifications
You must be signed in to change notification settings - Fork 528
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
feat(react-instantsearch-ssr-nextjs
): turn Next.js RSC/SSR solution into its own package
#5830
Conversation
f779bd2
to
1dcd81c
Compare
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 f779bd2:
|
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 d5de2eb:
|
1eee332
to
2642653
Compare
"react-instantsearch-router-nextjs": "7.0.1", | ||
"react-instantsearch-ssr-nextjs": "7.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think we could have instead one package react-instantsearch-nextjs
that has both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The router only works for pages
while the other only works for app
though 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it's experimental I'd keep it as a separate package. But I dig the idea of having a single package for nextjs specific things in the future.
e32d4b6
to
594d759
Compare
664bc7d
to
2fbad76
Compare
packages/react-instantsearch-ssr-nextjs/src/NextInstantSearchSSR.tsx
Outdated
Show resolved
Hide resolved
2a74838
into
feat/experimental-rsc-and-next-app-dir-support
…d Next.js app directory (#5827) * feat(rsc): very experimental working PoC for Next.js app dir * feat(`react-instantsearch-ssr-nextjs`): turn Next.js RSC/SSR solution into its own package (#5830) * chore: create `react-instantsearch-ssr-nextjs` package * chore: move Next.js RSC/SSR utilities to dedicated package * docs: update Next App Router example with new package * refactor: split context and usage Hook * feat: pass `ServerInsertedHTMLContext` ourselves * refactor: clean up importqs * style: lint * docs: build example in CodeSandbox * ci: use Next.js 13 compatible Node version * ci: use compatible Node version * test: add version test files * upgrade next version in all examples * chore: remove unnecessary exports * chore: remove weirdo character * build: resolve Next for ESM * refactor: move as much logic in new package as possible + dynamicWidgets support * routing --------- Co-authored-by: Dhaya <154633+dhayab@users.noreply.github.com> Co-authored-by: Aymeric Giraudet <aymeric.giraudet@algolia.com> * fix other next examples * update deps in new package * fix build/tests? * bundlesize * React import in app-dir example * feat(RSC): add warnings (#5840) * bump node version a bit * avoid double results injection * fix: routing when going from one InstantSearch page to another Co-authored-by: Burak Tamtürk <buraktamturk@gmail.com> * fix tests * changed naming * fix build * forgot to rename dir * fix multi index * revert to renderToString * remove doctoc line * readme * changed use * update peerDep * Apply suggestions from code review Co-authored-by: Dhaya <154633+dhayab@users.noreply.github.com> --------- Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com> Co-authored-by: Dhaya <154633+dhayab@users.noreply.github.com> Co-authored-by: Burak Tamtürk <buraktamturk@gmail.com>
This PR builds upon Aymeric's work and extracts the wrapper in its own package, to leave the minimal amount of code in react-instantsearch-core.
Some notes that will probably need to be adressed during real implementation:
historyRouter()
and conditionally returning a composited URL using Next.js Hooks. It might be interesting to provide a friendlier interface for building this URL