How rails/jsbundling-rails works
Main Components Identification
a) Input Layer:
• JavaScript source files (app/javascript/*)
• Package management (npm/yarn/pnpm/bun)
• Configuration files (bun.config.js, rollup.config.js, webpack.config.js)
b) Processing Layer:
• Bundler Options (Bun, esbuild, rollup.js, Webpack)
• Build Process
• Watch Mode System
c) Output Layer:
• Asset Pipeline Integration
• Built Assets Location (app/assets/builds)
• Public Assets (public/assets)
Workflow and Integration Points
a) Development Flow:
• Watch mode process
• Build trigger points
• Development server integration
b) Production Flow:
• Assets:precompile integration
• Production build process
• Final asset serving
c) Testing Flow:
• Integration with test:prepare
• Test suite build process
Key Relationships to Highlight
• How the gem integrates with Rails' asset pipeline
• Relationship between package.json scripts and the build process
• Demonstrate how different bundlers plug into the system
• Watch mode feedback loop
Important Notes
Specific details:
• Entry point convention (app/javascript/application.js)
• Output convention (app/assets/builds/application.js)
• Rake task integration points
• Asset pipeline delivery mechanism