Skip to content

Bug/remove unneeded migration - #1111

Closed
lodewiges wants to merge 12 commits into
stagingfrom
Bug/RemoveUnneededMigration
Closed

Bug/remove unneeded migration#1111
lodewiges wants to merge 12 commits into
stagingfrom
Bug/RemoveUnneededMigration

Conversation

@lodewiges

@lodewiges lodewiges commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Remove a migration that broke things

Summary by CodeRabbit

  • Style

    • Updated icon library from Font Awesome 4 to Font Awesome 6, modernizing visual elements throughout the application.
  • Chores

    • Upgraded build and asset pipeline infrastructure for improved performance and maintainability.
    • Modernized application bundling and CSS preprocessing for faster load times.
    • Enhanced development environment with streamlined local server configuration.

@lodewiges lodewiges closed this Nov 2, 2025
@coderabbitai

coderabbitai Bot commented Nov 2, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

The application undergoes a substantial build tooling and frontend architecture migration: Webpacker is replaced with a manual webpack configuration paired with jsbundling-rails and cssbundling-rails; Turbolinks navigation is replaced with Turbo; Font Awesome Rails helpers transition to inline HTML elements; asset inclusion patterns shift from pack tags to explicit script tags; and Babel configuration moves from babel.config.js to .babelrc.

Changes

