Skip to content

Add Node.js sample using a native WinUI 3 Application and Window#624

Open
lei9444 wants to merge 13 commits into
mainfrom
leilzh/nodeui
Open

Add Node.js sample using a native WinUI 3 Application and Window#624
lei9444 wants to merge 13 commits into
mainfrom
leilzh/nodeui

Conversation

@lei9444

@lei9444 lei9444 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

image image

Usage Example

Related Issue

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📝 Documentation
  • 🔧 Config/build
  • ♻️ Refactoring
  • 🧪 Test update

Checklist

  • New tests added for new functionality (if applicable)
  • Tested locally on Windows
  • Main README.md updated (if applicable)
  • docs/usage.md updated (if CLI commands changed)
  • Language-specific guides updated (if applicable)
  • Sample projects updated to reflect changes (if applicable)
  • Agent skill templates updated in docs/fragments/skills/ (if CLI commands/workflows changed)

Screenshots / Demo

Additional Notes

AI Description

This pull request introduces a new sample demonstrating how to create a WinUI 3 application and window directly from Node.js, using the Microsoft.UI.Xaml controls projected into JavaScript. It includes necessary files like main.js, package.json, and a README for usage instructions. To run the sample, use the following commands:

npm install
npm run restore
npm start

@github-actions github-actions Bot added the enhancement New feature or request label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 36.77 MB 36.77 MB ✅ 0.0 KB (0.00%)
CLI (x64) 36.95 MB 36.95 MB ✅ 0.0 KB (0.00%)
MSIX (ARM64) 15.36 MB 15.36 MB 📈 +0.1 KB (+0.00%)
MSIX (x64) 16.30 MB 16.30 MB 📉 -0.0 KB (-0.00%)
NPM Package 32.06 MB 32.06 MB 📈 +0.3 KB (+0.00%)
NuGet Package 32.09 MB 32.09 MB 📈 +0.0 KB (+0.00%)

Test Results

3338 passed, 4 skipped out of 3342 tests in 872.9s (+135.3s vs. baseline)

Test Coverage

86.3% line coverage, 80% branch coverage · ✅ no change vs. baseline

CLI Startup Time

52ms median (x64, winapp --version) · ✅ no change vs. baseline


Updated 2026-07-16 13:46:21 UTC · commit 35c3701 · workflow run

nmetulev and others added 2 commits July 14, 2026 13:04
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1cf82a54-b9a0-4437-ab3f-ea9af28a68a8
@lei9444 lei9444 changed the title Add Node.js sample for hosting WinUI 3 controls in an AppWindow Add Node.js sample using a native WinUI 3 Application and Window Jul 15, 2026
@lei9444
lei9444 marked this pull request as ready for review July 16, 2026 13:19
Copilot AI review requested due to automatic review settings July 16, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Node.js sample that demonstrates creating a native WinUI 3 Application + Window directly from JavaScript using dynwinrt, along with CI coverage to keep the sample working over time.

Changes:

  • Adds the samples/node-winui sample project (restore/generate scripts, WinUI worker implementation, and documentation).
  • Adds a Pester test for the new sample and wires it into the test-samples.yml matrix.
  • Updates the repo root README.md to include the new sample in the Samples table.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/node-winui/winui-worker.js Worker-thread WinUI Application.start() sample UI composition + event wiring.
samples/node-winui/main.js Bootstraps Windows App SDK and starts the WinUI worker.
samples/node-winui/package.json Declares sample scripts, #winapp/bindings imports, dynwinrt deps, and winapp.jsBindings config.
samples/node-winui/README.md Sample usage + architecture explanation + binding regeneration guidance.
samples/node-winui/winapp.yaml WinApp restore package set for generating WinUI bindings.
samples/node-winui/test.Tests.ps1 Pester validation for restore + generated bindings + basic JS syntax checks.
samples/node-winui/.gitignore Ignores .winapp/ output and node_modules/.
samples/node-winui/.npmrc Sets npm registry (see review comment).
README.md Fixes formatting in install section and adds the new sample to the Samples table.
.github/workflows/test-samples.yml Adds node-winui to workflow_dispatch options, matrix, and Node setup gating.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/node-winui/.npmrc
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants