Usable wasm browser apps build output with WasmBundlerFriendlyBootConfig=true#125192
Usable wasm browser apps build output with WasmBundlerFriendlyBootConfig=true#125192ArcadeMode wants to merge 34 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make WasmBundlerFriendlyBootConfig=true usable in Debug builds by preventing hot reload from being referenced in the generated boot config when no dev server/files are available (e.g., when bundling with a JS bundler).
Changes:
- Adds MSBuild logic to set
WasmEnableHotReload=falsewhenWasmBundlerFriendlyBootConfig=true(under certain conditions).
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
|
@pavelsavara could you look at this if you have a moment? I added a build test to confirm the hotreload references are omitted when building bundler friendly, just in case. |
|
Converted to draft, I was doing some things wrong. Will undraft when I got the tests working properly |
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Show resolved
Hide resolved
|
@maraf This is ready for another review. I think there's been some good improvements. |
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Show resolved
Hide resolved
|
As discussed on Discord, the test coverage has been extended by including build+run tests. Had to resolve an issue with the build-time importmap. I did so by aligning it with the publish-time importmap. Its not particularly elegant, I hope we can propose a change to the sdk repo where this becomes a property so we can just flip the switch here. |
| } | ||
| } | ||
|
|
||
| export default [getConfig('main.js'), getConfig('profiler.js')] |
There was a problem hiding this comment.
this change resolves browser console errors due to the inability to load profiler.js. Its not actually used in any tests (yet), but now it could.
It is currently not possible to use the output of a Wasm Browser App's
dotnet buildwhenWasmBundlerFriendlyBootConfig=true.These two points make it so that builds will fail when passed into an npm project.
Secondary 'issues' (rather improvements)
Changes
Test are updated to always run an npm build when building bundler friendly, so multiple tests verify that this works. A new test was added to explicitly test for the absence of hot reload from the boot json.
Effect
The proposed changes make it no longer necessary to go through a dev cycle with publish + npm builds, instead the (faster) builds can be used for the npm builds. Once ready its ofcourse still possible to publish for a release build (a more typical development flow).