-
Notifications
You must be signed in to change notification settings - Fork 1
Add TanStack Router demo with SSR and TypeScript #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
justin808
wants to merge
17
commits into
main
Choose a base branch
from
jg/tanstack-router-demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0a97d4d
Generate basic-v16-rspack-tanstack with React on Rails 16.2.0.rc1
justin808 f94c495
Add TanStack Router dependencies and rspack plugin configuration
justin808 e4c2c80
Create TanStack Router routes and SSR components
justin808 d36b75d
Add Rails integration for TanStack Router app
justin808 0f9fce6
Add E2E tests for SSR verification
justin808 2120d2a
Fix RuboCop violations in switch-bundler script
justin808 d6cef34
Address code review feedback for TanStack Router demo
justin808 5cbec42
Fix rubocop pre-commit hook with mise and demo-specific configs
justin808 5e7875b
Fix rubocop pre-commit hook to auto-correct offenses
justin808 da9adf0
Add TanStack Router Webpack plugin support
justin808 b6178b8
Add React on Rails Pro requirement for TanStack Router SSR
justin808 72b4250
Migrate react_on_rails_pro to regular RubyGems and npm
justin808 a2893a1
Address CodeRabbit review comments
justin808 85f38bc
Make privateOutputPath warning version-agnostic
justin808 8cbe647
Update react_on_rails and react_on_rails_pro to 16.2.0
justin808 4f917af
Add React on Rails Pro requirement for TanStack Router SSR
justin808 66b8807
Update shakapacker to 10.0.0, react_on_rails to 16.6.0, and react_on_…
justin808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| demo_name: basic-v16-rspack-tanstack | ||
| demo_directory: demos/basic-v16-rspack-tanstack | ||
| created_at: "2025-01-13" | ||
| description: React on Rails demo with TanStack Router, TypeScript, Rspack, and SSR | ||
| rails_version: "8.0.3" | ||
| shakapacker_version: "9.3.4" | ||
| react_on_rails_version: "16.2.0.rc1" | ||
| bundler: rspack | ||
| transpiler: swc | ||
| features: | ||
| - typescript | ||
| - tanstack-router | ||
| - ssr | ||
| - rspack | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Service Dependencies Configuration | ||
| # | ||
| # This file defines external services that must be running before bin/dev starts. | ||
| # Copy this file to .dev-services.yml and customize for your application. | ||
| # | ||
| # bin/dev will check each service before starting the development server. | ||
| # If any service is not running, it will display helpful error messages with | ||
| # instructions on how to start the service. | ||
| # | ||
| # ⚠️ SECURITY WARNING: | ||
| # Commands in this file are executed during bin/dev startup. Only add commands | ||
| # from trusted sources. This file should not be committed if it contains | ||
| # sensitive information or custom paths specific to your machine. Consider | ||
| # adding .dev-services.yml to .gitignore if it contains machine-specific config. | ||
| # | ||
| # Security best practices: | ||
| # - Commands are executed without shell expansion (shell metacharacters won't work) | ||
| # - Use simple, single commands (e.g., "redis-cli ping", "pg_isready") | ||
| # - Do NOT use shell features: &&, ||, |, $, ;, backticks, etc. will fail | ||
| # - Only include services you trust | ||
| # - Keep commands simple and focused on service health checks | ||
| # - Consider adding .dev-services.yml to .gitignore (commit .example instead) | ||
| # | ||
| # Example configuration: | ||
| # | ||
| # services: | ||
| # redis: | ||
| # check_command: "redis-cli ping" | ||
| # expected_output: "PONG" | ||
| # start_command: "redis-server" | ||
| # install_hint: "brew install redis (macOS) or apt-get install redis-server (Linux)" | ||
| # description: "Redis (for caching and background jobs)" | ||
| # | ||
| # postgresql: | ||
| # check_command: "pg_isready" | ||
| # expected_output: "accepting connections" | ||
| # start_command: "pg_ctl -D /usr/local/var/postgres start" | ||
| # install_hint: "brew install postgresql (macOS) or apt-get install postgresql (Linux)" | ||
| # description: "PostgreSQL database" | ||
| # | ||
| # elasticsearch: | ||
| # check_command: "curl -s http://localhost:9200" | ||
| # expected_output: "cluster_name" | ||
| # start_command: "brew services start elasticsearch-full" | ||
| # install_hint: "brew install elasticsearch-full" | ||
| # description: "Elasticsearch (for search)" | ||
| # | ||
| # Field descriptions: | ||
| # check_command: Shell command to check if service is running (required) | ||
| # expected_output: String that must appear in command output (optional) | ||
| # start_command: Command to start the service (shown in error messages) | ||
| # install_hint: How to install the service if not found | ||
| # description: Human-readable description of the service | ||
| # | ||
| # To use this file: | ||
| # 1. Copy to .dev-services.yml: cp .dev-services.yml.example .dev-services.yml | ||
| # 2. Uncomment and configure the services your app needs | ||
| # 3. Add .dev-services.yml to .gitignore if it contains sensitive info | ||
| # 4. Run bin/dev - it will check services before starting | ||
|
|
||
| services: | ||
| # Uncomment and configure the services your application requires: | ||
|
|
||
| # redis: | ||
| # check_command: "redis-cli ping" | ||
| # expected_output: "PONG" | ||
| # start_command: "redis-server" | ||
| # install_hint: "brew install redis (macOS) or apt-get install redis-server (Linux)" | ||
| # description: "Redis (for caching and background jobs)" | ||
|
|
||
| # postgresql: | ||
| # check_command: "pg_isready" | ||
| # expected_output: "accepting connections" | ||
| # start_command: "pg_ctl -D /usr/local/var/postgres start" # macOS; Linux: sudo service postgresql start | ||
| # install_hint: "brew install postgresql (macOS) or apt-get install postgresql (Linux)" | ||
| # description: "PostgreSQL database" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # React on Rails Pro License Token | ||
| # Get a free license: Contact team@shakacode.com or justin@shakacode.com | ||
| # Create a GitHub PAT with 'read:packages' scope | ||
| REACT_ON_RAILS_PRO_TOKEN=ghp_your_github_token_here | ||
|
|
||
| # Node Renderer Configuration (optional) | ||
| # RENDERER_URL=http://localhost:3800 | ||
| # RENDERER_PASSWORD=tanstack-demo-renderer | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| # RENDERER_PORT=3800 | ||
| # RENDERER_LOG_LEVEL=debug | ||
| # NODE_RENDERER_CONCURRENCY=3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Ignore bundler cache | ||
| .bundle | ||
|
|
||
| # Ignore node modules | ||
| node_modules/ | ||
|
|
||
| # Ignore Rails artifacts | ||
| log/* | ||
| tmp/* | ||
| !log/.keep | ||
| !tmp/.keep | ||
|
|
||
| # Ignore generated assets | ||
| /public/packs | ||
| /public/packs-test | ||
| /ssr-generated | ||
|
|
||
| # Ignore TanStack Router generated files | ||
| app/javascript/src/routeTree.gen.ts | ||
| app/javascript/generated/ | ||
| app/javascript/packs/generated/ | ||
|
|
||
| # Ignore Playwright test results | ||
| test-results/ | ||
| playwright-report/ | ||
|
|
||
| # Ignore environment files | ||
| .env* | ||
| !.env.example | ||
|
|
||
| # React on Rails Pro (contains auth tokens) | ||
| react-on-rails-pro/.npmrc | ||
| react-on-rails-pro/node_modules/ | ||
|
|
||
| # Ignore master key | ||
| config/master.key | ||
|
|
||
| # Ignore credentials | ||
| config/credentials/*.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Omakase Ruby styling for Rails | ||
| inherit_gem: { rubocop-rails-omakase: rubocop.yml } | ||
|
|
||
| # Overwrite or add rules to create your own house style | ||
| # | ||
| # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` | ||
| # Layout/SpaceInsideArrayLiteralBrackets: | ||
| # Enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| source "https://rubygems.org" | ||
|
|
||
| # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" | ||
| gem "rails", "~> 8.0.3" | ||
| # The modern asset pipeline for Rails [https://github.com/rails/propshaft] | ||
| gem "propshaft" | ||
| # Use postgresql as the database for Active Record | ||
| gem "pg", "~> 1.1" | ||
| # Use the Puma web server [https://github.com/puma/puma] | ||
| gem "puma", ">= 5.0" | ||
| # Build JSON APIs with ease [https://github.com/rails/jbuilder] | ||
| gem "jbuilder" | ||
|
|
||
| # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] | ||
| # gem "bcrypt", "~> 3.1.7" | ||
|
|
||
| # Windows does not include zoneinfo files, so bundle the tzinfo-data gem | ||
| gem "tzinfo-data", platforms: %i[ windows jruby ] | ||
|
|
||
| # Reduces boot times through caching; required in config/boot.rb | ||
| gem "bootsnap", require: false | ||
|
|
||
| # JavaScript bundling with Webpack/Rspack | ||
| gem "shakapacker", "~> 9.3.0" | ||
|
|
||
| # React integration for Rails with SSR support | ||
| gem "react_on_rails", "16.2.0.rc1" | ||
|
|
||
| # React on Rails Pro - Node Renderer for production-grade SSR (REQUIRED) | ||
| # TanStack Router requires Node.js APIs (setTimeout, clearTimeout, etc.) | ||
| # that are not available in the default ExecJS environment. | ||
| gem "react_on_rails_pro" | ||
|
|
||
| # Colored terminal output for build scripts | ||
| gem "rainbow" | ||
|
|
||
| # Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] | ||
| gem "thruster", require: false | ||
|
|
||
| group :development, :test do | ||
| # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem | ||
| gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" | ||
|
|
||
| # Static analysis for security vulnerabilities [https://brakemanscanner.org/] | ||
| gem "brakeman", require: false | ||
|
|
||
| # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] | ||
| gem "rubocop-rails-omakase", require: false | ||
| end | ||
|
|
||
| group :development do | ||
| # Use console on exceptions pages [https://github.com/rails/web-console] | ||
| gem "web-console" | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.demo-metadata.yml is out of sync with the demo’s actual versions (it still claims shakapacker_version 9.3.4 and react_on_rails_version 16.2.0.rc1). Update these fields to match the Gemfile.lock/package.json so automation or docs generated from this metadata stays correct.