-
Notifications
You must be signed in to change notification settings - Fork 138
Improve construction of inline scripts with sourceURL, hardened JSON encoding, and exporting JSON in separate script
#2169
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #2169 +/- ##
==========================================
+ Coverage 68.81% 68.92% +0.10%
==========================================
Files 90 90
Lines 8006 8060 +54
==========================================
+ Hits 5509 5555 +46
- Misses 2497 2505 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is a follow-up inspired by a few core changes which either landed or which are being proposed as a best practice:
sourceURLcomments to all inline scripts. This is helpful for debugging as well as when troubleshooting where an inline script is coming from.SCRIPT[type="application/json"]tag which is then parsed and read from when needed. This simplifies the printing of the script modules. See comment.Code review from Gemini:
Markup Diffs
For a page configured with content which is related to Image Prioritizer and Embed Optimizer (and Optimization Detective), the diff of the changes this PR introduces with prettier formatting, is as follows: