Skip to content

refactor(wasm)!: Remove legacy IJSObject DOM-interop (BC02) - #23673

Merged
Xiaoy312 merged 4 commits into
feature/breakingchangesfrom
dev/xygu/20260706/remove-ijsobject-wasm
Jul 9, 2026
Merged

Xiaoy312 merged 4 commits into
feature/breakingchangesfrom
dev/xygu/20260706/remove-ijsobject-wasm

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: unoplatform/uno-private#2125

PR Type:

💬 Other... — breaking change (legacy public API removal), part of the Uno 7.0 breaking-changes epic.

What changed? 🚀

Removes the Uno-only, DOM-based WebAssembly JavaScript object-marshalling mechanism (BC02), which has no WinUI counterpart and only served the maintenance-only native WASM-DOM layer:

  • Uno.Foundation.Interop.IJSObject, IJSObjectMetadata, JSObject, JSObjectHandle, and the JSObjectMetadataProvider plumbing.
  • WebAssemblyRuntime.InvokeJSWithInterop(FormattableString) — the eval + IJSObject-substitution entry point.
  • The associated ManagedObject.ts interop shim.

It also fixes the corresponding entry in the Uno 7.0 migration guide: previously it told readers to replace InvokeJSWithInterop with WebAssemblyRuntime.InvokeJS, but that string-eval API is itself legacy (eval-based, not CSP-compliant). The guide now points migrators to the recommended [JSImport]/[JSExport] interop (System.Runtime.InteropServices.JavaScript), and clarifies that InvokeJS(string) still exists but is not recommended for new code.

build/PackageDiffIgnore.xml is updated to acknowledge the removed public member in the API-diff gate.

PR Checklist ✅

Breaking change — impact & migration path

Impact: Code that used the Uno-only WASM object-marshalling interop (IJSObject and friends, or WebAssemblyRuntime.InvokeJSWithInterop(FormattableString)) no longer compiles. This affected only WebAssembly and had no WinUI equivalent.

Migration: Move to the standard .NET WebAssembly interop, JSImport/JSExport (System.Runtime.InteropServices.JavaScript) — the recommended, source-generated, thread-safe, CSP-compliant path. The string-based WebAssemblyRuntime.InvokeJS(string) remains available but is a legacy eval-based API and is not recommended for new code. Full details are in the Uno 7.0 migration guide.

@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Jul 7, 2026
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260706/remove-ijsobject-wasm branch from 7c08656 to 8f945c0 Compare July 7, 2026 16:18
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 221104 has failed on Uno.UI - CI.

@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges

Copy link
Copy Markdown
Contributor

We likely can drop foundation.runtime.webassembly entirely.

@Xiaoy312

Xiaoy312 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

#23673 (comment)
^ yes, but we will probably do that in one sweep moving
but surprizingly, that is not already in the foundation :/

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260706/remove-ijsobject-wasm branch from 17e06ee to e599f84 Compare July 8, 2026 14:52
@Xiaoy312
Xiaoy312 enabled auto-merge July 8, 2026 14:52
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 221288 has failed on Uno.UI - CI.

Xiaoy312 and others added 4 commits July 8, 2026 15:39
Delete the Uno-only IJSObject DOM-interop mechanism, a legacy WASM
scaffolding with no WinUI counterpart, no in-repo consumers, and no
[GeneratedJSObject] generator to produce implementations. On default
settings runtime behaviour is unchanged - this removes an unreachable
code path.

Removed:
- IJSObject / IJSObjectMetadata (public interfaces)
- JSObjectHandle (public class)
- JSObject (public class; its Dispatch [JSExport] was only reachable via
  the ManagedObject TS dispatch side)
- JSObjectMetadataProvider (internal JS-prototype generator, orphaned)
- ts/Interop/ManagedObject.ts (TS dispatch side, only called by the
  generated prototype)
- WebAssemblyRuntime.InvokeJSWithInterop (public helper whose sole
  purpose was marshalling IJSObject arguments into the JS call; zero
  in-repo callers)

Package-diff entries added for the four removed public types and the
InvokeJSWithInterop method. Migration guidance added to
migrating-to-uno-7.md.

Part of #2125 (Phase 3 breaking changes); refs #8339.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The migration guide told readers to replace the removed
InvokeJSWithInterop with WebAssemblyRuntime.InvokeJS, but that
string-eval API is itself legacy (eval-based, not CSP-compliant).
Point migrators to [JSImport]/[JSExport] as the recommended path,
and note InvokeJS survives but is not recommended for new code.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Re-add the package-diff ignore entries for the IJSObject DOM-interop
API removed in BC02, placed under the 6.5 baseVersion set (Types +
Methods) rather than 6.6.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260706/remove-ijsobject-wasm branch from e599f84 to b0599e8 Compare July 8, 2026 19:40
@unodevops

Copy link
Copy Markdown
Contributor

@Xiaoy312
Xiaoy312 merged commit 9ed3df9 into feature/breakingchanges Jul 9, 2026
67 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260706/remove-ijsobject-wasm branch July 9, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants