feat: add tkdodo past query and router articles to blog feed by KevinVandy · Pull Request #1000 · TanStack/tanstack.com · GitHub
Skip to content

feat: add tkdodo past query and router articles to blog feed#1000

Open
KevinVandy wants to merge 4 commits into
mainfrom
add-tk-dodo-tanstack-blogs
Open

feat: add tkdodo past query and router articles to blog feed#1000
KevinVandy wants to merge 4 commits into
mainfrom
add-tk-dodo-tanstack-blogs

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for external blog posts with proper link handling and new-tab navigation.
    • Introduced blog search functionality to filter posts by keywords.
    • Added author filtering for blog posts.
    • Integrated external blog posts from partner sources with automatic library classification.
  • Bug Fixes & Improvements

    • Enhanced blog post metadata handling and normalization.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/scrape-tkdodo-blog-images.ts (1)

277-283: ⚡ Quick win

Keep the batch running when one post fetch fails.

A single network/parser error currently aborts the whole run. Wrap each iteration in try/catch so remaining posts still produce mappings.

Suggested fix
   for (const item of items) {
-    const entry = await scrapePostImage(item)
-
-    if (entry) {
-      entries.push(entry)
-    }
+    try {
+      const entry = await scrapePostImage(item)
+      if (entry) {
+        entries.push(entry)
+      }
+    } catch (error) {
+      console.warn(`[skip] ${getExternalPostSlug(item)}: failed to scrape`, error)
+    }
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/scrape-tkdodo-blog-images.ts` around lines 277 - 283, The loop
iterating over items does not handle errors from the scrapePostImage function
call, causing any network or parser error to abort the entire batch. Wrap the
scrapePostImage function call and the entry push logic inside a try/catch block
within the for loop. In the catch block, log the error with context (such as the
current item being processed) but allow the loop to continue processing the
remaining items instead of crashing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/external-blog-posts.server.ts`:
- Around line 191-214: The externalUrl assignment uses feedItem.link directly
without validating the URL scheme, which is a security risk. Before the return
statement that creates the post object (after the getExternalPostSlug call), add
validation to ensure feedItem.link uses a safe scheme (http: or https:). If the
URL does not match these schemes, return an empty array to drop the invalid
item. This validation should be done by checking the URL scheme before passing
feedItem.link to addSearchParams.

---

Nitpick comments:
In `@scripts/scrape-tkdodo-blog-images.ts`:
- Around line 277-283: The loop iterating over items does not handle errors from
the scrapePostImage function call, causing any network or parser error to abort
the entire batch. Wrap the scrapePostImage function call and the entry push
logic inside a try/catch block within the for loop. In the catch block, log the
error with context (such as the current item being processed) but allow the loop
to continue processing the remaining items instead of crashing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 281cd017-bfee-4b7e-9642-eea304dee620

📥 Commits

Reviewing files that changed from the base of the PR and between e4cc876 and e54fcc0.

⛔ Files ignored due to path filters (36)
  • public/blog-assets/tkdodosblog/automatic-query-invalidation-after-mutations.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/breaking-react-querys-api-on-purpose.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/concurrent-optimistic-updates-in-react-query.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/context-inheritance-in-tan-stack-router.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/creating-query-abstractions.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/effective-react-query-keys.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/how-infinite-queries-work.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/inside-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/leveraging-the-query-function-context.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/mastering-mutations-in-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/offline-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/placeholder-and-initial-data-in-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/practical-react-query.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/react-query-and-forms.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-and-react-context.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-and-type-script.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-api-design-lessons-learned.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/react-query-as-a-state-manager.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-data-transformations.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-error-handling.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-fa-qs.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-meets-react-router.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-render-optimizations.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/react-query-selectors-supercharged.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/react-query-the-bad-parts.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/seeding-the-query-cache.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/status-checks-in-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/tan-stack-router-and-query.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/testing-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/the-beauty-of-tan-stack-router.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/the-query-options-api.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/thinking-in-react-query.png is excluded by !**/*.png
  • public/blog-assets/tkdodosblog/type-safe-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/using-web-sockets-with-react-query.jpeg is excluded by !**/*.jpeg
  • public/blog-assets/tkdodosblog/why-you-want-react-query.jpg is excluded by !**/*.jpg
  • public/blog-assets/tkdodosblog/you-might-not-need-react-query.jpeg is excluded by !**/*.jpeg
📒 Files selected for processing (11)
  • public/blog-assets/tkdodosblog/tkdodosblog.webp
  • scripts/scrape-tkdodo-blog-images.ts
  • src/components/BlogCard.tsx
  • src/components/RecentPostsWidget.tsx
  • src/components/home/HomeSocialProofSection.tsx
  • src/routes/_library/$libraryId/$version.docs.blog.tsx
  • src/routes/blog.index.tsx
  • src/utils/blog.functions.ts
  • src/utils/blog.ts
  • src/utils/external-blog-post-images.generated.ts
  • src/utils/external-blog-posts.server.ts

Comment thread src/utils/external-blog-posts.server.ts Outdated
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.

1 participant