-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: route intent preloading #102574
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
Merged
+579
−8
Merged
feat: route intent preloading #102574
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6a4d43e
feat: route preloading
TkDodo 65f62cd
fix: simplify
TkDodo e5c76ca
ref: introduce preload constant
TkDodo 599f8c9
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo 9e4eb6f
ref: remove import
TkDodo d2d9ce8
tests
TkDodo e6569d8
fix: async functions always return a _new_ promise
TkDodo 54e3609
fix: re-set shared promise on error
TkDodo a1271ae
ref: switch to fake timers
TkDodo 0bad19f
fix: use real timers for route integration
TkDodo ea4284b
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo d9757e7
ref: log preload errors
TkDodo 2ce4b75
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo d325f14
fix: re-add pre-loading after merge conflict
TkDodo 2a81d65
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo c257dcd
ref: move router constant to router directory
TkDodo 95b0fba
ref: move preload code
TkDodo 0974340
fix: make route config injectable
TkDodo 63377e4
ref: use RouteConfigProvider in tests
TkDodo 151ea8a
ref: explicitly avoid preloading if there is no RouteConfigProvider
TkDodo 871e039
ref: use intent-preloading feature flag
TkDodo 5897864
ref: remove unused import
TkDodo 32b6330
remove ai stuff (mostly comments)
TkDodo b35d984
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo a212b8f
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo d350d5c
test: better tests
TkDodo b3de1af
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo 5c9e8bf
test: better tests
TkDodo 2cc9f13
ref: switch to sentry logging
TkDodo 7efadae
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo 9b7124c
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo 1d3da78
fix: add missing fmt mock
TkDodo 5656749
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo cc30199
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
note: react-router does not expose a hook that gives us access to all the routes; the recommended way is to just export your routs (“it’s just config”), but that ties it to a specific implementation and makes it hard to test.
instead, I’ve opted for another provider that allows access to the route config of the router that gets passed to
RouterProvider.This is the only place where we add this.
linkBehaviorreads the context to enable intent prefetching, and if there is no context, we simply don’t prefetch anything. That means we don’t need to add this provider everywhere.