Split out of #21, which is otherwise complete.
The roadmap's "Upstream-first notes" say:
#19 (graph-aware preloading) and #20 (Early Hints) are not fork-specific; propose them to rails/importmap-rails after they land here so the next sync shrinks the diff. #14, #15, #16, #17, #18 lean on fork provenance or on behaviour upstream has declined.
Both have landed here and neither has been proposed upstream.
What to propose
Graph-aware preloading (#19) — config.importmap.preload_strategy = :reachable. Lives in lib/importmap/map.rb (preloaded_module_paths, ~l.282) and lib/importmap/graph.rb. Request path, no network, cached like the JSON. The motivating case is a real app that had to hand-write preload: false on apexcharts/core to stop shipping 1.1 MB on every page.
103 Early Hints (#20) — javascript_importmap_tags sends its modulepreload links as Early Hints. Lives in app/helpers/importmap/importmap_tags_helper.rb and lib/importmap/early_hints.rb, behind config.importmap.early_hints.
How
Per .claude/rules/upstream-sync.md → Contributing back: a clean branch off upstream/main, one PR each, opened against rails/importmap-rails. Whatever merges comes back through the next /upstream-sync and the fork's diff shrinks.
Note lib/importmap/graph.rb and lib/importmap/early_hints.rb are fork-only files, so each PR is close to additive upstream — but map.rb and the helper are upstream-owned here, and the upstream diff should be written against their current shape, not this fork's.
Split out of #21, which is otherwise complete.
The roadmap's "Upstream-first notes" say:
Both have landed here and neither has been proposed upstream.
What to propose
Graph-aware preloading (#19) —
config.importmap.preload_strategy = :reachable. Lives inlib/importmap/map.rb(preloaded_module_paths, ~l.282) andlib/importmap/graph.rb. Request path, no network, cached like the JSON. The motivating case is a real app that had to hand-writepreload: falseonapexcharts/coreto stop shipping 1.1 MB on every page.103 Early Hints (#20) —
javascript_importmap_tagssends its modulepreload links as Early Hints. Lives inapp/helpers/importmap/importmap_tags_helper.rbandlib/importmap/early_hints.rb, behindconfig.importmap.early_hints.How
Per
.claude/rules/upstream-sync.md→ Contributing back: a clean branch offupstream/main, one PR each, opened against rails/importmap-rails. Whatever merges comes back through the next/upstream-syncand the fork's diff shrinks.Note
lib/importmap/graph.rbandlib/importmap/early_hints.rbare fork-only files, so each PR is close to additive upstream — butmap.rband the helper are upstream-owned here, and the upstream diff should be written against their current shape, not this fork's.