X Tutup
Skip to content

feat(examples): add Remix + Vite example#973

Open
thefernbot wants to merge 1 commit intogeneraltranslation:mainfrom
thefernbot:feat/remix-example
Open

feat(examples): add Remix + Vite example#973
thefernbot wants to merge 1 commit intogeneraltranslation:mainfrom
thefernbot:feat/remix-example

Conversation

@thefernbot
Copy link

@thefernbot thefernbot commented Feb 2, 2026

Summary

Add a new example demonstrating gt-react integration with Remix v2 (using Vite).

What's included

  • app/root.tsx - GTProvider setup wrapping the app
  • app/routes/_index.tsx - Example usage of <T>, <Num>, and <LocaleSelector> components
  • Complete project setup with TypeScript, Vite config, and styling
  • README with quick start instructions and Vercel deploy button

Why

Remix is a popular React framework and was notably missing from the examples. This helps users who want to add internationalization to their Remix apps.

Notes

  • Uses React 18 (required by current Remix version)
  • Follows the existing example structure and conventions
  • Tested locally - dev server starts and renders correctly

This PR was created by fern 🌿

Greptile Overview

Greptile Summary

Added a new Remix + Vite example demonstrating gt-react integration for internationalization, following existing example patterns.

Key additions:

  • GTProvider setup in app/root.tsx wrapping the entire app with configuration from gt.config.json and environment variables
  • Example usage of <T>, <Num>, and <LocaleSelector> components in the index route
  • Complete project setup with TypeScript, proper Remix v2.16 dependencies, and Vite configuration
  • Build script includes gtx-cli translate command before bundling
  • README with clear instructions and Vercel deployment button

The implementation follows the established conventions from other examples (like vite-create-app and next-create-app), uses appropriate versions (Remix 2.16, React 18), and correctly demonstrates the core gt-react functionality. No console.log statements or server-side code present.

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • All files are well-structured example code following existing patterns, proper dependency versions, no security concerns, no custom rule violations, and complete documentation
  • No files require special attention

Important Files Changed

Filename Overview
examples/remix-vite/package.json Proper dependencies for Remix 2.16 with gt-react and gtx-cli integration
examples/remix-vite/app/root.tsx GTProvider correctly wraps app with config and environment variables
examples/remix-vite/app/routes/_index.tsx Demonstrates T, Num, and LocaleSelector components with counter example
examples/remix-vite/gt.config.json Configures 4 locales with proper output path for Remix structure

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant RemixApp
    participant GTProvider
    participant GTReactComponents
    participant GTConfig
    
    User->>Browser: Access Remix app
    Browser->>RemixApp: Load root.tsx
    RemixApp->>GTConfig: Load gt.config.json
    RemixApp->>GTProvider: Initialize with config + env vars
    Note over GTProvider: projectId, devApiKey, locales
    GTProvider->>RemixApp: Wrap Layout with context
    
    Browser->>RemixApp: Navigate to route
    RemixApp->>GTReactComponents: Render _index.tsx
    
    User->>GTReactComponents: Interact with LocaleSelector
    GTReactComponents->>GTProvider: Update locale context
    GTProvider->>GTReactComponents: Re-render with new locale
    
    User->>GTReactComponents: Click counter button
    GTReactComponents->>GTReactComponents: Update count state
    GTReactComponents->>GTProvider: Translate <T> content
    Note over GTProvider: Translates button text with <Num>
    GTProvider->>Browser: Display translated content
Loading

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Add a new example demonstrating gt-react integration with Remix v2 (using Vite).

- Shows GTProvider setup in root.tsx
- Demonstrates <T>, <Num>, and <LocaleSelector> components
- Follows the existing example structure and conventions
- Uses React 18 (required by Remix)
- Includes Vercel deploy button
@thefernbot thefernbot requested a review from a team as a code owner February 2, 2026 05:03
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

X Tutup