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

feat: getInitialState #2277

Merged
merged 15 commits into from
Jan 20, 2024
Merged

feat: getInitialState #2277

merged 15 commits into from
Jan 20, 2024

Commits on Dec 29, 2023

  1. feat(react): implement getServerState by closing over the defaultState

    serverState will be used by react on the first client render; this should avoid hydration mismatches when combined with the persist middleware, which can change the state between the SSR and the first CSR
    TkDodo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    1aef460 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1ddd6fc View commit details
    Browse the repository at this point in the history
  3. feat: implement getServerResult in persist middleware

    this avoids hydration errors when state is restored from e.g. localstorage synchronously
    TkDodo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    6d046fe View commit details
    Browse the repository at this point in the history
  4. feat: capture initialState for getServerState in react

    this avoids hydration mismatches when updates happen to the store state between ssr and csr
    TkDodo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    2d868c6 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. Configuration menu
    Copy the full SHA
    9c7b13e View commit details
    Browse the repository at this point in the history
  2. fix: make selector default to identity function

    if we default to `api.getState`, we will always read the client snapshot if there is no selector passed. An identity function returns its argument, which is either the snapshot (api.getState) or the server snapshot (api.getServerState)
    TkDodo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    a985abe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9758153 View commit details
    Browse the repository at this point in the history
  4. revert WithReact

    dai-shi committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    44c5f4c View commit details
    Browse the repository at this point in the history
  5. fix them

    dai-shi committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    de85649 View commit details
    Browse the repository at this point in the history
  6. fix test

    dai-shi committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    a383a81 View commit details
    Browse the repository at this point in the history
  7. oops, fix another test too

    dai-shi committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    92c4781 View commit details
    Browse the repository at this point in the history
  8. forgot to use identity

    dai-shi committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    7af7553 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. Configuration menu
    Copy the full SHA
    3523cf3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28c4527 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2024

  1. Configuration menu
    Copy the full SHA
    5aaf3a8 View commit details
    Browse the repository at this point in the history