-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add .net9 support #156
Add .net9 support #156
Conversation
@@ -92,7 +91,7 @@ private static IJSInProcessRuntime GetJsRuntime() | |||
throw new MissingMemberException($"Couldn't find type '{defaultJsRuntimeTypeName}'."); | |||
} | |||
|
|||
var instanceField = defaultJsRuntimeType.GetField(instanceFieldName, BindingFlags.Static | BindingFlags.NonPublic); | |||
var instanceField = defaultJsRuntimeType.GetField(instanceFieldName, BindingFlags.Static | BindingFlags.Public); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it's public field inside internal, was private before.
@@ -213,7 +213,7 @@ window.Try.CodeExecution = window.Try.CodeExecution || (function () { | |||
const cache = await caches.open('dotnet-resources-/'); | |||
|
|||
const cacheKeys = await cache.keys(); | |||
const userComponentsDllCacheKey = cacheKeys.find(x => x.url.indexOf('Try.UserComponents.dll') > -1); | |||
const userComponentsDllCacheKey = cacheKeys.find(x => /Try\.UserComponents\.[^/]*\.dll/.test(x.url)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They changed how it works, now the cacheKeys
contains url as
https://localhost:5001/_framework/Try.UserComponents.5js11t3n4f.dll.sha256-sWuk/v/P19Mdwxa9TJKy8H5RCinjfd/iOybI4HtjLRk=
I had to change logic, we cannot use x.url.indexOf('Try.UserComponents')
(without .dll
prefix) because then it can land on the .pdb
file.
This part could lead when click first time on "run" doesn't show any compiled html or throwing the alert message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we can just disable the fingerprints:
<WasmFingerprintAssets>false</WasmFingerprintAssets>
and leave the code as it was before.
This is a very "hidden" switch off, as you won't even find it in the docs, had to look for the runtime sourcecode.
@@ -37,9 +37,6 @@ public partial class Repl : IDisposable | |||
[Inject] | |||
public IJSInProcessRuntime JsRuntime { get; set; } | |||
|
|||
[Inject] | |||
public IJSUnmarshalledRuntime UnmarshalledJsRuntime { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IJSUnmarshalledRuntime
was removed completely, and it wasn't actually used in the code anymore anyway.
Feel free to test this branch if anyone wants to do extensive testing. |
Quality Gate passedIssues Measures |
Tested on several code samples including those that use the periodic table API. |
Thanks @ScarletKuro |
Co-authored-by: Mike Surcouf <[email protected]>
Adds .net9 support to TryMudBlazor