LostBeard / SpawnDev.BlazorJS

Full Blazor WebAssembly and Javascript Interop with multithreading via WebWorkers
https://blazorjs.spawndev.com
MIT License
78 stars 6 forks source link

Getting ImportShimBlazorWASM.Execute warning on build/publish #25

Closed RonPeters closed 3 months ago

RonPeters commented 3 months ago

I get the following warning after build/publish:

##[warning]/home/vsts/.nuget/packages/spawndev.blazorjs.webworkers/2.2.56/build/SpawnDev.BlazorJS.WebWorkers.targets(40,3): Warning : ********************************** ImportShimBlazorWASM.Execute **********************************

Do I have something misconfigured? Or should it be ignored, and if so, is there a way to suppress this? I don't want it to litter my logs if it's not an actual problem.

Thanks!

LostBeard commented 3 months ago

@RonPeters Sorry about that. Those messages can be ignored and will be removed in the next update.

RonPeters commented 3 months ago

@LostBeard Thanks! Appreciate the clarity.

LostBeard commented 3 months ago

Little more info. That message was added when testing some new MSBuild tasks added to SpawnDev.BlazorJS.WebWorkers that allow build-time patching of the Blazor framework, instead of patching at runtime, which is the current default. The Blazor framework is patched to make it work in workers.

Build-time patching was added to enable Blazor in a Chrome browser extension ServiceWorker, which does not allow 'unsafe-eval' (runtime patching) due to the ContentSecurityPolicy.

I will be adding info for the new flag, seen below, to the documentation soon. It has only been tested with .Net 8 WASM standalone so far.

<!-- SpawnDev.BlazorJS.WebWorkers config -->
<PropertyGroup>
    <!-- 
    WebWorkerPatchFramework
    - To run Blazor WASM in non-window scopes (DedicatedWorker, SharedWorker, ServiceWorker) Blazor framework files need to be modified.
    - Patching can be done at runtime in Javascript, or at build time. 
    - Build time patching gives better performance and works with stricter ContentSecurityPolicy rules
    - false - patch at run time (current default)
    - true  - patch at build time
    -->
    <WebWorkerPatchFramework>true</WebWorkerPatchFramework>
</PropertyGroup>
LostBeard commented 3 months ago

Fixed in version 2.2.57

RonPeters commented 3 months ago

Thanks for the update. I appreciate your attention to detail, performance, and flexibility