forked from shakacode/react_on_rails
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] master from shakacode:master #128
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
pull
wants to merge
1,047
commits into
stackriot:master
Choose a base branch
from
shakacode:master
base: master
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
Conversation
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
fb78ec9
to
b7ea684
Compare
This file currently does nothing due to the TODO, but can as well fix an issue to avoid distraction later. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Corrected spelling errors in logging messages for improved clarity. - Updated log entry filtering to ensure accurate functionality during tests. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Reworks error reporting and tracing integrations to: 1. Allow the configuration script to provide any options to the services according to the user's requirements. 2. Allow integration of other services without modifying the renderer code. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced enhanced error reporting and tracing capabilities with integrations for Honeybadger and Sentry. - Added support for streaming server rendering, optimizing performance for React components. - New helper methods for capturing and replaying console logs during server rendering. - Added new configuration options for managing error handling during server rendering. - Enhanced ESLint configuration for better TypeScript support. - New functions for error and message notification management in the API. - **Bug Fixes** - Improved error handling during server rendering and within suspense boundaries. - **Documentation** - Updated documentation on error reporting and tracing integration, including example usage. - **Chores** - Updated dependency versions and configuration options for improved flexibility and compatibility. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alexey Romanov <[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced support for streaming server rendering, enhancing performance and enabling progressive page loading. - Added the ability to replay console logs during server rendering for improved debugging. - New configuration options for better error handling during server rendering. - **Bug Fixes** - Updated JavaScript dependencies and adjusted default bundle paths for consistency. - **Chores** - Updated the `CHANGELOG.md` to reflect significant changes and version updates. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Upgrade Fastify and its plugins to v5. Since it doesn't work on Node versions before 20, we check for the incompatible versions explicitly and fail with an error message saying how to solve it. Fixes #475. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated dependency version constraints for improved compatibility with newer versions of packages. - **New Features** - Introduced a new function to extract the major version number from a version string. - Added error handling for incompatible Node.js and Fastify versions in the rendering function. - Enhanced type definitions for better alignment with existing structures. - Overhauled error reporting and tracing integrations for improved error handling. - Upgraded Fastify to version 5, with an option to revert to version 4 for compatibility. - Improved server rendering capabilities with enhanced error handling and support for replaying console logs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alexey Romanov <[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced two new environment variables, `INCLUDE_TIMER_POLYFILLS` and `REPLAY_SERVER_ASYNC_OPERATION_LOGS`, for enhanced configuration control. - **Bug Fixes** - Improved handling of the `supportModules` property based on the new environment variables. - **Chores** - Minor adjustments made to maintain existing functionality, including password masking and restart interval management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
At least according to `yarn audit`, removing all resolutions actually removes some vulnerabilities. Cleaned up some Dependabot issues in addition. We can check if any new ones appear after merging it. Unfortunately, there doesn't seem to be a way to trigger a Dependabot run _before_ merging. Fixes #463. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Chores** - Updated resolutions in the main `package.json` for improved dependency management. - Removed the `tape-async` dependency to streamline the project. - Removed `resolve-url-loader` from the `spec/dummy/package.json` for better maintenance. - Updated `concurrently` and `fs-extra` versions in `package.json` for enhanced performance. - Replaced `sleep-promise` with `delay` in the codebase for better asynchronous handling. - Introduced a new `delay` utility function for managing asynchronous delays. - Enhanced debugging instructions in `CONTRIBUTING.md` with new flags and clearer guidelines. - Modified `debug` script in `package-scripts.yml` to improve source map handling. - Streamlined error handling and logging in the request processing logic for improved clarity. - Revised `docs/node-renderer/debugging.md` for clearer debugging guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alexey Romanov <[email protected]>
Fixes some Dependabot alerts. Co-authored-by: Alexey Romanov <[email protected]>
Fixes #467. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Enhanced error reporting with simplified logging and new process event listeners for uncaught exceptions and unhandled promise rejections. - Improved logging structure using the `pino` library for better performance and flexibility. - Added support for streaming server rendering of React components. - Introduced a new logging level configuration for more granular control. - Updated configuration management to include new logging properties. - **Bug Fixes** - Refined error handling during asset copying with more detailed logging. - **Documentation** - Updated CHANGELOG to reflect recent changes and improvements in logging and error handling. - **Chores** - Updated dependencies, including the removal of `winston` and the addition of `pino-pretty` for development use. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alexey Romanov <[email protected]>
* check both root & client packages * add logging methods instead of changing raise methods
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced logging configuration to omit process ID and hostname from log output. - Conditional transport settings for development and test environments, improving log readability. - **Bug Fixes** - Improved error handling for missing dependencies in the logging setup. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Allow error reporting/tracing integrations to add hooks and plugins to Fastify. Fixes #472. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Enhanced documentation for error reporting and tracing, including new sections for Honeybadger and Fastify integrations. - Added methods for Fastify integration and error/message notification. - Introduced `configureFastify` and `setupTracing` methods to streamline Fastify and tracing service setup. - New optional parameters for Fastify integration in existing methods. - Extended interfaces to support Sentry's context in tracing and unit of work options. - **Bug Fixes** - Improved error handling and logging for Fastify integration with Honeybadger and Sentry. - **Documentation** - Comprehensive updates and examples for integrating error reporting and tracing services. - **Dependency Updates** - Updated `@honeybadger-io/js` package version in `devDependencies`. - **Linting Enhancements** - Updated ESLint configuration to enforce stricter import rules for integration files. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alexey Romanov <[email protected]>
Recommended by Honeybadger docs: https://docs.honeybadger.io/lib/javascript/guides/environments-and-versions/
Fixes shakacode/react_on_rails_pro#457. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated links in the home-pro documentation for improved clarity and formatting. - Added release notes for version 4.0, detailing new features, performance improvements, and breaking changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Alexey Romanov <[email protected]>
* Enable use as a Git dependency * Allow URLs and other local paths in version checker --------- Co-authored-by: Alexey Romanov <[email protected]>
When I tried to use a Git branch of the Node Renderer in Popmenu, it failed because the package isn't built after downloading. This PR fixes the issue. It should work for all package managers consuming this package: * npm runs both `prepare` and `prepack` (and I think prepack is the more recommended) for Git dependencies; * Yarn v1 runs only `prepare` * Yarn v2+ runs only `prepack` * pnpm doesn't document it anywhere I could find, but probably still runs one of them. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Introduced a new `prepack` script for enhanced build processes prior to packaging. - Added streaming server rendering support with new helper methods for improved performance and debugging. - **Improvements** - Updated the `build` script to be categorized under `default`, maintaining its existing functionality while improving organization. - Enhanced error handling during server rendering with new configuration options. - Transitioned logging mechanism to Pino for better integration with Fastify. - Updated project to enable usage as a `git:` dependency. - Shifted dependencies from local paths to GitHub repository URLs for better version control. - **Documentation** - Updated `CHANGELOG.md` to reflect recent changes and enhancements, including versioning updates and detailed modifications. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Alexey Romanov <[email protected]>
* Add specs, better error handling * Added docs, changelog, better messages
- Added Yarn version 1.22.22 for consistency across environments.
…plete history preservation This commit implements Phase 2 of the monorepo merger plan: - Merge react_on_rails_pro repository using git subtree add to preserve complete git history - Update LICENSE.md to include react_on_rails_pro/ directory as Pro-licensed - Maintain strict license compliance with clear directory boundaries - Preserve dual CI systems (GitHub Actions + CircleCI) temporarily - Add checklist for post-merge CI fixes that may be needed - All pro files properly contained in react_on_rails_pro/ subdirectory - Core package functionality remains unchanged at root level The merge preserves all 666+ commits from the pro repository while maintaining the complete history of the core repository. Both packages can build independently and CI systems are operational. Next: Address any CI failures and proceed to Phase 3 (workspace structure). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit addresses the CI issues by: **GitHub Actions fixes:** - Exclude react_on_rails_pro/ directory from RuboCop linting in .rubocop.yml - Exclude react_on_rails_pro/ directory from ESLint linting in eslint.config.ts - GitHub Actions now only lints core package files as intended **CircleCI fixes:** - Move .circleci/config.yml from react_on_rails_pro/ to root (preserving git history) - Add working_directory: react_on_rails_pro to all pro package commands - Update all cache keys to use pro-specific prefixes to avoid conflicts - Update all file paths to reference react_on_rails_pro/ subdirectory - CircleCI now properly runs pro package tests from monorepo structure **Key changes:** - Core package linting excludes pro directory completely - Pro package CI runs from root with working_directory specified - Cache keys differentiated (v4-pro-*) to prevent conflicts - All artifact and bundle paths updated for new structure - Git history preserved for CircleCI config via git mv This enables both CI systems to run independently: - GitHub Actions: Tests core package only - CircleCI: Tests pro package only 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Change react-on-rails dependency from published version to local file:../node_package to ensure pro package uses the monorepo version during development and testing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update react_on_rails_pro gemspec to use local gem dependency - Update development dependencies to use local gem path - Update dummy app package.json to use local npm package - Add CircleCI build-core-package job to build React on Rails package - Share built package via workspace to all pro jobs - Ensure all pro jobs depend on build-core-package for local dependencies 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update pro package.json to use yalc link instead of file: path - Update dummy app package.json to use yalc link - Update ExecJS dummy app package.json to use yalc link - Update CircleCI to publish core package with yalc and add to pro packages - Configure workspace sharing via ~/.yalc instead of node_package/lib 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Move yalc logic to link-source scripts instead of CI - Add link-source script to pro package.json to build and publish both packages - Update dummy app link-source to build core package first then pro package - Update dummy app preinstall to add react-on-rails via yalc - Revert CircleCI changes to use link-source scripts for yalc management - Keep build-core-package job but remove yalc publishing from CI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Since link-source scripts now handle building and yalc publishing: - Remove build-core-package job (no longer needed) - Remove all build-core-package dependencies from workflow - Remove workspace sharing (yalc handles package distribution) - Keep existing cache strategy for node_modules directories - Simplify CircleCI workflow to rely on preinstall hooks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add react_on_rails_pro/ to .prettierignore to prevent prettier from checking pro package files during core package linting in GitHub Actions. Fixes: https://github.com/shakacode/react_on_rails/actions/runs/18015295891/job/51258566516 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…-compatible-dummy app
Mark all Phase 2 tasks and CI fixes as completed: - All git subtree merge tasks completed - All CI configuration fixes completed - All linting tool exclusions configured - All local dependency management set up - All post-merge CI fixes resolved - Update reference document status to Phase 2 Complete Phase 2 is now complete with all CI passing for both packages. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Based on Phase 2 implementation experience, add crucial guidance: CORRECTIONS: - Fix git subtree command (remove --squash to preserve individual commits) - Correct branch workflow (create branch FIRST before any work) - Update duration estimate (2-3 days, 1-2 with lessons learned) LESSONS LEARNED: 1. Branch management workflow corrections 2. Git subtree best practices 3. Complete linting tool configuration requirements 4. Yalc vs file: dependency management approach 5. Multiple dummy apps that need updates 6. CircleCI optimization strategies 7. Local dependency management patterns These lessons will significantly speed up future monorepo merger implementations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Correct Phase 2 git strategy to use filter-repo approach Update merger plan to reflect the actual commands used: STRATEGY CHANGE: - Replace git subtree approach with git filter-repo + merge - Use git filter-repo --to-subdirectory-filter for better file history - Use git merge --allow-unrelated-histories for clean integration BENEFITS OF FILTER-REPO APPROACH: - Better file history browsing with git log --follow - Cleaner history integration compared to subtree prefixing - No issues with path-based git operations - Easier to browse pro file history with no problems This approach was actually used in the implementation and provides superior file history preservation and browsing experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Phase 2: Merge react_on_rails_pro repository via git subtree with complete history preservation
* add examples make renderer runnable on one process Modify example views to pass props to components and add integration tests for async rendering functionality. Revert "make renderer runnable on one process" This reverts commit 91efa37a665f836b05a116e6548ef809d956a67c. Update Gemfile and package.json to use the master branch of react_on_rails Update component source paths and improve menu link labels for clarity revert changes to react on rails dependency * Add 'use client' directive to AsyncRenderFunction components for client-side rendering support --------- Co-authored-by: Example User <[email protected]>
* Phase 3: Prepare core package for workspace structure - Create packages/react-on-rails/ directory structure - Move entire node_package/src/ to packages/react-on-rails/src/ (including pro/) - Create packages/react-on-rails/package.json with workspace configuration - Update root package.json to workspace manager with workspaces config - Update tsconfig.json to build from packages/react-on-rails/src/ - Update LICENSE.md with new package paths including pro directory - Update CI workflows to publish from workspace directory - Update dummy app scripts to use workspace build and publish process 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix CI failures: Update Knip config and test imports for workspace structure - Update Knip configuration to look for source files in packages/react-on-rails/src/ instead of node_package/src/ - Update all test import paths from ../src/ to ../../packages/react-on-rails/src/ - Fix dead code detection issues that were causing CI failures - Verify Knip passes locally in both normal and production modes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix package.json workspace configuration for publishing - Fixed root package.json to support both workspace management and publishing - Restored peerDependencies, files, and export fields to root package - Made workspace package private and simplified scripts - Tests pass and build successful 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix workspace configuration for publishing and CI - Made root package private workspace manager - Made workspace package publishable with proper exports - Fixed CI workflow to pack from workspace package only - Updated build to copy lib output to workspace package - Fixed all package paths to be relative to workspace package 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix Knip configuration to ignore build output directories - Added ignore patterns for packages/react-on-rails/lib/** and node_package/lib/** - Added /packages/*/lib to .gitignore to exclude workspace build outputs - Resolves Knip dead code detection failures for build artifacts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix ESLint configuration for workspace package imports - Added import/extensions rule override for packages/react-on-rails/src/**/* - Allows TypeScript files to use .ts extensions in imports (ignorePackages) - Resolves 111 ESLint import/extensions violations after workspace migration - Matches existing node_package/**/* rule configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix Jest configuration for workspace and testing library setup - Convert jest.config.js to jest.config.mjs for ES module compatibility - Add setupFilesAfterEnv: ['@testing-library/jest-dom'] for custom matchers - Resolves toBeInTheDocument TypeScript errors in test files - Fixes @testing-library/react import resolution issues - All JavaScript tests now pass on Node 20/22 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix Jest setupFilesAfterEnv path resolution for CI - Use explicit path <rootDir>/node_modules/@testing-library/jest-dom - Resolves module resolution issues when Jest runs from workspace directory - Fixes "Module @testing-library/jest-dom was not found" error in CI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update Gemfile.lock and package.json for path corrections * Update script/convert for workspace structure - Update Jest command modification to target workspace package.json - Add workspace package peerDependencies React version updates - Add clarifying comment about dev dependencies location - Ensures convert script works correctly with Phase 3 workspace structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Remove setupFilesAfterEnv from Jest configuration and clean up convert script by removing outdated React version updates for workspace packages. This streamlines the configuration and ensures compatibility with the latest React version. * Update CircleCI configuration to enhance caching strategy for node_modules directories. Added additional checksum for yarn.lock to restore cached directories, improving build performance and reliability. * Update package.json to simplify link-source script by removing redundant path navigation. This change streamlines the build process for the dummy application. * Update link-source script in package.json to target the correct directory for improved build process in the dummy application. * Update build output path to workspace package directory - Changed TypeScript outDir from node_package/lib to packages/react-on-rails/lib - Simplified workspace package build script (no more copying from old location) - Updated package-scripts.yml prepack checks to use new build path - Removed old node_package/lib reference from Knip configuration - Build output now goes directly to the publishable workspace package 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Complete workspace migration: move tests, scripts, and babel config **File Moves:** - Move node_package/tests/* -> packages/react-on-rails/tests/ - Move node_package/scripts/* -> packages/react-on-rails/scripts/ - Move node_package/babel.config.js -> packages/react-on-rails/babel.config.cjs - Remove empty node_package/ directory **Path Updates:** - Updated all test import paths from ../../packages/react-on-rails/src -> ../src - Updated jest.setup.js mock paths to use relative imports - Updated Jest config setupFiles and moduleNameMapper paths - Updated Knip babel config and ignore file paths - Updated root package.json release script paths - Updated script/convert for new workspace structure **Configuration Fixes:** - Renamed babel.config.js to babel.config.cjs for ES module compatibility - Added React and TypeScript presets to babel config - Fixed workspace package test command to run from root **Result:** - Workspace package is now fully self-contained with src/, tests/, scripts/, lib/ - All tests pass when run from root: yarn test - Git history preserved for all moved files - Build output goes to packages/react-on-rails/lib/ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Refactor package.json scripts to utilize workspaces for improved command execution - Updated scripts in both root and react-on-rails package.json to use `yarn workspaces run` for consistency and better management. - Adjusted test, clean, start, prepack, prepare, prepublishOnly, build, build-watch, check, type-check, and release scripts accordingly. This change enhances the build process and ensures all commands are executed within the context of the workspace. * Enhance package.json scripts for improved workspace management - Added new scripts for `yalc:publish`, `yalc`, and `publish` in the root package.json to streamline publishing processes. - Updated the react-on-rails package.json to utilize `yalc` commands and removed redundant `start` script for clarity. These changes improve the overall command execution and maintain consistency across the workspace. * Rename package to react-on-rails-workspace and streamline scripts in package.json - Updated the package name from `react-on-rails` to `react-on-rails-workspace` for clarity. - Adjusted script entries to maintain consistency, including reordering and removing redundant entries. These changes enhance the organization and clarity of the package configuration. * Update CircleCI configuration to streamline caching for node_modules directories * Update Knip configuration and package.json scripts for improved path consistency - Adjusted Knip configuration to point to the correct test and script directories within the packages/react-on-rails structure. - Updated package.json scripts to use relative paths for release commands, ensuring consistency across the workspace. These changes enhance the organization and clarity of the project structure. * Revert unnecessary file extension changes - Revert babel.config.cjs back to babel.config.js (CommonJS works fine in workspace) - Remove unnecessary React/TypeScript presets from babel config - Update knip.ts to reference correct babel config path - Keep jest.config.mjs (ES module extension is actually required) Testing confirmed: - babel.config.js works with CommonJS syntax in workspace package - React/TypeScript presets were unnecessary (ts-jest handles JSX/TSX) - All tests pass with simplified configuration - jest.config.js extension causes "Cannot use import statement" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Add global Jest configuration and refactor Knip settings - Introduced a new global Jest configuration file (jest.config.base.js) for consistent testing settings across the monorepo. - Removed the outdated jest.config.mjs file to streamline configuration management. - Updated Knip configuration in knip.ts to enhance workspace management, including clearer entry and ignore patterns for the root and package-specific settings. - Adjusted package.json scripts in the react-on-rails package to simplify test execution. These changes improve the organization and maintainability of the testing setup and workspace structure. * Update ESLint configuration to reflect new package structure - Modified ESLint ignore patterns to accommodate the new directory structure, changing references from 'node_package' to 'packages/*'. - Updated file patterns for linting and testing to ensure consistency across all packages. These changes enhance the ESLint setup, aligning it with the recent restructuring of the project. * Update configuration files to reflect package structure changes - Removed references to 'node_package' in .gitignore, .prettierignore, and tsconfig.json to align with the new directory structure. - Updated Jest configuration comments for clarity. These changes enhance consistency across the project and ensure proper file management in the updated workspace. * Update MONOREPO_MERGER_PLAN.md to reflect co-located test structure - Update target architecture to show tests within package directories - Modify Phase 3-5 tasks to reflect new test organization approach - Simplify license compliance framework for co-located tests - Update documentation examples to clarify test/spec inclusion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Update documentation and references to reflect new package structure - Updated paths in CHANGELOG.md, CLAUDE.md, CODING_AGENTS.md, CONTRIBUTING.md, LICENSE.md, and various documentation files to replace 'node_package' with 'packages/react-on-rails'. - Adjusted links and comments in the codebase to align with the new directory structure. - Enhanced clarity and consistency across documentation regarding the project's organization. These changes ensure that all references are accurate and up-to-date with the recent restructuring of the project. * Update test command in convert script for improved execution - Modified the test command in the convert script to simplify the execution process by removing unnecessary path references. - Ensured compatibility with the new test structure by updating the command to reflect the current organization. These changes enhance the clarity and efficiency of the testing setup in the project. * Update Knip configuration and package.json scripts for improved execution - Added 'nps' to the ignoreBinaries in Knip configuration to prevent unnecessary warnings. - Updated the start script in package.json to use 'nps' for better script management. These changes enhance the efficiency and clarity of the project's script execution. * Update test command in package.json for improved execution - Modified the test command in package.json to specify the 'tests' directory, enhancing clarity and ensuring compatibility with the current test structure. This change improves the testing setup by clearly defining the test location. * Update DIRECTORY_LICENSING.md to reflect new directory structure - Changed references from 'packages/react-on-rails/src/' to 'node_package/src/' for clarity and consistency with the updated project organization. - Updated the exception note to accurately describe the licensing of the Pro implementation code. These changes ensure that the licensing documentation is aligned with the recent restructuring of the project. * Update DIRECTORY_LICENSING.md to reflect new directory structure and test organization - Revised directory structure descriptions to include specifications for Ruby and NPM packages, as well as integration tests. - Clarified the organization of Pro implementation code and its associated tests. These updates ensure that the licensing documentation accurately represents the current project structure and testing framework. * Update CONTRIBUTING.md to correct link formatting - Revised the link to `clientStartup.ts` for clarity and accuracy in the testing example. - Adjusted the link for `serverRenderReactComponent.ts` to ensure proper navigation. These updates enhance the documentation by providing clearer references for contributors. * Update MONOREPO_MERGER_PLAN.md to specify new build output locations for Pro packages - Added a note indicating that Pro packages will now output to `packages/react-on-rails-pro/lib/` and `packages/react-on-rails-pro-node-renderer/lib/`. - This update clarifies the expected output structure following the initial merge, ensuring proper organization and compliance with licensing requirements. * Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to reflect completion of Phase 3 - Marked Phase 3 as complete in the merger plan reference document. - Updated task list in the main merger plan to indicate completion of all tasks related to the preparation of the core package for the workspace structure. These changes ensure that the merger plan accurately reflects the current status of the project and the progress made in restructuring. * Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to reflect changes in merger phases and package structure - Updated the implementation plan to outline an 8-phase process for merging the `react_on_rails` and `react_on_rails_pro` repositories. - Adjusted estimated durations and success criteria for various phases to align with the new structure. - Clarified tasks related to the separation of Pro packages and ensured proper licensing compliance. These updates provide a clearer roadmap for the merger process and ensure that all documentation reflects the current project status. --------- Co-authored-by: Claude <[email protected]>
This PR adds Conductor support to React on Rails, enabling developers to quickly set up isolated workspaces for parallel development. ## Features added: - **conductor.json**: Main configuration file with multiple script commands - `run`: Starts the dummy app development server (cd spec/dummy && bin/dev) - `test`: Runs the dummy app test suite - `lint`: Runs both Ruby and JavaScript linters - **conductor-setup.sh**: Automated workspace setup script that: - Validates Ruby (>= 3.0) and Node.js (>= 20.0) versions - Installs all dependencies (Ruby gems and JavaScript packages) - Builds the TypeScript package - Sets up git hooks for linting - Copies environment files from the root repository ## Benefits: - Quick workspace creation for parallel development - Automated environment validation and setup - Consistent development environment across team members - Multiple run commands for different workflows 🤖 Generated with Claude Code Co-authored-by: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
* Fix foreman execution in bundler context with intelligent fallback This commit resolves the issue where bin/dev fails when foreman is not included in the Gemfile (following React on Rails best practices). The fix implements an intelligent fallback strategy: 1. First attempt: Try running foreman within bundler context 2. Fallback: Use Bundler.with_unbundled_env to run system-installed foreman 3. Enhanced error handling with helpful user guidance Key improvements: - Maintains compatibility with projects that include foreman in Gemfile - Supports React on Rails best practice of system-installed foreman - Provides clear error messages linking to documentation - Comprehensive test coverage for all fallback scenarios Fixes #1832 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Enhance process manager with universal bundler context fallback This commit generalizes the foreman-specific bundler context fix to work for ALL process managers (overmind, foreman, and any future additions). Key improvements: - Context-aware process detection for all processes, not just foreman - Universal fallback mechanism using Bundler.with_unbundled_env - Consistent API with run_process(process, args) for any process manager - Enhanced test coverage for generalized functionality Benefits: - Robust handling of bundler context for any process manager - Future-proof architecture for new process managers - Consistent behavior across all system commands - Eliminates bundler interceptor issues universally Builds on previous commit to create a comprehensive solution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Optimize process manager performance and robustness This commit improves the process manager implementation with several optimizations: Performance improvements: - Eliminate redundant system calls in run_process_if_available - Streamlined control flow with early returns - More efficient process availability checking Robustness enhancements: - Support multiple version flags per process (--version, -v, -V) - Process-specific version flag mapping for better compatibility - Improved fallback strategy that avoids double execution Code quality: - Cleaner, more readable method structure - Better separation of concerns - Enhanced test coverage for version flag handling - RuboCop compliant code style The implementation is now more efficient and robust while maintaining full backward compatibility and comprehensive bundler context handling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add timeout protection for version checking operations This commit adds a 5-second timeout to all version checking operations to prevent the development setup from hanging indefinitely on unresponsive process managers. Safety improvements: - Timeout protection for installed_in_current_context? checks - Timeout protection for process_available_in_system? checks - Graceful handling of Timeout::Error alongside Errno::ENOENT - Prevents hanging development setup on problematic installations Implementation details: - Uses Ruby's Timeout module with 5-second limit - Only applied to version checking, not main process execution - Main process execution remains unlimited (expected for dev servers) - Comprehensive test coverage for timeout scenarios The timeout is conservative (5 seconds) to account for slow systems while still preventing indefinite hangs that would block developer workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add Bundler API compatibility with DRY helper method Implement with_unbundled_context helper that supports both modern (with_unbundled_env) and legacy (with_clean_env) Bundler APIs, with graceful fallback for very old versions. This addresses backward compatibility concerns while maintaining clean, DRY code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add timeout protection for version checking operations Extract hardcoded timeout value to VERSION_CHECK_TIMEOUT constant for better maintainability and testability. Co-authored-by: Abanoub Ghadban <[email protected]> * Apply CodeRabbit review suggestions - Extract process managers to PROCESS_MANAGERS constant for DRY code - Relax procfile path validation (remove shell metacharacter check) - Refactor tests to use around hook with ensure clause for proper cleanup - Close file descriptors properly to avoid leaks Co-authored-by: Abanoub Ghadban <[email protected]> * Revert process_manager.rb changes from commit 5740b0e - Remove PROCESS_MANAGERS constant (revert to explicit calls) - Revert procfile validation to stricter shell metacharacter check - Keep spec file changes from commit 5740b0e (around hook improvements) Co-authored-by: Abanoub Ghadban <[email protected]> * Fix RSpec/ExpectOutput violations by removing global stream reassignment Remove the around hook that was mutating $stdout/$stderr, which triggered RuboCop's RSpec/ExpectOutput warnings. Tests that need to capture output already use RSpec's .to output(...).to_stderr matcher correctly. Co-authored-by: Abanoub Ghadban <[email protected]> * Update spec/react_on_rails/dev/process_manager_spec.rb Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Remove duplicate RSpec.describe for ProcessManager --------- Co-authored-by: Claude <[email protected]> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Abanoub Ghadban <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…1845) Reorganize documentation into 10 user-journey-based categories (#1845) Why - Previous 11-category structure had confusing catch-all categories (Guides, Additional details, Misc, Javascript) with no clear beginner-to-advanced progression, making information hard to find. - Users needed a structure organized by WHEN and WHY they need info rather than by technology type. Summary - Reorganized 56 documentation files from 11 scattered categories into 10 intent-based categories following the user journey from getting started through building features to deployment. - Preserved all git history using git mv, kept original filenames, and updated 133+ internal documentation links to reflect new paths. - Fixed all broken external GitHub links (shakapacker TypeScript migration, outdated tutorial references). Key improvements - New categories: Getting Started, Core Concepts, Building Features, API Reference, Deployment, Upgrading, Migrating, Pro, Advanced Topics, Misc, Outdated - Split Upgrading (version upgrades) from Migrating (switching from other tools) for clearer navigation - Merged duplicate dependency documentation into single source - Fixed 133+ broken internal links after reorganization - Updated external links to shakapacker TypeScript files (.js to .ts) - Removed references to non-existent react-webpack-rails-tutorial RouterApp files
…1846) Previously, `bin/dev kill` only terminated processes by pattern matching (e.g., "rails", "puma", "webpack-dev-server"). This could miss processes that were holding ports 3000 or 3001 but didn't match the patterns. Now `bin/dev kill` also finds and terminates any process listening on ports 3000 and 3001 using `lsof -ti:PORT`, ensuring a clean restart even when unexpected processes are blocking the development ports. Changes: - Add kill_port_processes(ports) method to find and kill processes on specific ports - Add find_port_pids(port) helper that uses lsof to find PIDs listening on a port - Update kill_processes to call kill_port_processes([3000, 3001]) - Add comprehensive tests for port-killing functionality - Handle edge cases (lsof not found, permission denied) gracefully The port-killing is integrated as default behavior (no --force flag needed) since ports 3000/3001 are explicitly development ports and this matches the existing UX where kill doesn't ask for confirmation.
- Refactored code to move JS Pro-related logic into its own package for better modularity and maintainability. - Updated dependencies and documentation to reflect the new package structure. - Ensured backward compatibility and provided migration instructions where necessary.
* Move Pro Ruby code to MIT license Moved lib/react_on_rails/pro/ code to MIT-licensed locations: - lib/react_on_rails/pro/helper.rb → lib/react_on_rails/pro_helper.rb - lib/react_on_rails/pro/utils.rb → lib/react_on_rails/pro_utils.rb Changes: - Removed Pro license headers from moved files - Changed namespace from ReactOnRails::Pro:: to ReactOnRails:: - Removed Pro warning badge functionality (no longer needed) - Deleted lib/react_on_rails/pro/ directory entirely - Updated LICENSE.md to reflect all lib/react_on_rails/ is MIT - Updated documentation references Benefits: - Ruby signaling code now in MIT gem for marketing visibility - Actual functionality still requires Pro npm package - Clean license boundaries maintained - Users can't bypass Pro features by editing Ruby code * Remove Pro warning badge tests Removed all test contexts for Pro warning badge functionality since the badge feature has been removed from the codebase. Tests removed: - react_component Pro license warning contexts - react_component_hash Pro license warning contexts - redux_store Pro license warning contexts * Revert previous two commits to preserve Pro warning badge * Move Pro Ruby code to MIT license (preserving Pro warning badge) Moved lib/react_on_rails/pro/ code to MIT-licensed locations: - lib/react_on_rails/pro/helper.rb → lib/react_on_rails/pro_helper.rb - lib/react_on_rails/pro/utils.rb → lib/react_on_rails/pro_utils.rb Changes: - Removed Pro license headers from moved files - Changed namespace from ReactOnRails::Pro:: to ReactOnRails:: - PRESERVED Pro warning badge functionality (shows when Pro features used without license) - Deleted lib/react_on_rails/pro/ directory - Updated LICENSE.md to reflect all lib/react_on_rails/ is MIT - Updated documentation references Benefits: - Ruby signaling code now in MIT gem for marketing visibility - Pro warning badge alerts users about Pro features - Actual functionality still requires Pro npm package - Clean license boundaries maintained
* Modernize release process for monorepo - Replace release-it with native Yarn workspace publish commands - Update release rake task to handle both NPM packages (react-on-rails and react-on-rails-pro) - Synchronize versions across gem and both NPM packages - Set react-on-rails-pro to use exact version dependency on react-on-rails - Remove obsolete release scripts from package.json files - Delete packages/react-on-rails/scripts/release - Update documentation with comprehensive release instructions The new release process: 1. Bumps version in lib/react_on_rails/version.rb (source of truth) 2. Updates all 3 package.json files with new version 3. Updates react-on-rails-pro dependency to exact version 4. Commits, tags, and pushes changes 5. Publishes both NPM packages using yarn workspace publish 6. Publishes Ruby gem Benefits: - No external release-it dependency - Both NPM packages properly released - Version sync enforced across all 5 files - Single command releases everything: rake release[X.Y.Z] 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * Fix syntax error and RuboCop violations in release.rake - Remove extra end statement that was causing syntax error - Fix string concatenation to use interpolation - Fix operator precedence ambiguity - Convert multi-line unless blocks to modifier form - Refactor unless/else to if/else for clarity - Fix line length violation - Eliminate duplicate separator line code All RuboCop violations resolved. File now passes bundle exec rubocop with zero offenses. * Add skip_push option to release task - Add 4th argument 'skip_push' to skip git push operations - Useful for testing the release process locally - Commits and tags are still created, but not pushed to remote - Displays warning message when push is skipped - Update documentation with new parameter and example usage Example: rake release[16.2.0,false,npm,skip_push] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add parameter validation for registry and skip_push - Validate registry parameter accepts only: 'verdaccio', 'npm', or empty string - Validate skip_push parameter accepts only: 'skip_push' or empty string - Raise ArgumentError with clear message for invalid values - Prevents silent failures from typos or incorrect usage Examples of errors: rake release[16.2.0,false,foo] → ArgumentError: Invalid registry value 'foo' rake release[16.2.0,false,npm,skip] → ArgumentError: Invalid skip_push value 'skip' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * run bundle on the gem root while releasing * update dependency version of rorp package to 16.1.2 * Revert "update dependency version of rorp package to 16.1.2" This reverts commit 324fb8c. * update dependency version of rorp package to 16.1.1 --------- Co-authored-by: Claude <[email protected]>
Removed links and images for Rails Autoscale and Reviewable.
#1857) * Add offline JWT-based license validation system for React on Rails Pro Implements a pure offline license validation system using JWT tokens signed with RSA-256. No internet connectivity required for validation. Key features: - JWT-based licenses verified with embedded public key (RSA-256) - Offline validation in Ruby gem and Node renderer - Environment variable or config file support - Development-friendly (warnings) vs production (errors) - Zero impact on browser bundle size - Comprehensive test coverage Changes: - Add JWT dependencies (Ruby jwt gem, Node jsonwebtoken) - Create license validation modules for Ruby and Node - Integrate validation into Rails context (rorPro field) - Add license check on Node renderer startup - Update .gitignore for license file - Add comprehensive tests for both Ruby and Node - Create LICENSE_SETUP.md documentation The system validates licenses at: 1. Ruby gem initialization (Rails startup) 2. Node renderer startup 3. Browser relies on server validation (railsContext.rorPro) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add React on Rails Pro license file to .gitignore in multiple locations * add needed licence rake tasks * Require exp field in license validation * Add tests for required exp field validation * Require valid license in all environments (dev, test, prod) Breaking Change: All environments now require valid licenses * Add license validation on startup for both Rails and Node renderer * Change license field from 'license_type' to 'plan' and add 'issued_by' support * Remove obsolete license key file from the dummy config * Add React on Rails Pro license file to .gitignore and Gemfile.lock * Fix require statement in license validator spec to use spec_helper * update yarn.lock * Fix license validator spec by stubbing Rails.logger and Rails.root * Fix Node.js license validator tests and disable auto-expiration check - Add ignoreExpiration: true to jwt.verify() to match Ruby behavior - Mock process.exit globally in tests to prevent actual exit - Mock console.error and console.log to suppress test output - Update all invalid license tests to check process.exit was called - Simplify file-based license test to use ENV variable - All 9 Node.js tests now passing Changes align Node.js validator with Ruby validator: - Both manually check expiration after disabling auto-check - Both call exit/raise on invalid licenses - Both provide consistent error messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove react_on_rails_pro_licence_valid? and consolidate to react_on_rails_pro? * Make react_on_rails_pro? actively validate license and remove backward compatibility * Remove redundant 'before: :load_config_initializers' hook from license validation * Rename validation methods to use ! convention for exception-throwing * Update license public key documentation and source URL * Refactor license validation to remove unnecessary conditional logging * Refactor LicensePublicKey module documentation for clarity and consistency * Refactor LicenseValidator to simplify validation logic and remove unnecessary checks * Refactor Node.js license validator from singleton class to functional pattern * Enhance license data structure and improve security in license validation * Refactor validateLicense to void function for clearer API semantics * Enhance public key update task with local URL handling and add usage instructions * Enhance ReactOnRailsHelper spec by mocking additional utility methods for improved test coverage * Enhance pro features context by allowing multiple message stubs for improved test flexibility * Enhance pro features context by adding support for RSC in immediate hydration * fix TS problems * Enhance license validation test by generating a separate key pair for invalid signature scenario * Refactor license claims in JWT to use standard 'iss' identifier and update related tests for improved clarity and consistency * Implement license expiration handling with a 1-month grace period for production environments and update related tests for clarity and coverage * Add license attribution comment and refactor license validation methods for clarity * Refactor license validation methods to use 'validated_license_data!' for improved clarity and consistency * Add tests for react_on_rails_attribution_comment to verify Pro and open source license comments * Add tests for Pro and open source attribution comments in rendered output * Add tests for single attribution comment inclusion in React on Rails Pro and non-Pro scenarios * Refactor license evaluation logic and improve error handling for missing license * Remove unnecessary setup in pro_attribution_comment tests for cleaner context * Stub ReactOnRailsPro::Utils.pro_attribution_comment for consistent test behavior across all contexts * Update tests to expect HTML comments instead of script tags for React components * Stub ReactOnRailsPro::Utils.pro_attribution_comment for consistent test behavior * Update documentation to clarify license usage and add HTML comment attribution for React on Rails * Refactor license validation logic to use getValidatedLicenseData and update tests for consistency * Update grace period message format to use "day(s)" for consistency in attribution comments --------- Co-authored-by: Claude <[email protected]>
Replaces streaming flaky tests at ReactOnRailsPro `integration_spec.rb`, which use hacks to test the streaming behavior using `capybara,` with `Playwright` tests that support streamed page tests without any hacks.
Consolidates Pro package testing on GitHub Actions alongside the main package, creating 3 new workflow files to replace CircleCI configuration. ## Workflows Created - **pro-lint.yml**: RuboCop, ESLint, Prettier, TypeScript checks - **pro-package-tests.yml**: Jest unit tests, RSpec package tests, webpack builds - **pro-integration-tests.yml**: RSpec integration tests, Playwright E2E tests (with Redis)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )