-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add admin menu browser persistence (via schema) #45957
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Async-loaded Components (~137 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
aac7f52
to
d7cf000
Compare
This works properly in my testing. I noticed something strange, but I think it's a limitation of firefox more than anything. In the firefox devtools, if you check the value of the redux-state-1234:adminMenu key, you'll only see the first 10,000 characters of the information. The rest is truncated. Additionally, the "parsed value" shows only a string, because the json is truncated and can't be parsed. However, the feature continues to work correctly, and the indexedDb info looks fine in chrome, so I suspect it's only a visual issue with Firefox's dev tools. |
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.
works as expected! Huge UX improvement! Thanks
I re-ran some failing tests |
253741d
to
e1bab97
Compare
e1bab97
to
c3b589c
Compare
This PR addresses #45876 by adding the required schema and HO reducer to enable browser persistence for
menus
portion of theadminMenu
state slice.This ensures that once the initial API response is cached in the browser IndexDB there is no (less of a) perceivable lag between Calypso UI "load" and the admin menu being "ready" and "available".
Note: this will require that #45939 is merged before we can merge this PR.Now merged 🥳Changes proposed in this Pull Request
schema.json
for themenus
portion of theadminMenu
state.menus
portion of theadminMenu
state with the schema validation reducer to enable browser peristence of state.Testing instructions
nav-unification
to test site.yarn && ENTRY_LIMIT=entry-main SECTION_LIMIT=home yarn start
Application
tab. Look forStorage
in the left hand sidebar. Expand theIndexDB
accordion. Find thecalypso_store
DB entry. Look forthe adminMenu
slice of state persisted in the DB. Make sure it matches what is stored in state (trystate.adminMenu
in theConsole
tab).Fixes #45876