Repository navigation
Take Leaflet.markercluster from npm instead of rails-assets.org - #4836
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
leaflet.markerclusteris now an npm package.node_modulesis already on the asset path, soapplication.jsandapplication.scssload it from there. CI and Heroku both install npm packages already, via the yarn steps andjsbundling-rails.rails-assets-leaflet, a second copy of Leaflet at 1.5.1, and that copy was the one being served, shadowing theleaflet-railsgem the Gemfile asks for (>= 1.9.2). With it gone, Leaflet comes fromleaflet-rails, as the Gemfile intended, and there's one copy instead of two.yarnwarns that the plugin'sleafletpeer 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
Gemfile.lock. It was relocked locally, with no network needed.application.jshas one Leaflet, 1.9.4, andL.MarkerClusterGroup.application.csshas Leaflet's and the cluster plugin's styles, and Leaflet's images resolve through the asset pipeline.🤖 Generated with Claude Code