Skip to content

refactor: move DataProvider to app level with deferred loading#500

Open
mchen11077 wants to merge 9 commits intomasterfrom
feat/481
Open

refactor: move DataProvider to app level with deferred loading#500
mchen11077 wants to merge 9 commits intomasterfrom
feat/481

Conversation

@mchen11077
Copy link
Contributor

Fixes #481

Summary: Move DataProvider to App and keep it lazily loaded.

Changes

  • Mount PageParamsProvider and DataProvider in App
  • Load providers via dynamic import in useEffect
  • Remove providers from DataPage

Test Plan

  • npm run dev
  • Check /intro renders immediately
  • Check /data loads correctly
  • npm run build and confirm DataProvider is a separate chunk

Checklist

  • Data available globally
  • No blocking on initial render
  • DataProvider not in main bundle

@mchen11077 mchen11077 requested a review from a team as a code owner February 28, 2026 00:30
@mchen11077 mchen11077 marked this pull request as draft February 28, 2026 00:30
@mchen11077 mchen11077 marked this pull request as ready for review February 28, 2026 20:06
Copy link
Collaborator

@conradarcturus conradarcturus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 minor change.

This is partially deferred -- but the way you set it up, you are blocking the whole page render until the 2 components have been loaded. If you have cached the page it is pretty fast, but we should return the children without providers. However we expect people to load the page with mobile devices and/or limited internet connections.

You can test out the page with limited network connections in the chrome debug tools, click the icon with the laptop/cellphone to open with mobile device specs and throttle the network connection to mid-tier or low-tier mobile.

Image

Copy link
Collaborator

@conradarcturus conradarcturus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like something may have been merged incorrectly.

Apologies if you were waiting for me for awhile for comments. Since there are so many changes I usually only check in when it says "waiting for review" (it still says "changed requested" right now, you can click a button to switch it back to "waiting for review"). Also if there are build or test errors I usually ignore it too, expecting you to fix it before I get back to the change.

@mchen11077 mchen11077 marked this pull request as draft March 10, 2026 21:31
@mchen11077 mchen11077 marked this pull request as ready for review March 10, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Data Context Available Earlier in Component Tree

2 participants