You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add new "type" parameter to Html::scriptBlock() - #26299
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Script blocks can now specify JavaScript, module, or import map types, enabling pages to include different kinds of scripts.
Existing script blocks continue to use the standard JavaScript type by default.
The change adds the ScriptType enum with JavaScript, module, and import-map values. Html::scriptBlock accepts an optional enum value and uses it for the script tag’s type. Functional tests cover the default and each supported type.
Suggested reviewers:cedric-anne, cconard96
Merge Risk: Minimal · up to 13d87
This adds an optional script type to Html::scriptBlock. Existing callers produce the same output as before, and no merge-blocking risk was found.
Warning
Some tools did not complete. Review the errors below.
ast-grep (0.51.1)
src/Html.php
ast-grep output exceeded the maximum buffer for this file
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Add new "type" parameter to
Html::scriptBlock(), which allow scripts withtype="module"ortype="importmap"to be generated by this method.This is important for CSP as we need all scripts to come from the same method so we can easily add the "nonce" parameter used to whitelist scripts.
Extracted from #26020 to simplify reviews.