Repository navigation
chore: Implement WebGL native JS patching for 4GB memory support and add unit tests - #1063
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a build-time backport for the emscripten GL_UNPACK_ROW_LENGTH WebGL fix into dotnet.native.*.js when an app opts into a 4GB WASM heap, and wires that patching into the existing MSBuild pipeline with unit coverage for the pure patching logic.
Changes:
- Added a pure string-based patcher (
WebGLNativeJsPatcher) that detects WebGL glue, applies two token replacements, and self-verifies both replacements landed. - Added an MSBuild task (
PatchWebGLNativeJsForMaxMemoryTask_v0) and updatedUno.Wasm.Bootstrap.targetsto apply the patch for both build and publish outputs (including deletion of stale.gz/.brsiblings on publish when rewritten). - Added unit tests validating the patcher outcomes (applied / no glue / already patched / drifted / partial match).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/Uno.Wasm.Bootstrap/WebGLNativeJsPatcher.cs |
Implements the engine-free patch decision + transformation logic with drift detection. |
src/Uno.Wasm.Bootstrap/PatchWebGLNativeJsForMaxMemoryTask.cs |
Adds an MSBuild task that applies the patch in-place and logs outcomes. |
src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets |
Wires the new task into build and publish targets; improves 4GB-flag detection and stale compressed file handling. |
src/Uno.Wasm.Bootstrap.UnitTests/Given_PatchWebGLNativeJsForMaxMemoryTask.cs |
Adds tests covering the patcher’s behavior and idempotency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1063.eastus2.1.azurestaticapps.net |
1 task done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.