Skip to content

Conversation

@juliomuhlbauer
Copy link
Contributor

@juliomuhlbauer juliomuhlbauer commented Oct 2, 2025

Summary by CodeRabbit

  • New Features

    • Added localized root URLs for i18n (e.g., /en, /de), enabling language-specific home routes.
  • Refactor

    • Improved data loading on the home route to ensure server-provided messages are up to date.
  • Style

    • Updated the example message heading from h3 to h2 for clearer content hierarchy.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Converted the route loader to async and removed localeFromLoader from returned data and component usage. The loader now awaits getServerMessage. Adjusted heading level from h3 to h2. Updated Vite i18n config to add root '/' localization mapping for en and de alongside existing patterns.

Changes

Cohort / File(s) Summary
Route loader and component data usage
examples/react/start-i18n-paraglide/src/routes/index.tsx
Made loader async; now awaits getServerMessage({ data: '📩' }). Removed localeFromLoader from loader return and component Route.useLoaderData() destructuring. Changed rendered example heading from h3 to h2.
i18n URL pattern configuration
examples/react/start-i18n-paraglide/vite.config.ts
Added root '/' i18n mapping: en -> '/en', de -> '/de'. Existing /about and /:path(.*)? patterns unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User as User (Browser)
    participant Router as React Router
    participant Loader as Route Loader (async)
    participant SrvFn as getServerMessage (server)
    participant UI as Home Component

    User->>Router: Navigate to index route
    Router->>Loader: Invoke loader()
    activate Loader
    Loader->>SrvFn: await getServerMessage({ data: "📩" })
    activate SrvFn
    SrvFn-->>Loader: serverFunctionMessage
    deactivate SrvFn
    Loader-->>Router: { serverFunctionMessage, messageFromLoader }
    deactivate Loader
    Router->>UI: Provide loader data
    UI-->>User: Render with <h2> and messages
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibbled the routes, made loaders await,
Hopped past locales, mapping “/” to each state.
Out went a trinket—locale from yore,
In came a message I’d waited for.
With h2 ears tall, I ship with delight—
Paraglide breezes, translations in flight. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run `@coderabbitai generate docstrings` to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit's high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately summarizes the primary change, which is fixing the paraglide start example in the examples directory, without adding noise or ambiguity.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Oct 2, 2025

View your CI Pipeline Execution ↗ for commit e5bd682

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 54s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-02 21:26:31 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 2, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5344

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5344

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5344

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5344

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5344

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5344

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5344

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5344

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5344

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5344

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5344

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5344

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5344

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5344

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5344

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5344

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5344

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5344

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5344

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5344

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5344

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5344

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5344

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5344

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5344

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5344

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5344

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5344

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5344

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5344

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5344

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5344

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5344

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5344

commit: e5bd682

@schiller-manuel schiller-manuel changed the title docs: fix paraglide start example examples: fix paraglide start example Oct 2, 2025
@schiller-manuel schiller-manuel merged commit ac35dd2 into TanStack:main Oct 2, 2025
6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 25, 2025
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.

2 participants