Skip to content

Avoid printing preload_links_header attribute for scripts#11790

Merged
aduth merged 1 commit intomainfrom
aduth-preload-links-header-attribute
Jan 23, 2025
Merged

Avoid printing preload_links_header attribute for scripts#11790
aduth merged 1 commit intomainfrom
aduth-preload-links-header-attribute

Conversation

@aduth
Copy link
Copy Markdown
Contributor

@aduth aduth commented Jan 23, 2025

🛠 Summary of changes

Fixes an issue where scripts rendered using preload_links_header: false option unexpectedly output a preload_links_header="false" attribute on the rendered script tag.

This regressed in #11504, where we switched from using javascript_include_tag to tag.script. The preload_links_header behavior was intended to mimic that of javascript_include_tag, but did not recreate the behavior of deleting the option from attributes before rendering the script tag (source).

📜 Testing Plan

  1. Go to http://localhost:3000
  2. Right click and view source for page
  3. Verify that track-errors.js script tag toward the bottom of page <body> content does not include a preload_links_header attribute

changelog: Internal, JavaScript Helper, Avoid printing preload_links_header attribute for scripts
@aduth aduth merged commit b1be266 into main Jan 23, 2025
@aduth aduth deleted the aduth-preload-links-header-attribute branch January 23, 2025 15:56
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.

2 participants