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

Marwin Hochfelsner notifications at github.com
Wed Jun 17 11:09:17 UTC 2026


hlfan left a comment (openstreetmap/openstreetmap-website#7147)

> Of course it winds up polluting the global namespace (well the `OSM` namespace) with functions that are only used in the new `index_history` module.

As long as it's only used in the module (same for the directions classes) we can put it in the modules' global scope, as it doesn't wind up outside of the module.
That really cleans up the OSM namespace, but ESLint still has to be made happy... 

> Does `app/assets/javascripts/index_modules/history-changesets-layer.js` need to get the `export` line too?

I'm probably gonna put that back outside the module directory, also to make ESLint happy. 🙃 

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

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


More information about the rails-dev mailing list