HomePhabricator
Diffusion Comm 227c0f38d084

[web] Use new intial redux state

Description

[web] Use new intial redux state

Summary:
ENG-4752
Depends on D9140

Use the new action during app load.

Performance note:

  1. When user loads a new version of the app, it should be slightly slower because now they need to do two requests instead of one
  2. If the js is already cached it should be more or less the same

But these changes allow us to do an optimization for case (1) -> we could first download just enough to start rehydration and fetching of the initial redux state, and do it concurrently to the fetching the rest of js. I'm going to create a task for this later because it would require more changes.

Test Plan:
Load the web app (logged in), check the redux actions:

  1. @@INIT
  2. persist/PERSIST -> added the _persist field, with rehydrated: false
  3. persist/REHYDRATE -> updated the persisted fields + set rehydrated
  4. SET_NEW_SESSION (it's part of the useServerCall so it runs first) -> updated sessionID
  5. SET_INITIAL_REDUX_STATE -> diff view shows only timestamps updated + initialStateLoaded = true

Also tested reloading when not logged in and the app worked.

Reviewers: kamil, inka, atul

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9141

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Sep 5 2023, 6:35 AM
Reviewer
kamil
Differential Revision
D9141: [web] Use new intial redux state
Parents
rCOMM99b1b9cd5ba1: [web] Add setInitialReduxState action
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMM227c0f38d084: [web] Use new intial redux state (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Sep 20 2023, 2:26 AM