Skip to content

Remove EOL turbolinks#86

Merged
JuanVqz merged 1 commit into
mainfrom
chore/replace-turbolinks-with-turbo
Jul 9, 2026
Merged

Remove EOL turbolinks#86
JuanVqz merged 1 commit into
mainfrom
chore/replace-turbolinks-with-turbo

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

Removes the EOL turbolinks gem. It is dropped outright, not replaced with a JS framework.

Why

turbolinks has been end-of-life since 2019. This app is a two-page, Sprockets-based form tool with no need for SPA-style navigation, Turbo Frames, or Turbo Streams, so removing it (full page loads) is the right fit.

Adopting turbo-rails was attempted first but reverted: turbo-rails 2.x ships ESM-only JavaScript (export {...}), which cannot be //= required into a Sprockets classic-script bundle — the export is a SyntaxError that breaks the whole application.js. Making Turbo work here would require migrating the asset pipeline to importmap or a JS bundler, which is deliberately out of scope for this cleanup.

Changes

  • Gemfile: remove gem "turbolinks"
  • application.js: drop //= require turbolinks (nothing replaces it)
  • header.js / form.js / utils.js: these handlers were bound inside a turbolinks:load callback. Rebind the interactive handlers (file-input change, navbar/menu clicks, smooth-scroll) via jQuery event delegation on document (bind once, survive full page loads), and run the on-display init (sticky header, read-more visibility) on DOM ready. No dependency on any navigation-library load event.
  • Gemfile.lock + dual-boot Gemfile.next.lock updated

Verification

  • Boots; assets:precompile clean (no turbolinks/turbo in the bundle)
  • Unit tests: 16 runs, 52 assertions, 0 failures
  • rubocop clean (exact CI config), reek clean
  • System test (upload → results → PDF) passes in a real headless Chrome (run locally against Chrome/chromedriver 150) — this is the check that matters for a navigation change

Follow-up

A separate PR will convert the app's JavaScript from jQuery to vanilla JS (kept out of this focused change).

@JuanVqz JuanVqz self-assigned this Jul 9, 2026
turbolinks has been end-of-life since 2019. This app is a two-page,
Sprockets-based form tool with no need for SPA-style navigation, Turbo
Frames, or Streams, so it's dropped outright rather than replaced with a
JS framework. (turbo-rails 2.x ships ESM-only JS that can't be //= require'd
into a Sprockets classic-script bundle, so adopting it here would mean an
importmap/bundler migration -- deliberately out of scope.)

- Gemfile: remove gem "turbolinks"
- application.js: drop //= require turbolinks (nothing replaces it)
- header.js / form.js / utils.js: the handlers previously bound inside a
  turbolinks:load callback; rebind interactive handlers via jQuery event
  delegation on document (bind once, survive full page loads) and run the
  on-display init (sticky header, read-more) on DOM ready. No dependency on
  any navigation-library load event.

Verified locally: boots, assets:precompile clean (no turbolinks/turbo in the
bundle), unit tests 16/52/0, rubocop + reek clean, and the system test
(upload -> results -> PDF) passes in a real headless Chrome.
@JuanVqz JuanVqz force-pushed the chore/replace-turbolinks-with-turbo branch from 34c1443 to 10f065a Compare July 9, 2026 19:02
@JuanVqz JuanVqz changed the title Replace EOL turbolinks with turbo-rails (Hotwire Turbo) Remove EOL turbolinks Jul 9, 2026
@JuanVqz JuanVqz marked this pull request as ready for review July 9, 2026 19:27
@JuanVqz JuanVqz merged commit 3247f86 into main Jul 9, 2026
2 checks passed
@JuanVqz JuanVqz deleted the chore/replace-turbolinks-with-turbo branch July 9, 2026 19:33
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