Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize I18n and OSM as soon as application.js loads #5538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AntonKhorev
Copy link
Collaborator

That's what was happening before d7b4f88, but after that the init code was moved inside $(document).ready( ... ). That means it may not run before other code wants to use it, like #5402 (comment). <head> already exists by the time application.js runs, it should be possible to read html attributes from there.

@AntonKhorev AntonKhorev force-pushed the application-js-init-asap branch from d81243d to f2903b8 Compare January 23, 2025 05:35
@tomhughes
Copy link
Member

tomhughes commented Jan 23, 2025

I generally try to avoid doing anything before ready fires as it's hard to know what's safe but I guess this OK as head must have loaded in order for the javascript to load. I do wonder what #5402 is doing that it needs this before the page is ready though...

@HolgerJeromin
Copy link
Contributor

but I guess this OK as head must have loaded in order for the javascript to load.

Yes.
FYI:
document.body is not ready sync (if your <script> element has no defer attribute)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants