[openstreetmap/openstreetmap-website] Load js controller modules only when needed (PR #7147)

Marwin Hochfelsner notifications at github.com
Wed Jun 10 09:20:02 UTC 2026


With comparably few changes to the js files, router.js can load import the modules lazily, which reduces upfront asset load.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/7147

-- Commit Summary --

  * Collect module paths in dict
  * Collect initializations outside of modules
  * Migrate some js controllers to lazy loaded modules
  * Split initializations back to original origins

-- File Changes --

    M app/assets/javascripts/application.js (2)
    M app/assets/javascripts/index.js (43)
    M app/assets/javascripts/index/new_note.js (165)
    M app/assets/javascripts/index/query.js (280)
    M app/assets/javascripts/index/search.js (109)
    R app/assets/javascripts/index_modules/changeset.js (4)
    R app/assets/javascripts/index_modules/export.js (4)
    R app/assets/javascripts/index_modules/history-changesets-layer.js (0)
    R app/assets/javascripts/index_modules/history.js (4)
    R app/assets/javascripts/index_modules/home.js (4)
    A app/assets/javascripts/index_modules/new_note.js (164)
    R app/assets/javascripts/index_modules/note.js (4)
    A app/assets/javascripts/index_modules/query.js (279)
    A app/assets/javascripts/index_modules/search.js (108)
    M app/assets/javascripts/leaflet.maplibre.js (2)
    M app/assets/javascripts/osm.js.erb (15)
    M app/assets/javascripts/router.js (28)
    M config/eslint.config.mjs (10)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/7147.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7147.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7147
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7147 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260610/b011d54c/attachment-0001.htm>


More information about the rails-dev mailing list