Skip to content

Commit 6bd3734

Browse files
[release/8.0] Update SDK (#51059)
* Update global.json * Fix regression in inline script in .razor * Build fix * Update SDK more * Work around dotnet tool restore issue * Fix message * Update Tools.props * Update .gitignore * Try hard-coding * Update helix.proj * Update helix.proj * Update .js * Diag * Revert "Diag" This reverts commit 33ca76f. * Revert "Update helix.proj" This reverts commit 93c33f0. * Revert "Update helix.proj" This reverts commit abaa4f1. * Revert "Try hard-coding" This reverts commit f0fb388. * Revert "Update .gitignore" This reverts commit ecfa362. * Revert "Update Tools.props" This reverts commit 89fda27. * Revert "Fix message" This reverts commit 5808bf1. * Revert "Work around dotnet tool restore issue" This reverts commit c9af2e8. * Update SDK --------- Co-authored-by: wtgodbe <[email protected]>
1 parent a8087dc commit 6bd3734

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "8.0.100-rc.2.23422.11"
3+
"version": "8.0.100-rtm.23506.1"
44
},
55
"tools": {
6-
"dotnet": "8.0.100-rc.2.23422.11",
6+
"dotnet": "8.0.100-rtm.23506.1",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/dist/Release/blazor.web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/dist/Release/blazor.webview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Rendering/BrowserRenderer.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,28 @@ function parseMarkup(markup: string, isSvg: boolean) {
400400
return sharedSvgElemForParsing;
401401
} else {
402402
sharedTemplateElemForParsing.innerHTML = markup || ' ';
403+
404+
// Since this is a markup string, we want to honor the developer's intent to
405+
// evaluate any scripts it may contain. Scripts parsed from an innerHTML assignment
406+
// won't be executable by default (https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml)
407+
// but that's inconsistent with anything constructed from a sequence like:
408+
// - OpenElement("script")
409+
// - AddContent(js) or AddMarkupContent(js)
410+
// - CloseElement()
411+
// It doesn't make sense to have such an inconsistency in Blazor's interactive
412+
// renderer, and for back-compat with pre-.NET 8 code (when the Razor compiler always
413+
// used OpenElement like above), as well as consistency with static SSR, we need to make it work.
414+
sharedTemplateElemForParsing.content.querySelectorAll('script').forEach(oldScriptElem => {
415+
const newScriptElem = document.createElement('script');
416+
newScriptElem.textContent = oldScriptElem.textContent;
417+
418+
oldScriptElem.getAttributeNames().forEach(attribName => {
419+
newScriptElem.setAttribute(attribName, oldScriptElem.getAttribute(attribName)!);
420+
});
421+
422+
oldScriptElem.parentNode!.replaceChild(newScriptElem, oldScriptElem);
423+
});
424+
403425
return sharedTemplateElemForParsing.content;
404426
}
405427
}

src/OpenApi/src/OpenApiGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private static OpenApiResponses GetOpenApiResponses(MethodInfo method, EndpointM
188188

189189
if (eligibileAnnotations.Count == 0)
190190
{
191-
GenerateDefaultResponses(eligibileAnnotations, responseType);
191+
GenerateDefaultResponses(eligibileAnnotations, responseType!);
192192
}
193193

194194
foreach (var annotation in eligibileAnnotations)

0 commit comments

Comments
 (0)