Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis change updates core dependencies (Astro 5.16.9 → 6.0.2, Tailwind packages, Prettier), introduces type-safe blog data handling with new TypeScript definitions, refactors blog pages to use eager glob imports, and reorganizes CSS utility class sequences across page components without altering visual presentation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/types/blog.ts (1)
8-12: Use proper Astro type for markdown glob imports.In Astro 6.0.2, glob imports of markdown files should use the
MarkdownInstance<Frontmatter>type instead of a custom type. This provides proper typing for theContentcomponent and aligns with Astro's pattern.♻️ Suggested improvement
+import type { MarkdownInstance } from "astro"; + -export type BlogPostFrontmatter = { - title: string; - date: string; - description?: string; - hidden?: boolean; -}; - -export type BlogPost = { - file: string; - frontmatter: BlogPostFrontmatter; - Content: any; -}; +export type BlogPostFrontmatter = { + title: string; + date: string; + description?: string; + hidden?: boolean; +}; + +export type BlogPost = MarkdownInstance<BlogPostFrontmatter>;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/types/blog.ts` around lines 8 - 12, The BlogPost type currently uses a loose any for the Content property; replace it with Astro's MarkdownInstance<BlogPostFrontmatter> for proper typing. Add an import (import type { MarkdownInstance } from 'astro') and change the Content field on the BlogPost type to MarkdownInstance<BlogPostFrontmatter>, keeping the existing file and frontmatter fields unchanged so markdown glob imports are correctly typed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 14: The package version for `@astrojs/check` is invalid; replace the
dependency version specifier "@astrojs/check": "^0.9.7" with a valid
release—either downgrade to "^0.9.6" or explicitly pin to an intended beta like
"0.9.7-beta.1" in package.json so npm install succeeds; update the dependency
entry for the `@astrojs/check` package accordingly.
- Line 17: The package.json currently pins "astro": "6.0.2" but upgrading to
Astro 6 requires several changes: add an "engines" entry with node >=22.12.0 to
package.json and update CI/deployment to use Node 22.12.0+; verify and update
Vite to a Vite 7-compatible version; scan code for removed/changed Astro APIs
(calls like Astro.glob(), usage of <ViewTransitions />, import.meta.env
coercion, endpoint URL assumptions, and i18n routing defaults) and update call
sites accordingly; if using Astro Content or Zod schemas, replace imports from
astro:content or astro:schema with astro/zod and adapt any Zod 4 breaking
changes. Ensure these changes are applied alongside the "astro": "6.0.2" bump.
In `@src/layouts/BaseLayout.astro`:
- Around line 65-66: Remove the redundant is:inline attribute from the <script>
element in BaseLayout.astro (the script tag with attributes defer,
data-domain="astro.t3.gg", and src="/js/script.js"); update the <script> tag to
omit is:inline so it becomes a standard deferred external script element.
In `@src/pages/blog/post/`[slug].astro:
- Around line 8-15: The getStaticPaths logic currently returns pages for every
markdown file; filter out posts with frontmatter.hidden === true before mapping.
After loading posts via
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
apply a filter using each post's frontmatter (e.g., post.frontmatter &&
post.frontmatter.hidden !== true) and only then map to produce params/props
(referencing getSlugFromPath and the returned post object). This ensures hidden
posts are not included in the generated routes.
---
Nitpick comments:
In `@src/types/blog.ts`:
- Around line 8-12: The BlogPost type currently uses a loose any for the Content
property; replace it with Astro's MarkdownInstance<BlogPostFrontmatter> for
proper typing. Add an import (import type { MarkdownInstance } from 'astro') and
change the Content field on the BlogPost type to
MarkdownInstance<BlogPostFrontmatter>, keeping the existing file and frontmatter
fields unchanged so markdown glob imports are correctly typed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7972ca61-2236-42d2-86ff-2ccc38af6220
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
package.jsonsrc/assets/sponsors/temp.svg.astrosrc/components/BlogPostHeader.astrosrc/components/BlogPostPreview.astrosrc/components/SponsorGridSection.astrosrc/env.d.tssrc/layouts/BaseLayout.astrosrc/pages/404.astrosrc/pages/blog/index.astrosrc/pages/blog/post/[slug].astrosrc/pages/index.astrosrc/pages/sponsor-me.astrosrc/pages/sponsors.astrosrc/types/blog.ts
| "format": "prettier --write **/*.{mjs,ts,md,json,astro,css} --ignore-path .gitignore" | ||
| }, | ||
| "devDependencies": { | ||
| "@astrojs/check": "^0.9.7", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check peer dependencies for `@astrojs/check`
curl -s https://registry.npmjs.org/@astrojs/check/0.9.7 | jq '.peerDependencies // "No peer deps"'Repository: T3-Content/t3.gg
Length of output: 88
🏁 Script executed:
cat package.json | grep -A2 -B2 '"astro"'Repository: T3-Content/t3.gg
Length of output: 223
🌐 Web query:
@astrojs/check 0.9.7 Astro 6 compatibility requirements
💡 Result:
- There is no stable
@astrojs/check@0.9.7on npm (the latest published stable version is 0.9.6). [1] - For Astro 6, the upgrade path has been using
@astrojs/check@0.9.7-beta.1(paired withastro@6.0.0-beta.xduring the beta period). [2] - Astro 6 runtime requirement: Node.js 22+. [3]
@astrojs/checkpeer requirement: TypeScript^5.0.0. [4]
If you specifically need “Astro 6 compatibility”, use the Astro 6–era @astrojs/check (currently the 0.9.7 beta line, or whatever version Astro 6’s upgrade tool installs) rather than expecting a stable 0.9.7 tarball to exist. [2]
Sources: [1] [2] [3] [4]
Update @astrojs/check to a stable release version.
@astrojs/check@0.9.7 does not exist as a stable release on npm—the latest stable version is 0.9.6. The version constraint ^0.9.7 will fail during npm install. Either downgrade to ^0.9.6 or explicitly pin to 0.9.7-beta.1 if intentional for Astro 6 beta testing.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 14, The package version for `@astrojs/check` is invalid;
replace the dependency version specifier "@astrojs/check": "^0.9.7" with a valid
release—either downgrade to "^0.9.6" or explicitly pin to an intended beta like
"0.9.7-beta.1" in package.json so npm install succeeds; update the dependency
entry for the `@astrojs/check` package accordingly.
| "astro": "5.16.9", | ||
| "prettier": "^3.7.4", | ||
| "@tailwindcss/vite": "^4.2.1", | ||
| "astro": "6.0.2", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Astro 6.0 release breaking changes migration
💡 Result:
Astro 6.0 upgrade/migration checklist (breaking changes & common fixes):
- Upgrade command: run
npx@astrojs/upgrade`` (preferred) or installastro@latest. [1] - Node.js requirement: Astro 6 drops Node 18 & 20 — you must use Node
22.12.0+in dev and CI/deploy. [2] - Vite upgrade: Astro 6 upgrades to Vite 7 (update if you pin Vite). [1][2]
- Config files:
.cjs/.ctsAstro config files are no longer supported → rename to.mjs,.js,.ts, or.mts. [3] - Remove now-stable experimental flags: delete flags like
experimental.csp,fonts,liveContentCollections,preserveScriptOrder,staticImportMetaEnv, etc. fromastro.config.*. [4] - Zod 4: Astro 6 uses Zod 4 (schemas may need updates). Also stop importing Zod via
astro:schemaorzfromastro:content→ import fromastro/zodinstead. [1][5] import.meta.envbehavior: values are now always inlined and never coerced; if you relied on boolean/number coercion orprocess.envfallback, update code/types accordingly. [6]- Endpoint URLs with file extensions:
/sitemap.xml/(trailing slash) no longer works—must be/sitemap.xml. [6] - i18n default change:
i18n.routing.redirectToDefaultLocalenow defaults tofalseand only works whenprefixDefaultLocale: true; set explicitly if you relied on old behavior. [7] <script>/<style>ordering: Astro now renders them in declared order (not reversed); you may need to reorder tags. [7]
For the full list (including removed APIs like Astro.glob(), <ViewTransitions />, adapter/integration API changes, image-service behavior changes, etc.), follow the official “Upgrade to Astro v6” guide. [2]
Sources: [1] [2] [3] [4] [5] [6] [7]
🏁 Script executed:
# Check if astro.config exists
find . -type f \( -name "astro.config.*" -o -name "astro.config.mjs" \) 2>/dev/null | head -20Repository: T3-Content/t3.gg
Length of output: 78
🏁 Script executed:
# Check the current tsconfig or TypeScript configuration
find . -type f \( -name "tsconfig.json" -o -name "tsconfig.*.json" \) 2>/dev/null | head -10Repository: T3-Content/t3.gg
Length of output: 75
🏁 Script executed:
# Look for Node.js version requirements (package.json engines field, .nvmrc, .node-version)
cat package.json | grep -A 5 '"engines"' || echo "No engines field found"Repository: T3-Content/t3.gg
Length of output: 82
🏁 Script executed:
# Check for .nvmrc or .node-version files
ls -la .nvmrc .node-version 2>/dev/null || echo "No .nvmrc or .node-version files found"Repository: T3-Content/t3.gg
Length of output: 98
🏁 Script executed:
# Read astro.config.mjs to check for experimental flags
cat astro.config.mjsRepository: T3-Content/t3.gg
Length of output: 402
🏁 Script executed:
# Read tsconfig.json
cat tsconfig.jsonRepository: T3-Content/t3.gg
Length of output: 595
🏁 Script executed:
# Check if Zod is used in the codebase (Astro 6 uses Zod 4)
grep -r "from \"astro" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.astro" 2>/dev/null | grep -E "(astro:content|astro:schema)" || echo "No Astro content/schema imports found"Repository: T3-Content/t3.gg
Length of output: 97
🏁 Script executed:
# Check for any .cjs or .cts config files that would violate Astro 6
find . -type f \( -name "astro.config.cjs" -o -name "astro.config.cts" \) 2>/dev/null || echo "No deprecated config format found"Repository: T3-Content/t3.gg
Length of output: 42
Major version upgrade: Astro 5 → 6 requires verifying breaking changes.
Astro 6 introduces significant breaking changes. Verify these key items:
- Node.js version: Astro 6 requires Node.js 22.12.0+—add
"engines": { "node": ">=22.12.0" }to package.json and ensure CI/deployment uses this version or higher. - Vite upgrade: Confirm Vite 7 compatibility (Astro 6 upgrades to Vite 7).
- Breaking API changes: Verify if the codebase uses removed APIs like
Astro.glob(),<ViewTransitions />,import.meta.envcoercion, or changes to endpoint URLs andi18nrouting defaults. - Zod 4: If using Astro Content, update imports from
astro:contentorastro:schematoastro/zod.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 17, The package.json currently pins "astro": "6.0.2"
but upgrading to Astro 6 requires several changes: add an "engines" entry with
node >=22.12.0 to package.json and update CI/deployment to use Node 22.12.0+;
verify and update Vite to a Vite 7-compatible version; scan code for
removed/changed Astro APIs (calls like Astro.glob(), usage of <ViewTransitions
/>, import.meta.env coercion, endpoint URL assumptions, and i18n routing
defaults) and update call sites accordingly; if using Astro Content or Zod
schemas, replace imports from astro:content or astro:schema with astro/zod and
adapt any Zod 4 breaking changes. Ensure these changes are applied alongside the
"astro": "6.0.2" bump.
| <script is:inline defer data-domain="astro.t3.gg" src="/js/script.js" | ||
| ></script> |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Astro 6 is:inline directive external script src behavior
💡 Result:
In Astro (including v6 docs), is:inline means Astro will not process/bundle the <script> tag—it will be emitted in the final HTML “as-is.” This matters a lot when you also use src. [1]
What happens with <script src="...">
- Only
srcpresent (no other attributes): Astro treats it as a bundled module script (Astro processes the file, can compile TS, and outputs a built asset). [1][2] is:inlinepresent (or implied): Astro does not bundle. The browser will request exactly thesrcURL you wrote at runtime. If that path doesn’t exist in the built site (typicallypublic/), you’ll get a 404. [1]
When is:inline is implied (even if you didn’t write it)
Astro implicitly treats a script as is:inline whenever you add any attribute other than src (e.g. type="module", async, defer, crossorigin, etc.). That disables bundling and changes behavior to “leave it alone.” [1][2]
Practical rule of thumb
- If the script is in
src/and you want Astro to build it: use a plain<script src="./path/to/file.ts"></script>with no other attributes. [1][2] - If you want to load a file exactly from your built site (usually from
public/) or an external CDN URL: useis:inline(or any other attribute) and make sure thesrcpoints to a real runtime URL. [1]
Sources: Astro directives reference (incl. is:inline + implicit behavior) [1], Astro client-side scripts guide (attributes disable bundling) [2].
Remove redundant is:inline directive.
The is:inline attribute is unnecessary here because Astro implicitly treats any <script> tag with additional attributes (like defer) as inline. Since your script already has defer, the explicit is:inline is redundant.
Remove the is:inline attribute to keep the markup cleaner:
Suggested change
<script defer data-domain="astro.t3.gg" src="/js/script.js"></script>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/layouts/BaseLayout.astro` around lines 65 - 66, Remove the redundant
is:inline attribute from the <script> element in BaseLayout.astro (the script
tag with attributes defer, data-domain="astro.t3.gg", and src="/js/script.js");
update the <script> tag to omit is:inline so it becomes a standard deferred
external script element.
| return Object.values( | ||
| import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }), | ||
| ).map((post) => { | ||
| const slug = getSlugFromPath(post.file); | ||
|
|
||
| return { | ||
| params: { | ||
| slug, | ||
| }, | ||
| params: { slug }, | ||
| props: { post }, |
There was a problem hiding this comment.
Filter hidden posts out of getStaticPaths().
/blog now excludes frontmatter.hidden === true, but this route still generates pages for every markdown file. Hidden posts remain reachable by direct URL even though they no longer appear in the index.
Proposed fix
export function getStaticPaths() {
return Object.values(
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
- ).map((post) => {
- const slug = getSlugFromPath(post.file);
+ )
+ .filter((post) => post.frontmatter.hidden !== true)
+ .map((post) => {
+ const slug = getSlugFromPath(post.file);
- return {
- params: { slug },
- props: { post },
- };
- });
+ return {
+ params: { slug },
+ props: { post },
+ };
+ });
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/blog/post/`[slug].astro around lines 8 - 15, The getStaticPaths
logic currently returns pages for every markdown file; filter out posts with
frontmatter.hidden === true before mapping. After loading posts via
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
apply a filter using each post's frontmatter (e.g., post.frontmatter &&
post.frontmatter.hidden !== true) and only then map to produce params/props
(referencing getSlugFromPath and the returned post object). This ensures hidden
posts are not included in the generated routes.
Upgrade Astro to v6 and add typed blog post imports
astrofrom 5.16.9 to 6.0.2 and related deps (@tailwindcss/vite,tailwindcss,prettier) in package.json; adds@astrojs/checkandtypescriptas dev dependencies with a newcheckscriptBlogPostandBlogPostFrontmattertypes, replacing untypedAstro.globcalls with typedimport.meta.glob<BlogPost>in the blog index and post pagesxmlns:serifandserif:idSVG attributes in src/env.d.ts to suppress type errors in SVG assetshidden !== true) now runs before sorting rather than afterMacroscope summarized b0f42ae.
Summary by CodeRabbit
Release Notes
New Features
Chores
Style