Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6a4d43e
feat: route preloading
TkDodo Nov 3, 2025
65f62cd
fix: simplify
TkDodo Nov 3, 2025
e5c76ca
ref: introduce preload constant
TkDodo Nov 3, 2025
599f8c9
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 3, 2025
9e4eb6f
ref: remove import
TkDodo Nov 3, 2025
d2d9ce8
tests
TkDodo Nov 3, 2025
e6569d8
fix: async functions always return a _new_ promise
TkDodo Nov 3, 2025
54e3609
fix: re-set shared promise on error
TkDodo Nov 3, 2025
a1271ae
ref: switch to fake timers
TkDodo Nov 3, 2025
0bad19f
fix: use real timers for route integration
TkDodo Nov 3, 2025
ea4284b
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 3, 2025
d9757e7
ref: log preload errors
TkDodo Nov 4, 2025
2ce4b75
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 6, 2025
d325f14
fix: re-add pre-loading after merge conflict
TkDodo Nov 6, 2025
2a81d65
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 6, 2025
c257dcd
ref: move router constant to router directory
TkDodo Nov 6, 2025
95b0fba
ref: move preload code
TkDodo Nov 6, 2025
0974340
fix: make route config injectable
TkDodo Nov 6, 2025
63377e4
ref: use RouteConfigProvider in tests
TkDodo Nov 6, 2025
151ea8a
ref: explicitly avoid preloading if there is no RouteConfigProvider
TkDodo Nov 6, 2025
871e039
ref: use intent-preloading feature flag
TkDodo Nov 6, 2025
5897864
ref: remove unused import
TkDodo Nov 6, 2025
32b6330
remove ai stuff (mostly comments)
TkDodo Nov 6, 2025
b35d984
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 6, 2025
a212b8f
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 6, 2025
d350d5c
test: better tests
TkDodo Nov 7, 2025
b3de1af
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 7, 2025
5c9e8bf
test: better tests
TkDodo Nov 7, 2025
2cc9f13
ref: switch to sentry logging
TkDodo Nov 7, 2025
7efadae
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 7, 2025
9b7124c
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 7, 2025
1d3da78
fix: add missing fmt mock
TkDodo Nov 7, 2025
5656749
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 8, 2025
cc30199
Merge branch 'master' into tkdodo/feat/intent-preload
TkDodo Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion static/app/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {CommandPaletteProvider} from 'sentry/components/commandPalette/context';
import {FrontendVersionProvider} from 'sentry/components/frontendVersionContext';
import {ThemeAndStyleProvider} from 'sentry/components/themeAndStyleProvider';
import {SENTRY_RELEASE_VERSION, USE_REACT_QUERY_DEVTOOL} from 'sentry/constants';
import {RouteConfigProvider} from 'sentry/router/routeConfigContext';
import {routes} from 'sentry/router/routes';
import {DANGEROUS_SET_REACT_ROUTER_6_HISTORY} from 'sentry/utils/browserHistory';

Expand All @@ -29,7 +30,9 @@ function Main() {
<ThemeAndStyleProvider>
<NuqsAdapter defaultOptions={{shallow: false}}>
<CommandPaletteProvider>
<RouterProvider router={router} />
<RouteConfigProvider value={router.routes}>
<RouterProvider router={router} />
</RouteConfigProvider>
Comment on lines +33 to +35
Copy link
Collaborator Author

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. linkBehavior reads 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.

</CommandPaletteProvider>
</NuqsAdapter>
{USE_REACT_QUERY_DEVTOOL && (
Expand Down
Loading
Loading