-
Notifications
You must be signed in to change notification settings - Fork 361
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: Statically Cache Marketplace Apps #9732
feat: Statically Cache Marketplace Apps #9732
Conversation
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.
Thanks for the POC! I'll spend more time with it but I had a couple initial questions
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.
now I know why we get those at build time! speaking of, are we supposed to always commit updates when we seen them? for example, regions seems to be an exception cause it does not contain some regions we have been working with (Jakarta, Sao Paulo)?
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.
I'm not sure why regions.json
contains Jakarta and Sao Paulo. Maybe we manually added it so we could work on DC specific pricing easier? In my opinion, we shouldn't use really serve regions.json
from the MSW and we should just use factories instead.
We talked about .gitignore
ing these JSON files to prevent misuse like this of caching
}, | ||
{ '+order_by': 'ordinal' }, | ||
], | ||
}, |
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.
so this will work for all stackscripts requests? (stackscripts + OCA)? Or just OCA because of the filter definition?
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.
Just Marketplace. This filter is a copy-paste of oneClickFilter
(I don't think I can import it from TS into a JS file)
I don't think we want to attempt StackScript caching because at that point we'd have to worry about pagination.
The user experience is much better, the old way definitely took too long. I'm taking a closer look at the code to familiarize myself with this feature a bit more. |
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.
This is really cool. As pointed out before, it more of a cold start data filler than a cache
The only case where a user could notice stale data is if they
- try to select a app that was added in the API response before a rebuild occurred
- try to select that app before the real request actually completed in the background and replaced the cold cache.
Those cases are pretty edgy considering we need a release for every new OCA.
I see no downsides to implementing this, and marketplace is a perfect case for using it.
- data loads immediately ✅
- requests happens in the background ✅
- data gets updated once request completed ✅
- e2e still passes
This is a super nice improvement 👏
🧪 I modified marketplace.json
to not have any record and the content updates once the request completes in the background.
Screen.Recording.2023-10-02.at.14.56.25.mov
@bnussman I propose removing POC from the title and a changeset to get this into the next release |
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.
This is definitely a user experience improvement when loading that page.
- The unit test failure can be fixed now with the merging of develop.
- Can we create a corresponding M3 ticket for this so it is tracked?
Description 📝
initialData
for React QueryMajor Changes 🔄
Preview 📷
Screen.Recording.2023-09-28.at.4.56.05.PM.mov
Screen.Recording.2023-09-28.at.4.55.44.PM.mov
How to test 🧪
http://localhost:3000/linodes/create?type=One-Click