Fix TypeScriptAppHost playground app#14950
Merged
sebastienros merged 3 commits intorelease/13.2from Mar 4, 2026
Merged
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14950Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14950" |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the TypeScript playground AppHost failing to start (timing out while waiting for the AppHost server) by aligning the generated TypeScript SDK/runtime with how the code generator emits ReferenceExpression usage and ensuring the runtime dependency needed to execute apphost.ts is present.
Changes:
- Make
ReferenceExpressionconstructible from either a template-literal expression (format + value providers) or a server-returned handle, and update JSON serialization accordingly. - Add
tsxto the TypeScriptAppHost playground dev dependencies (required by the TypeScript AppHost runtime execution path). - Regenerate/update the playground’s
.modulesoutputs and the TypeScript codegen snapshot to reflect the new base implementation.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/base.verified.ts | Updates snapshot to reflect new ReferenceExpression constructor/serialization behavior. |
| src/Aspire.Hosting.CodeGeneration.TypeScript/Resources/base.ts | Updates the TypeScript SDK base to support handle-backed ReferenceExpression instances. |
| playground/TypeScriptAppHost/package.json | Adds tsx so the playground can execute apphost.ts via the expected runtime tooling. |
| playground/TypeScriptAppHost/package-lock.json | Lockfile update for the added tsx dependency (and transitive deps). |
| playground/TypeScriptAppHost/.modules/transport.ts | Updates generated transport to match current callback/DTO behavior used by the host. |
| playground/TypeScriptAppHost/.modules/base.ts | Updates generated base module to include the new ReferenceExpression implementation. |
| playground/TypeScriptAppHost/.modules/.codegen-hash | Updates the codegen hash to reflect regenerated .modules outputs. |
Files not reviewed (1)
- playground/TypeScriptAppHost/package-lock.json: Language not supported
…cript SDK The generated TypeScript SDK calls `new ReferenceExpression(handle, client)` for server-returned properties like uriExpression and jdbcConnectionString, but the constructor was private and only accepted (format, valueProviders). This caused TS2673 compilation errors in all polyglot TypeScript apps. Changes: - Make constructor public with dual-mode support (expression + handle) - Add constructor overloads to enforce valid parameter pairing at compile time - Store _client field for forward compatibility with other handle-wrapping types - Update toJSON() to delegate to handle serialization in handle mode - Update verified snapshot to match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidfowl
reviewed
Mar 4, 2026
bd9576b to
c73f706
Compare
Add a local .gitignore to override the global .aspire/ exclusion, so that integration packages are tracked for this playground app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c73f706 to
e069fc2
Compare
davidfowl
approved these changes
Mar 4, 2026
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22684830281 |
Copilot AI
pushed a commit
that referenced
this pull request
Mar 10, 2026
* Fix TypeScriptAppHost playground app Fixes #14927 * Fix ReferenceExpression to support handle-based construction in TypeScript SDK The generated TypeScript SDK calls `new ReferenceExpression(handle, client)` for server-returned properties like uriExpression and jdbcConnectionString, but the constructor was private and only accepted (format, valueProviders). This caused TS2673 compilation errors in all polyglot TypeScript apps. Changes: - Make constructor public with dual-mode support (expression + handle) - Add constructor overloads to enforce valid parameter pairing at compile time - Store _client field for forward compatibility with other handle-wrapping types - Update toJSON() to delegate to handle serialization in handle mode - Update verified snapshot to match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Include TypeScriptAppHost .aspire/settings.json in source control Add a local .gitignore to override the global .aspire/ exclusion, so that integration packages are tracked for this playground app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Fixes #14927