Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
54fb516
feat(typespec-ts): generate structured JSONL and SSE streaming by def…
l0lawrence Aug 10, 2026
6562c02
build(typespec-ts): update pnpm-lock.yaml for streaming devDependencies
l0lawrence Aug 10, 2026
99f04d9
Merge upstream Azure/typespec-azure main into l0lawrence-vigilant-system
l0lawrence Aug 10, 2026
3bcf917
fix(typespec-ts): address structured streaming review bugs
l0lawrence Aug 11, 2026
defc091
Merge branch 'main' of https://github.com/Azure/typespec-azure into HEAD
l0lawrence Aug 17, 2026
f96e675
test(typespec-ts): add SSE streaming spector integration baseline
l0lawrence Aug 17, 2026
faceb6a
build: clean pnpm-lock to only streaming deps
l0lawrence Aug 17, 2026
f4a1859
style: fix prettier formatting in SSE streaming snapshots
l0lawrence Aug 17, 2026
5e82fbf
test(typespec-ts): add live SSE spector runtime integration test
l0lawrence Aug 18, 2026
96cacd7
build(typespec-ts): use catalog: protocol for @azure/core-sse
l0lawrence Aug 18, 2026
de9a333
test(typespec-ts): combine streaming unit scenarios into one md
l0lawrence Aug 18, 2026
d800ce5
docs(typespec-ts): drop redundant default-behavior note from getStruc…
l0lawrence Aug 18, 2026
c6fd606
fix(typespec-ts): yield primitive SSE payloads and tighten core-sse g…
l0lawrence Aug 18, 2026
1a2adc2
feat(typespec-ts): add environment polyfills for streaming helpers
l0lawrence Aug 19, 2026
b9b4d00
fix(typespec-ts): add context to SSE deserialization errors
l0lawrence Aug 19, 2026
68b5a7b
feat(typespec-ts): preserve named SSE event types
l0lawrence Aug 19, 2026
a928fda
fix(typespec-ts): consume terminal SSE events internally and wrap nam…
l0lawrence Aug 19, 2026
4b39604
wip terminal event
l0lawrence Aug 19, 2026
cf86de5
fix(typespec-ts): update streaming declaration baseline
l0lawrence Aug 20, 2026
c96ee67
non-literal terminal value
l0lawrence Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@azure-tools/typespec-ts"
---

Generate structured JSONL and SSE streaming operations by default. A JSONL or SSE stream response now returns `Promise<AsyncIterable<T>>` of deserialized items/events instead of the previous raw binary `Uint8Array` body. An operation returning `JsonlStream<T>` lazily decodes JSON Lines into `AsyncIterable<T>`, and an operation returning `SSEStream<T>` returns an `AsyncIterable` of the event payload types, dispatching each Server-Sent Event by its `event:` name (using `@azure/core-sse`), deserializing each payload, and stopping at the terminal event. This is the default behavior — there is no opt-in option.
4 changes: 4 additions & 0 deletions packages/typespec-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@
"@azure/core-lro": "catalog:",
"@azure/core-paging": "catalog:",
"@azure/core-rest-pipeline": "catalog:",
"@azure/core-sse": "catalog:",
"@azure/core-util": "catalog:",
"@azure/logger": "catalog:",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/openapi": "workspace:^",
"@typespec/rest": "workspace:^",
"@typespec/streams": "workspace:^",
"@typespec/sse": "workspace:^",
"@typespec/events": "workspace:^",
"@typespec/versioning": "workspace:^",
"@typespec/xml": "workspace:^",
"@typespec/ts-http-runtime": "catalog:",
Expand Down
1 change: 1 addition & 0 deletions packages/typespec-ts/spector.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ specs:
azure/client-generator-core/client-doc: true
azure/client-generator-core/response-as-bool: true
documentation: true
streaming/sse: true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

is there anything else that should be added?


# Disabled: needs tcgc upgrade https://github.com/Azure/typespec-azure/pull/3997
client/structure/renamed-operation: false
Expand Down
15 changes: 15 additions & 0 deletions packages/typespec-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import {
PollingHelpers,
SerializationHelpers,
SimplePollerHelpers,
SseStreamingHelpers,
StorageCompatHelpers,
StreamingHelpers,
UrlTemplateHelpers,
XmlHelpers,
} from "./modular/static-helpers-metadata.js";
Expand Down Expand Up @@ -87,6 +89,10 @@ import { emitNonModelResponseTypes, emitTypes } from "./modular/emit-models.js";
import { emitSamples } from "./modular/emit-samples.js";
import { emitTests } from "./modular/emit-tests.js";
import { getClassicalClientName } from "./modular/helpers/naming-helpers.js";
import {
packageHasSseStreaming,
packageHasStructuredStreaming,
} from "./modular/helpers/operation-helpers.js";
import type { ModularEmitterOptions } from "./modular/interfaces.js";
import { packageUsesXmlSerialization } from "./modular/serialization/build-xml-serializer-function.js";
import { transformClientOptions } from "./transform/transform-client-options.js";
Expand Down Expand Up @@ -140,6 +146,8 @@ export async function $onEmit(context: EmitContext) {
...MultipartHelpers,
...CloudSettingHelpers,
...XmlHelpers,
...(packageHasStructuredStreaming(dpgContext) ? StreamingHelpers : {}),
...(packageHasSseStreaming(dpgContext) ? SseStreamingHelpers : {}),
...(resolvedEmitterOptions.generateTest ? CreateRecorderHelpers : {}),
...(resolvedEmitterOptions.enableStorageCompat ? StorageCompatHelpers : {}),
},
Expand Down Expand Up @@ -449,6 +457,10 @@ export async function $onEmit(context: EmitContext) {
if (packageUsesXmlSerialization(dpgContext.sdkPackage)) {
dependencies["fast-xml-parser"] = "^4.5.0";
}
// Add @azure/core-sse if structured SSE streaming is used
if (packageHasSseStreaming(dpgContext)) {
dependencies["@azure/core-sse"] = "^2.1.3";
}
modularPackageInfo = {
...modularPackageInfo,
dependencies,
Expand Down Expand Up @@ -502,6 +514,9 @@ export async function $onEmit(context: EmitContext) {
if (packageUsesXmlSerialization(dpgContext.sdkPackage)) {
additionalDependencies["fast-xml-parser"] = "^4.5.0";
}
if (packageHasSseStreaming(dpgContext)) {
additionalDependencies["@azure/core-sse"] = "^2.1.3";
}
const modularPackageInfo = {
exports: getModuleExports(context, modularEmitterOptions),
...(Object.keys(additionalDependencies).length > 0 && {
Expand Down
5 changes: 5 additions & 0 deletions packages/typespec-ts/src/modular/external-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export const AzureCoreDependencies: CoreDependencies = {
module: "@azure/core-rest-pipeline",
name: "NodeReadableStream",
},
createSseStream: {
kind: "externalDependency",
module: "@azure/core-sse",
name: "createSseStream",
},
};

export const AzureIdentityDependencies = {
Expand Down
Loading
Loading