chore: add vite-ssr-react-router example - #4403
Conversation
|
@p-dubovitsky is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (14)
🚧 Files skipped from review as they are similar to previous changes (13)
📝 WalkthroughWalkthroughAdds a new ChangesVite SSR React Router example
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
examples/vite-ssr-react-router/package.json (1)
24-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPin the
nitroversion instead oflatest.Using
"latest"makes the example non-reproducible; a future breaking Nitro release could silently break this example without a corresponding PR. As per coding guidelines, "Examples inexamples/should reflect best practices."♻️ Proposed fix
- "nitro": "latest", + "nitro": "^0.x.x",🤖 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 `@examples/vite-ssr-react-router/package.json` at line 24, The package.json dependency for nitro is currently using latest, which makes the example non-reproducible. Update the nitro entry in the example’s package manifest to a fixed version instead of latest, following the version pinning pattern used by the other example dependencies.Source: Coding guidelines
examples/vite-ssr-react-router/app/routes/home.tsx (1)
6-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUnused
loaderDataparameter.
metadestructuresloaderDatabut never uses it; the route has no loader. Minor, but worth dropping the unused param for clarity.🧹 Suggested simplification
-export function meta({ loaderData }: Route.MetaArgs) { +export function meta(_: Route.MetaArgs) {🤖 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 `@examples/vite-ssr-react-router/app/routes/home.tsx` around lines 6 - 11, The meta function currently destructures loaderData even though it is never used and this route has no loader. Update meta in the home route to remove the unused loaderData parameter from the Route.MetaArgs destructuring, keeping the function focused on returning the static title and description metadata.
🤖 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 `@examples/vite-ssr-react-router/app/app.css`:
- Around line 3-7: Stylelint is treating the Tailwind v4 `@theme` directive in the
app CSS example as an unknown at-rule, so update the lint configuration to allow
Tailwind CSS-first directives for this example. Adjust the Stylelint setup to
use tailwindcss/at-rule-no-unknown or the stylelint-config-tailwindcss preset,
or add an ignore override for the app.css example so the `@theme` block is not
flagged. Use the app.css example and the relevant Stylelint config entry as the
place to apply the fix.
---
Nitpick comments:
In `@examples/vite-ssr-react-router/app/routes/home.tsx`:
- Around line 6-11: The meta function currently destructures loaderData even
though it is never used and this route has no loader. Update meta in the home
route to remove the unused loaderData parameter from the Route.MetaArgs
destructuring, keeping the function focused on returning the static title and
description metadata.
In `@examples/vite-ssr-react-router/package.json`:
- Line 24: The package.json dependency for nitro is currently using latest,
which makes the example non-reproducible. Update the nitro entry in the
example’s package manifest to a fixed version instead of latest, following the
version pinning pattern used by the other example dependencies.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0dcd766a-e828-4912-aaf2-c6bda3b10515
⛔ Files ignored due to path filters (5)
examples/vite-ssr-react-router/app/logos/logo-dark.svgis excluded by!**/*.svgexamples/vite-ssr-react-router/app/logos/logo-light.svgis excluded by!**/*.svgexamples/vite-ssr-react-router/app/logos/nitro.svgis excluded by!**/*.svgexamples/vite-ssr-react-router/public/favicon.icois excluded by!**/*.icopnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
docs/4.examples/vite-ssr-react-router.mdexamples/vite-ssr-react-router/.gitignoreexamples/vite-ssr-react-router/README.mdexamples/vite-ssr-react-router/app/app.cssexamples/vite-ssr-react-router/app/root.tsxexamples/vite-ssr-react-router/app/routes.tsexamples/vite-ssr-react-router/app/routes/home.tsxexamples/vite-ssr-react-router/package.jsonexamples/vite-ssr-react-router/react-router.config.tsexamples/vite-ssr-react-router/server/routes/health.get.tsexamples/vite-ssr-react-router/server/ssr.tsexamples/vite-ssr-react-router/tsconfig.jsonexamples/vite-ssr-react-router/vite.config.tstsconfig.json
| @theme { | ||
| --font-sans: | ||
| "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", | ||
| "Segoe UI Symbol", "Noto Color Emoji"; | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Stylelint flags @theme as unknown at-rule.
Static analysis reports Unexpected unknown at-rule "@theme" (scss/at-rule-no-unknown). This is a Tailwind v4 CSS-first config directive and a false positive if stylelint isn't configured for Tailwind, but as written it will fail lint/CI for this new example. Consider adding tailwindcss/at-rule-no-unknown overrides (or the stylelint-config-tailwindcss preset) or an ignore pattern for this file so the example passes lint.
🔧 Example stylelint override
+// .stylelintrc.json (or relevant config)
+{
+ "rules": {
+ "at-rule-no-unknown": null,
+ "scss/at-rule-no-unknown": [true, { "ignoreAtRules": ["theme", "apply", "source", "utility"] }]
+ }
+}🧰 Tools
🪛 Stylelint (17.14.0)
[error] 3-3: Unexpected unknown at-rule "@theme" (scss/at-rule-no-unknown)
(scss/at-rule-no-unknown)
🤖 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 `@examples/vite-ssr-react-router/app/app.css` around lines 3 - 7, Stylelint is
treating the Tailwind v4 `@theme` directive in the app CSS example as an unknown
at-rule, so update the lint configuration to allow Tailwind CSS-first directives
for this example. Adjust the Stylelint setup to use
tailwindcss/at-rule-no-unknown or the stylelint-config-tailwindcss preset, or
add an ignore override for the app.css example so the `@theme` block is not
flagged. Use the app.css example and the relevant Stylelint config entry as the
place to apply the fix.
Source: Linters/SAST tools
d2fb2b1 to
2c06d19
Compare
🔗 Linked issue
❓ Type of change
📚 Description
Adds a minimal React Router framework mode example using Nitro and Vite.
The example covers:
ssrenvironment📝 Checklist