Skip to content

Take Leaflet.markercluster from npm instead of rails-assets.org - #4836

Merged
CloCkWeRX merged 1 commit into
devfrom
fix/drop-rails-assets
Sep 22, 2026
Merged

CloCkWeRX merged 1 commit into
devfrom
fix/drop-rails-assets

Conversation

@Br3nda

@Br3nda Br3nda commented Sep 22, 2026

Copy link
Copy Markdown
Member

Drops the project's last dependency on rails-assets.org, which is down.

Why

Bundler can't install anything while one of the Gemfile's sources is unreachable. With rails-assets.org down, every CI job fails at bundle install, on every branch, before a single spec runs ("Could not reach host rails-assets.org"). #4835 is failing this way now.

The only gem from there was rails-assets-leaflet.markercluster, the marker clustering used on the places and crop maps.

What changes

  • The cluster plugin comes from npm. leaflet.markercluster is now an npm package. node_modules is already on the asset path, so application.js and application.scss load it from there. CI and Heroku both install npm packages already, via the yarn steps and jsbundling-rails.
  • The maps move from Leaflet 1.5.1 to 1.9.4. The rails-assets gem also brought in rails-assets-leaflet, a second copy of Leaflet at 1.5.1, and that copy was the one being served, shadowing the leaflet-rails gem the Gemfile asks for (>= 1.9.2). With it gone, Leaflet comes from leaflet-rails, as the Gemfile intended, and there's one copy instead of two.
  • The plugin moves from 1.4.1 to 1.5.3. That's its current release, and it supports Leaflet 1.9.

yarn warns that the plugin's leaflet peer dependency is missing. That's expected: Leaflet comes from the gem and is loaded before the plugin, and an npm copy would just duplicate it again.

Checked

  • The lockfile. Only the rails-assets section is removed from Gemfile.lock. It was relocked locally, with no network needed.
  • What's served. The compiled application.js has one Leaflet, 1.9.4, and L.MarkerClusterGroup. application.css has Leaflet's and the cluster plugin's styles, and Leaflet's images resolve through the asset pipeline.
  • The maps, in a browser. A throwaway spec, not committed, checked that the member, crop and places maps each draw, with their markers or clusters, on Leaflet 1.9.4 with the plugin present.
  • Existing specs. The member profile, crop page and places specs pass: 75 examples, 0 failures.

🤖 Generated with Claude Code

rails-assets.org is down, and bundler can't install anything while a
gem's source is unreachable, so CI fails for every branch before a
single spec runs. The one gem from there was
rails-assets-leaflet.markercluster; it now comes from npm, where the
React bundle's packages already come from, and node_modules is already
on the asset path. CI and Heroku both install npm packages.

That gem also brought in rails-assets-leaflet, a second copy of Leaflet
(1.5.1), which shadowed the leaflet-rails gem the Gemfile asks for. With
it gone, the maps get Leaflet 1.9.4 from leaflet-rails, as intended, so
the cluster plugin is its current release, 1.5.3, which supports it.
npm's peer dependency warning for leaflet is expected: Leaflet comes
from the gem, loaded before the plugin.

Co-Authored-By: Claude Opus 5 <[email protected]>
@CloCkWeRX
CloCkWeRX merged commit 6117592 into dev Sep 22, 2026
16 of 17 checks passed
@CloCkWeRX
CloCkWeRX deleted the fix/drop-rails-assets branch September 22, 2026 09:11
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.

2 participants