feat: improve readme loading and error handling#1380
feat: improve readme loading and error handling#1380essenmitsosse wants to merge 4 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Alternative approach would be to still load all the data in the main page component, but pass the fetch response object (including |
ghostdevv
left a comment
There was a problem hiding this comment.
@essenmitsosse there have been a bunch of readme related changes since you opened this PR, do you think they fix the problem? or should we still work on this?
For now a little experimental, what to do some exploration and see if this could be a direction we can/should be going.
This has the benefit of better separation of concerns. The data loading is also moved into the component. Since the Playground component needs the same data, both now do a fetch, but that gets deduplicated.
This mainly fixes the issue of "There is no Readme appearing" when something goes wrong
As it is currently implemented I am not sure in which cases the loading state for the Readme would appear. We could load it non-blocking which would render the rest of the page faster so it can load in the background. I am not sure exactly though what the best way to do this in Nuxt is.
I think ideally the whole page should be rendered via SSR, if all the fetches have cached results. Otherwise a component like the readme component could be client side rendered to have faster time to interaction.
This pattern would also allow us to control the loading skeletons on a per component basis, while making it easier to already show headings etc.
If we would follow through with this the whole page could be small components, each fetching their own data, with Nuxt deduplication making sure we fetch the same thing twice. I have worked with a similar pattern in Next and I really liked it from a DX as well as from a UX perspective (because it makes it easier to show each thing as early as possible, without being blocked by other data that might be needed elsewhere).
Open questions