Cohort / File(s) Summary
Build & Bundling Configuration
.babelrc, webpack.config.js, package.json
Switches from babel.config.js to .babelrc with useBuiltIns: "usage", adds babel-plugin-macros and plugin-transform-runtime. Introduces webpack.config.js with dynamic entry point discovery, Vue and Babel loaders, output to app/assets/builds. Updates package.json: removes @rails/webpacker, turbolinks, vue-turbolinks; adds @hotwired/turbo-rails, @babel/runtime, webpack 5, sass, and build scripts.
Dev Infrastructure
Procfile.dev, bin/dev, bin/webpack, bin/webpack-dev-server
Adds new Procfile.dev defining web, js, and css watch processes; creates bin/dev shell script to manage development server via foreman; removes deprecated bin/webpack and bin/webpack-dev-server Ruby scripts.
Babel Configuration Removal
babel.config.js
Deletes babel.config.js, consolidating configuration into .babelrc.
Webpack Configuration Cleanup
config/webpack/*, config/webpacker.yml
Removes all webpacker environment configs (development.js, environment.js, loaders/eslint.js, luxproduction.js, production.js, staging.js, test.js) and webpacker.yml; webpack configuration now centralized in webpack.config.js at project root.
Rails Asset Configuration
config/initializers/assets.rb, app/assets/config/manifest.js
Updates assets.rb to replace node_modules paths with app/assets/builds; changes manifest.js from link_directory to link_tree for builds.
Environment & Development Config
config/environments/development.rb, config/environments/production.rb, config/puma.rb
Removes webpacker yarn integrity checks and inline Sass source maps configuration; updates puma.rb comment.
Old Asset Pack Files Removed
app/javascript/packs/*
Deletes activity.js, credit_mutations.js, invoices.js, payment_add.js, user.js, users.js, and application.js (formerly Webpacker entry points with Vue setup and Turbolinks integration).
New Frontend JS Modules
app/javascript/activities.js, app/javascript/activity.js, app/javascript/application.js, app/javascript/credit_mutations.js, app/javascript/invoices.js, app/javascript/order_screen.js, app/javascript/payment_add.js, app/javascript/price_lists.js, app/javascript/user.js, app/javascript/users.js
Replaces pack files with individual modules: turbolinks:load events change to turbo:load; removes TurbolinksAdapter and VueResource; adds turbo:before-cache cleanup hooks; refactors data bindings and event handling for Turbo compatibility; introduces window.flash() utility and isFormInvalid() helper.
Asset Inclusion in App JS
app/assets/javascripts/application.js
Deletes entire Sprockets manifest including require directives, Turbolinks event listeners, and WebFont config.
Stylesheet Updates
app/assets/stylesheets/application.scss, app/assets/stylesheets/order_screen.scss
Updates Bootstrap import paths to scss/bootstrap; replaces font-awesome dependency with @fortawesome/fontawesome-free SCSS modules (fontawesome, solid, brands).
View Layer: Icon & Asset Tag Migrations
app/views/activities/_credit_mutation_modal.html.erb, app/views/activities/index.html.erb, app/views/activities/order_screen.html.erb, app/views/activities/show.html.erb, app/views/credit_mutations/index.html.erb, app/views/index/index.html.erb, app/views/invoices/index.html.erb, app/views/payments/add.html.erb, app/views/price_lists/index.html.erb, app/views/users/index.html.erb, app/views/users/show.html.erb, app/views/partials/_navigation_bar.html.erb
Replaces all FontAwesome Rails helpers (fa_icon) with inline <i class="fas fa-..."> elements; adds content_for :head blocks to include individual JS assets with data-turbo-track and defer attributes.
Layout Templates
app/views/layouts/application.html.erb, app/views/layouts/errors.html.erb
Replaces pack_tag calls with single stylesheet_link_tag and javascript_include_tag for "application"; updates turbolinks-track to turbo-track; adds defer attribute; introduces yield(:head) hook; consolidates asset inclusion.
Gem Dependencies
Gemfile
Adds cssbundling-rails, dartsass-rails, jsbundling-rails, sprockets-rails, turbo-rails; removes font-awesome-rails, sassc-rails, turbolinks, webpacker.
Generator & Documentation Cleanup
lib/generators/rails/webpacker_assets/*
Removes webpacker assets generator class and usage documentation (USAGE file and webpacker_assets_generator.rb).
Project Config Updates
.gitignore, README.md
Adds /app/assets/builds and !/app/assets/builds/.keep to .gitignore; removes /public/packs, webpacker-related ignores; updates README text (Turbolinks → Turbo, "builtin" → "built-in", phrasing fixes).
Database & Migration
db/migrate/20251026202155_remove_order_total_from_orders.rb, db/schema.rb
Deletes migration that removed orders.order_total column; schema version reverted, order_total column re-added with decimal(8,2) type.

Sequence Diagram

sequenceDiagram
    autonumber
    participant Browser
    participant Rails
    participant OldWebpacker as Old: Webpacker<br/>(Turbolinks)
    participant NewBuild as New: Webpack +<br/>jsbundling-rails<br/>(Turbo)

    rect rgb(200, 220, 255)
    Note over Browser,OldWebpacker: Old Flow (Turbolinks + Webpacker)
    Browser->>Rails: GET /page
    Rails->>OldWebpacker: Load pack_tag(:application)
    OldWebpacker->>Browser: JS bundles + Turbolinks
    Browser->>Browser: Turbolinks intercepts link clicks
    Browser->>Rails: fetch + Turbolinks.visit()
    Rails->>OldWebpacker: Send new HTML
    OldWebpacker->>Browser: Re-render DOM (Turbolinks cache)
    end

    rect rgb(220, 255, 220)
    Note over Browser,NewBuild: New Flow (Turbo + Webpack)
    Browser->>Rails: GET /page
    Rails->>NewBuild: Load application.js (defer)
    NewBuild->>Browser: Turbo + individual modules
    Browser->>Browser: Turbo intercepts link clicks
    Browser->>Rails: fetch + Turbo.visit()
    Rails->>NewBuild: Send new HTML
    NewBuild->>Browser: Re-render + fire turbo:load
    Browser->>Browser: Module listeners (turbo:load)
    Browser->>Browser: Vue instances initialize
    end

    rect rgb(255, 240, 200)
    Note over Browser,NewBuild: Pre-Cache Cleanup
    Browser->>Browser: turbo:before-cache fires
    Browser->>Browser: Destroy Vue instances
    Browser->>Browser: Clear event listeners
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

Areas requiring extra attention:

  • webpack.config.js: New configuration file introducing dynamic entry point discovery, multiple loaders, and plugin setup; verify entry point logic correctly scans app/javascript and output paths align with Rails asset pipeline expectations.
  • app/javascript/* (new modules): Multiple files refactored from pack-based to individual modules; review Turbo event binding (turbo:load vs turbolinks:load), turbo:before-cache cleanup hooks, and Vue instance lifecycle management to prevent memory leaks and race conditions.
  • View updates (icon replacements & asset tags): Widespread changes replacing fa_icon helpers with inline HTML; verify Font Awesome icon class mappings are correct (e.g., fa_icon 'refresh' → fas fa-arrows-rotate) and content_for :head blocks are properly ordered.
  • Layout templates (application.html.erb): Consolidation of pack_tag calls into single asset tags; ensure defer and data-turbo-track attributes don't break asset loading order or SPA behavior.
  • Gemfile & Babel/.babelrc: Verify polyfill and transpilation settings (useBuiltIns: "usage") work correctly across browsers; confirm babel-plugin-macros and transform-runtime don't cause duplication.
  • Turbo migration (activities.js, order_screen.js, others): Changes from Turbolinks-specific code to Turbo; check event names, CSRF token handling, and VueResource → vanilla approaches are compatible with both new and old endpoints.

Poem

🐰 Wheels within wheels, we hop and build,
From packs to modules, the toolbox filled,
Turbo speeds us through the land,
Webpack in hand, so sleek and grand,
Icons shine without the helper's call—
Fresh foundations, we've rebuilt it all!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Bug/RemoveUnneededMigration

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8aeb8 and 87f19e5.

⛔ Files ignored due to path filters (2)
  • Gemfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (61)
  • .babelrc (1 hunks)
  • .gitignore (1 hunks)
  • Gemfile (2 hunks)
  • Procfile.dev (1 hunks)
  • README.md (1 hunks)
  • app/assets/config/manifest.js (1 hunks)
  • app/assets/javascripts/application.js (0 hunks)
  • app/assets/stylesheets/application.scss (1 hunks)
  • app/assets/stylesheets/order_screen.scss (1 hunks)
  • app/javascript/activities.js (3 hunks)
  • app/javascript/activity.js (1 hunks)
  • app/javascript/application.js (1 hunks)
  • app/javascript/credit_mutations.js (1 hunks)
  • app/javascript/invoices.js (1 hunks)
  • app/javascript/order_screen.js (4 hunks)
  • app/javascript/packs/activity.js (0 hunks)
  • app/javascript/packs/credit_mutations.js (0 hunks)
  • app/javascript/packs/invoices.js (0 hunks)
  • app/javascript/packs/payment_add.js (0 hunks)
  • app/javascript/packs/user.js (0 hunks)
  • app/javascript/packs/users.js (0 hunks)
  • app/javascript/payment_add.js (1 hunks)
  • app/javascript/price_lists.js (8 hunks)
  • app/javascript/user.js (1 hunks)
  • app/javascript/users.js (1 hunks)
  • app/views/activities/_credit_mutation_modal.html.erb (1 hunks)
  • app/views/activities/index.html.erb (3 hunks)
  • app/views/activities/order_screen.html.erb (8 hunks)
  • app/views/activities/show.html.erb (3 hunks)
  • app/views/credit_mutations/index.html.erb (3 hunks)
  • app/views/index/index.html.erb (4 hunks)
  • app/views/invoices/index.html.erb (1 hunks)
  • app/views/layouts/application.html.erb (1 hunks)
  • app/views/layouts/errors.html.erb (1 hunks)
  • app/views/partials/_navigation_bar.html.erb (3 hunks)
  • app/views/payments/add.html.erb (1 hunks)
  • app/views/price_lists/index.html.erb (8 hunks)
  • app/views/users/index.html.erb (4 hunks)
  • app/views/users/show.html.erb (5 hunks)
  • babel.config.js (0 hunks)
  • bin/dev (1 hunks)
  • bin/webpack (0 hunks)
  • bin/webpack-dev-server (0 hunks)
  • config/environments/development.rb (2 hunks)
  • config/environments/production.rb (0 hunks)
  • config/initializers/assets.rb (1 hunks)
  • config/puma.rb (1 hunks)
  • config/webpack/development.js (0 hunks)
  • config/webpack/environment.js (0 hunks)
  • config/webpack/loaders/eslint.js (0 hunks)
  • config/webpack/luxproduction.js (0 hunks)
  • config/webpack/production.js (0 hunks)
  • config/webpack/staging.js (0 hunks)
  • config/webpack/test.js (0 hunks)
  • config/webpacker.yml (0 hunks)
  • db/migrate/20251026202155_remove_order_total_from_orders.rb (0 hunks)
  • db/schema.rb (2 hunks)
  • lib/generators/rails/webpacker_assets/USAGE (0 hunks)
  • lib/generators/rails/webpacker_assets/webpacker_assets_generator.rb (0 hunks)
  • package.json (2 hunks)
  • webpack.config.js (1 hunks)

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.

@codecov

codecov Bot commented Nov 2, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.27%. Comparing base (2f8aeb8) to head (87f19e5).
⚠️ Report is 1 commits behind head on staging.

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1111      +/-   ##
===========================================
+ Coverage    74.10%   75.27%   +1.17%     
===========================================
  Files           51       50       -1     
  Lines         1093     1076      -17     
===========================================
  Hits           810      810              
+ Misses         283      266      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lodewiges
lodewiges deleted the Bug/RemoveUnneededMigration branch January 14, 2026 09:22
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