Skip to content
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

Gipp testcase and example page in RTK repo #514

Merged

Conversation

voinik
Copy link
Contributor

@voinik voinik commented Dec 16, 2022

  • I've added a new page to the RTK repo that uses GIPP (GIP at page level)
  • I've added GIP to the _app as well, so now all pages use GIP at _app, and GSP, GSSP and GIP
  • I've added testcases for this new page
  • I've added testcases for App.GIP and Page.GIP in the wrapper

This should show that all combinations we test work properly.

Sidenote: It's very important (and this took me quite a while) to properly write the App.GIP if you're using Page.GIP (which you shouldn't). You must import App from next/app, and you must await App.getInitialProps, and merge its data into your return in your own App.getInitialProps. And you must do your dispatches before you do that await.

@kirill-konshin kirill-konshin merged commit be6e4a1 into kirill-konshin:async-hydration-fix-proper Dec 28, 2022
kirill-konshin added a commit that referenced this pull request Dec 28, 2022
* Use useMemo for hydration and avoid unnecessary hydrates (#502)

* Upgrade packages and refactor a bit
* Added necessary testing dependency
* Stop hydrating on server and use useLayoutEffect for client hydration
* Added pokemon page with rtk's createApi
* Added back dispatch in GSP in demo repo
* A change in query params constitutes a new page now
* Improve performance by using another hook on server
* Add detail page
* New approach: split gsp and gssp and hydrate based on those
* Added a second type of initial state handling with more explanations
* Improved useMemo comment
* Make sure hydrates work when staying on the same page
* Add links to demo repo to test issue (seems like no issue)
* Proper gipp fix (#512)
* ESLint fix
* Gipp testcase and example page in RTK repo (#514)
* Add GIP to _app and add GIP in page to RTK repo
* Added e2e test for RTK repo
* Added testcase for GIAP and GIPP to wrapper
* Consistent casing and formatting in comments

Fix #493 #495 #496

Co-authored-by: voinik <[email protected]>
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.

2 participants