Skip to content

[blazor] Extract current dotnet.d.ts from runtime pack for repository build - #70344

Merged
maraf merged 1 commit into
dotnet:mainfrom
maraf:maraf-runtime-typescript-definitions
Nov 6, 2026
Merged

maraf merged 1 commit into
dotnet:mainfrom
maraf:maraf-runtime-typescript-definitions

Conversation

@maraf

@maraf maraf commented Nov 6, 2026

Copy link
Copy Markdown
Member

[blazor] Extract current dotnet.d.ts from runtime pack for repository build

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Restore Blazor runtime TypeScript declarations from the flowed runtime pack.

Description

Replace the checked-in generated src/Components/dotnet-runtime-js/dotnet.d.ts with the declaration supplied by Microsoft.NETCore.App.Runtime.browser-wasm, using the existing flowed MicrosoftNETCoreAppRefVersion.

The existing GenerateFiles restore copies the declaration into the ignored npm workspace path. The npm workspace restore also invokes this step even when npm dependencies are already restored, and explicitly tracks the declaration as a build input before it exists. Repeated restores preserve timestamps; runtime version changes touch the copied declaration so upgrades and downgrades invalidate the JavaScript build. Source-only builds exclude the runtime-pack download, and source-only/design-time invocations skip copying it.

Document the restore prerequisite for direct npm builds. No npm manifests or lockfiles are changed, and there are no public API changes. Existing JavaScript coverage is reused; no permanent tests were added for this build-only change.

Validation after merging the latest origin/main:

  • source activate.sh && dotnet msbuild eng/Npm.Workspace.nodeproj -t:Restore -v:minimal -nologo — passed.
  • npm run build --workspace @microsoft/microsoft.aspnetcore.components.web.js — passed, Debug and Release bundles.
  • npm run test --workspace @microsoft/microsoft.aspnetcore.components.web.js -- --runInBand — passed, 15 suites / 299 tests.
  • ./eng/build.sh --projects "$PWD/eng/Npm.Workspace.nodeproj" --build-nodejs --no-build-managed --no-build-native --no-build-java --pack — passed with zero warnings and errors; produced the three shipping npm packages.
  • An ad hoc restore lifecycle check passed for unchanged restore, missing-file regeneration without npm reinstall, runtime upgrade/downgrade transitions with exact package-byte comparisons, and source-only/design-time exclusions.

Full managed builds and Windows/Linux execution were not run. The area-wide lint command has existing failures; comparison against the baseline found no new diagnostics from this change.

Related issue: N/A; no linked issue was supplied.

Note

This PR description was generated with the assistance of GitHub Copilot.

@maraf maraf added the area-blazor Includes: Blazor, Razor Components label Nov 6, 2026
@maraf maraf self-assigned this Nov 6, 2026
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Nov 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@maraf
maraf marked this pull request as ready for review November 6, 2026 12:12
@maraf
maraf requested review from a team, SamMonoRT and wtgodbe as code owners November 6, 2026 12:12
Copilot AI balanced review requested due to automatic review settings November 6, 2026 12:12

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.

🔵 Needs a closer look

Missing SDK/Arcade dependencies leave restore-time package-path resolution and incremental-copy behavior unverified, requiring clean-checkout validation on Windows and Linux, including IDE behavior.

No open issues 🎉

What changed in this PR

This PR replaces Blazor’s checked-in runtime TypeScript declarations with declarations restored from the runtime pack, keeping JavaScript builds aligned with the repository’s runtime dependency version.

Changes:

  • Restore dotnet.d.ts from the runtime pack, with source-only and design-time copy exclusions.
  • Integrate declaration restore and incremental build tracking into the npm workspace.
  • Document the restore prerequisite for direct npm builds.
File Description
src/​Components/​dotnet-runtime-js/​dotnet.d.ts Removes the checked-in generated declarations.
src/​Components/​dotnet-runtime-js/​.gitignore Ignores the restored declaration file.
eng/​tools/​GenerateFiles/​GenerateFiles.csproj Downloads the runtime pack and copies declarations with timestamp-based invalidation.
eng/​Npm.Workspace.nodeproj Restores declarations independently of npm dependency freshness and tracks them as build inputs.
docs/​BuildFromSource.md Explains declaration generation and when to rerun restore.

Review effort: Balanced

@PureWeen

PureWeen commented Nov 6, 2026

Copy link
Copy Markdown
Member

/review

@maraf

maraf commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

/ba-g Failures is not related

The remaining failure is ServerRoutingTest.NavigationLock_CanBlockExternalNavigation in the Mono-server E2E leg: the browser stays at /subdir/ instead of navigating to //myexternalpath3. This PR only replaces the checked-in runtime TypeScript declaration with the runtime-pack copy and wires its restore into the repository build; it does not change navigation implementation, server behavior, or the test. All repository build jobs passed, and CoreCLR and Mono-client/WebAssembly E2E passed. Build Insights reports a 31.6% historical failure rate for this test. The failure repeated in builds 1667457 and 1667612, so this is an operator-directed Build Analysis override, not a claim that a retry verified the test or that the failure matched a known issue.

Note

This comment was generated with the assistance of GitHub Copilot.

@maraf
maraf merged commit 03bee42 into dotnet:main Nov 6, 2026
39 of 41 checks passed
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:07 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:08 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:08 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:10 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:11 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool November 6, 2026 16:12 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 3%

No docs needed: the PR only changes how the repository build obtains dotnet.d.ts (build infrastructure), with no user-facing change.

Documentation surfaces considered

  • Conceptual article: Not required — Repository build/CI infrastructure only; no public APIs, templates, or defaults changed.
  • Migration guidance: Not required — No upgrade action for app developers.
  • Breaking change: Not required — No compatibility impact; build-only change.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — fad44b2a Deployed Nov 6, 2026 by maraf via conclusion #222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants