fix(webui): use @microsoft/webui package in integration examples and fix render() signature#133
Merged
mohamedmansour merged 2 commits intomainfrom Mar 25, 2026
Conversation
The Rust render() function added entry and request_path parameters in the routing rearchitecture (commit 91d5a5e) but the TypeScript NativeAddon interface and render/renderStream wrappers were not updated, causing a StringExpected error at runtime. - Update NativeAddon.render() to include entry and requestPath args - Add RenderOptions interface for entry, requestPath, and plugin - Pass entry (default: index.html) and requestPath (default: /) through render(), renderStream(), and buildAndRender() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace manual loadAddon() with import from @microsoft/webui in both the Node.js and Electron integration examples. This validates that the published npm package works correctly through the workspace. Node example: - Add @microsoft/webui workspace dependency - Use build() and render() API instead of direct dlopen - Support both build+render (default) and pre-built protocol modes Electron example: - Add @microsoft/webui workspace dependency with --packages=external - Use renderStream() instead of manual process.dlopen() - Fix stale --css external flag in README (now --css link) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mohamedmansour
approved these changes
Mar 25, 2026
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.
Summary
Closes #130
Two changes in this PR:
1. Fix render() TypeScript wrapper (bug fix)
The Rust
ender()\ native addon function added \�ntry\ and
equest_path\ parameters during the routing rearchitecture (commit 91d5a5e) but the TypeScript \NativeAddon\ interface was never updated. This caused a \StringExpected\ runtime error when calling
ender()\ or
enderStream()\ from the @microsoft/webui\ package.
equestPath\
equestPath, and \plugin\ fields
ender(),
enderStream(), and \�uildAndRender()\ to pass the new args
2. Migrate integration examples to use @microsoft/webui\ package
Both the Node.js and Electron integration examples previously used a manual \loadAddon()\ that searched \ arget/debug|release/\ for the native .dll/.so/.dylib. This bypassed the @microsoft/webui\ package entirely, meaning it didn't validate the actual package API.
Node example (\�xamples/integration/node):
Electron example (\�xamples/integration/electron):
Testing