perf: fix manifest, add preconnect hints, dynamic devtools, and loading indicator#34
Merged
Merged
Conversation
…ng indicator - Fill missing manifest.json name/short_name/description for PWA install - Add preconnect/dns-prefetch links for unpkg.com CDN - Make TanStack DevTools dynamically imported (tree-shaken in production) - Add top loading bar animation during client-side route transitions - Remove unused jsdom and @testing-library/dom devDependencies Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/site/src/routes/__root.tsx">
<violation number="1" location="apps/site/src/routes/__root.tsx:79">
P2: Handle dynamic import failures in `DevToolsHost` to avoid unhandled promise rejections.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Comment on lines
+79
to
+95
| ]).then(([devtoolsMod, routerMod]) => { | ||
| const TanStackDevtools = devtoolsMod.TanStackDevtools; | ||
| const TanStackRouterDevtoolsPanel = routerMod.TanStackRouterDevtoolsPanel; | ||
|
|
||
| setPlugins([ | ||
| <TanStackDevtools | ||
| key="devtools" | ||
| config={{ position: "bottom-right" }} | ||
| plugins={[ | ||
| { | ||
| name: "Tanstack Router", | ||
| render: <TanStackRouterDevtoolsPanel />, | ||
| }, | ||
| ]} | ||
| />, | ||
| ]); | ||
| }); |
There was a problem hiding this comment.
P2: Handle dynamic import failures in DevToolsHost to avoid unhandled promise rejections.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/site/src/routes/__root.tsx, line 79:
<comment>Handle dynamic import failures in `DevToolsHost` to avoid unhandled promise rejections.</comment>
<file context>
@@ -63,21 +62,39 @@ function RootDocument({ children }: { children: React.ReactNode }) {
+ Promise.all([
+ import("@tanstack/react-devtools"),
+ import("@tanstack/react-router-devtools"),
+ ]).then(([devtoolsMod, routerMod]) => {
+ const TanStackDevtools = devtoolsMod.TanStackDevtools;
+ const TanStackRouterDevtoolsPanel = routerMod.TanStackRouterDevtoolsPanel;
</file context>
Suggested change
| ]).then(([devtoolsMod, routerMod]) => { | |
| const TanStackDevtools = devtoolsMod.TanStackDevtools; | |
| const TanStackRouterDevtoolsPanel = routerMod.TanStackRouterDevtoolsPanel; | |
| setPlugins([ | |
| <TanStackDevtools | |
| key="devtools" | |
| config={{ position: "bottom-right" }} | |
| plugins={[ | |
| { | |
| name: "Tanstack Router", | |
| render: <TanStackRouterDevtoolsPanel />, | |
| }, | |
| ]} | |
| />, | |
| ]); | |
| }); | |
| ]).then(([devtoolsMod, routerMod]) => { | |
| const TanStackDevtools = devtoolsMod.TanStackDevtools; | |
| const TanStackRouterDevtoolsPanel = routerMod.TanStackRouterDevtoolsPanel; | |
| setPlugins([ | |
| <TanStackDevtools | |
| key="devtools" | |
| config={{ position: "bottom-right" }} | |
| plugins={[ | |
| { | |
| name: "Tanstack Router", | |
| render: <TanStackRouterDevtoolsPanel />, | |
| }, | |
| ]} | |
| />, | |
| ]); | |
| }).catch(() => { | |
| setPlugins(null); | |
| }); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Small follow-up improvements on top of the recent site restructuring:
name,short_name, and addeddescriptionfor PWA install experiencepreconnect/dns-prefetchforunpkg.comCDNuseRouterState({ select: s => s.isLoading })jsdomand@testing-library/domTest plan
pnpm buildsucceeds with 6 prerendered pagespnpm checkpasses with no errors🤖 Generated with Claude Code
Summary by cubic
Improve load and navigation UX by completing the PWA manifest, adding CDN preconnect, lazy-loading DevTools, and showing a top loading bar. This reduces the production bundle and speeds up perceived navigation.
New Features
useRouterStateisLoading).Refactors
@tanstack/react-devtools,@tanstack/react-router-devtools) are dynamically imported and tree-shaken from production builds.preconnectanddns-prefetchhints for https://unpkg.com.jsdomand@testing-library/dom.Written for commit 155d4ed. Summary will update on new commits. Review in cubic