Remove async attr on global JS script tag #2456
Merged
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.
Jira
n/a
Summary
Fixes race condition caused by loading global JS file asynchronously.
Details
While reviewing #2423 I noticed sometimes the Floating Action Buttons JS would not load at all. This was because the JS was executing before the DOM was ready and the document query we were using to conditionally load the JS was returning empty.
At one point in time, when we were all-in on web components it might've made sense to load our JS asynchronously, as our JS would work whether it loaded before or after an HTML element was added to the DOM. But
[async]
doesn't make sense for anything not a web component that needs to query the DOM (most other components).We also do not use
[async]
in production on any of our sites. So, I'm removing it from PL. This change only affects PL.How to test