Skip to content

chore: modernise asset pipeline #331

@joescottdave

Description

@joescottdave

Replace the Sprockets-based asset pipeline with the modern Rails stack.

Current state

  • Sprockets handles asset compilation and fingerprinting
  • dartsass-sprockets compiles Sass within the Sprockets pipeline
  • JavaScript is served via Sprockets manifests using jquery-rails, jquery-ui-rails, and vendored files (Bootstrap, Popper, underscore)

Target state

  • Propshaft replaces Sprockets — handles only fingerprinting and serving, no transformation
  • cssbundling-rails replaces dartsass-sprockets — runs Dart Sass as a standalone build step
  • importmap-rails or jsbundling-rails (esbuild) replaces the jQuery gems and Sprockets JS manifest — JS is pinned or bundled without gem-wrapped libraries
  • jQuery and Bootstrap sourced from npm or CDN pins rather than gems, allowing version control independent of the Ruby ecosystem

Reference

The ukhpi app has completed an equivalent migration and can be used as a reference implementation.

Out of scope

  • Changes to application behaviour or styling
  • Upgrading jQuery or Bootstrap versions (separate concern)

Acceptance criteria

  • bin/dev compiles CSS and serves JS without Sprockets
  • Asset fingerprinting works in production (rake assets:precompile)
  • No references to dartsass-sprockets, jquery-rails, or jquery-ui-rails remain in the Gemfile
  • Existing styles and JS behaviour are unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions