Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/blog/tanstack-router-route-matching-tree-rewrite.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ authors:
- Florian Pellet
---

![Big performance number](/blog-assets/tanstack-router-route-matching-tree-rewrite/header.png)
![Header](/blog-assets/tanstack-router-route-matching-tree-rewrite/header.png)

Choose a reason for hiding this comment

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

P2 Badge Reduce hero image payload in route-matching blog post

The new top-of-article image points to header.png, which in this commit is a 3,391,000-byte PNG (public/blog-assets/tanstack-router-route-matching-tree-rewrite/header.png), roughly 100× larger than the previous header asset. Because this image is rendered at the start of the post, every reader pays this transfer cost up front, which will noticeably hurt page load/LCP on slower networks; please resize/compress or switch to a more efficient format before using it as the header.

Useful? React with 👍 / 👎.

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use meaningful alt text (or empty alt if decorative).

On Line 9, Header is too generic for screen readers. Please either provide descriptive alt text (e.g., “Fantasy landscape illustration used as the article header”) or make it decorative with empty alt text (![](...)).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-route-matching-tree-rewrite.md` at line 9, The image
markdown currently uses a generic alt text "Header" in the line containing
"![Header](/blog-assets/tanstack-router-route-matching-tree-rewrite/header.png)";
replace that alt text with a meaningful description (e.g., "Fantasy landscape
illustration used as the article header") or make it decorative by using an
empty alt (`![](/blog-assets/.../header.png)`), updating the markdown line
accordingly so screen readers receive either the descriptive text or treat the
image as decorative.


We achieved a 20,000× performance improvement in route matching in TanStack Router. Let's be honest, this is _definitely_ cherry-picked, but the number is real and comes from a real production application. More importantly, it shows that matching a pathname to a route is no longer bottlenecked by the number of routes in your application.

![Big performance number](/blog-assets/tanstack-router-route-matching-tree-rewrite/big-number.png)

## The Real Problem: correctness, not speed

One big responsibility of a router is to match a given URL pathname (e.g., `/users/123`) to a route definition (e.g., `/users/$userId`). This is deceptively complex when you consider all the different types of route segments (static, dynamic, optional, wildcard) and the priority rules that govern which route should match first.
Expand Down
Loading