Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9153 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 139 139
Lines 4071 4077 +6
=======================================
+ Hits 4035 4041 +6
Misses 36 36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
17 of 22 tasks
Importmap::Map#cache_sweeper(watches:) builds a new watcher on each call, so an engine that passed its own directory replaced ActiveAdmin's. The sweeper is now built once in after_initialize from this list, which engines and config/initializers can extend. Co-Authored-By: Clanker
A request made from an earlier after_initialize hook ran before the sweeper existed. The spec now edits an existing file instead of relying on a new one, and restores the boot-time sweeper. Co-Authored-By: Clanker
senid231
force-pushed
the
importmap-watches
branch
from
November 12, 2026 11:20
d891b68 to
fbccf36
Compare
The sweeper reads the list once in after_initialize, so a directory added later, for example from to_prepare, was silently never watched. Co-Authored-By: Clanker
senid231
added a commit
to activeadmin-plugins/active_admin_scoped_collection_actions
that referenced
this pull request
Nov 12, 2026
Replacing ActiveAdmin's cache sweeper outright drops directories other engines register through importmap_watches (activeadmin/activeadmin#9153). Rebuild the sweeper only when that setting is missing. Co-Authored-By: Clanker
A plain frozen array already rejects late appends. The setting's comment now says to append from an initializer. Co-Authored-By: Clanker
This branch has not been deployed
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.
Adds
config.importmap_watches, the directories whose JavaScript changes clear theActiveAdmin.importmapcache in development and test. It starts with Active Admin's ownapp/javascript.Importmap::Map#cache_sweeper(watches:)builds a new watcher on each call, so an engine passing its own directory replaced Active Admin's. Now engines append to the list, and Active Admin builds the sweeper once inafter_initialize. That also lets the host append fromconfig/initializers/active_admin.rb, which runs after engine initializers.Things a reviewer may ask:
cache_sweeper(watches:)itself loses its watcher to the one built inafter_initialize. It should append toimportmap_watchesinstead.FrozenError. The setting's comment and the docs say to append from an initializer. A late append, for example fromconfig.to_prepare, would otherwise never be watched.Gem.path, so only path gems and in-app engines benefit.Application#settingsdups the default per application, as Add javascript_modules setting to import modules on every page #9148 does forjavascript_modules. The two PRs conflict on that line; the resolution keeps both.Part of #9147. Specs cover the default, the per-application copy, the error on a late append, and a cache clear after editing a file in an added directory.