microsoft/typespec
🗑️ Deprecations
- [#10876](https://github.com/microsoft/typespec/pull/10876) Deprecated `deepClone` utility in favor of `structuredClone`. All internal usages have been replaced with the native `structuredClone` API.
✨ Features
- [#10897](https://github.com/microsoft/typespec/pull/10897) `ApplyCodeFixExpect.toEqual` now accepts `Record<string, string>` to assert on multiple files after a code fix is applied. This enables testing code fixes that write to a different file (e.g., adding augment decorators to a `client.tsp`).
- ```ts
- await ruleTester
- .expect({
- "main.tsp": `import "./client.tsp";\nmodel Foo { name: string; }`,
- "client.tsp": ``,
- })
- .applyCodeFix("add-client-override")
- + 50 more
🐛 Bug Fixes
- [#10692](https://github.com/microsoft/typespec/pull/10692) Fix spurious circular-base-type diagnostics after invalid 'model is' declarations.
- [#10684](https://github.com/microsoft/typespec/pull/10684) Fixed the compiler to correctly detect circular model spread chains while preserving support for recursive model-expression aliases.
- [#10687](https://github.com/microsoft/typespec/pull/10687) Fix wrongly detected circular reference with alias and model properties
- [#10643](https://github.com/microsoft/typespec/pull/10643) Completion in the middle of an identifier now replaces the full token instead of inserting and leaving trailing characters
- [#10827](https://github.com/microsoft/typespec/pull/10827) Language server fatal errors now write pending logs and the fatal stack trace directly to stderr so crash details remain visible.
- [#10773](https://github.com/microsoft/typespec/pull/10773) Report an error when a function is declared in the `$functions` map in a JS file but has no corresponding `extern fn` declaration in TypeSpec. Previously this would silently have no effect.
- [#10847](https://github.com/microsoft/typespec/pull/10847) [Language Server] Wrapped LSP server handlers with `wrapUnhandledError` to preserve server-side stack traces in error messages forwarded to the client. Previously, the JSON-RPC layer discarded the original stack trace, making unhandled errors in telemetry opaque.
- [#10880](https://github.com/microsoft/typespec/pull/10880) Validate function rest arguments and report function call argument count diagnostics at call sites.
📦 @typespec/http
- No changes, version bump only.
✨ Features
- [#10769](https://github.com/microsoft/typespec/pull/10769) Add `summary` and `kind` fields to `@tagMetadata` decorator.
- ```typespec
- @tagMetadata("foo", #{ summary: "all operations that allow doing Foo", kind: "FooGroup" })
- ```
- [#10770](https://github.com/microsoft/typespec/pull/10770) Add array form for `@tagMetadata` decorator to allow explicit control of tag declaration order.
- ```typespec
- @service
- @tagMetadata(#[
- + 5 more
🐛 Bug Fixes
- [#10919](https://github.com/microsoft/typespec/pull/10919) Reject duplicate tag names in @tagMetadata array form.
- [#10776](https://github.com/microsoft/typespec/pull/10776) Fix tagMetadata extension diagnostic targets
✨ Features
- [#10769](https://github.com/microsoft/typespec/pull/10769) Add `summary` and `kind` fields to `@tagMetadata` decorator.
- ```typespec
- @tagMetadata("foo", #{ summary: "all operations that allow doing Foo", kind: "FooGroup" })
- ```
- [#10770](https://github.com/microsoft/typespec/pull/10770) Add array form for `@tagMetadata` decorator to allow explicit control of tag declaration order.
- ```typespec
- @service
- @tagMetadata(#[
- + 4 more
🐛 Bug Fixes
- [#10786](https://github.com/microsoft/typespec/pull/10786) Mark models as `@error` when imported from 4xx/5xx response body schema references.
- [#10901](https://github.com/microsoft/typespec/pull/10901) Fix import of `deprecated: true` on OpenAPI3 operations to generate `#deprecated "deprecated"` directive in converted TypeSpec output.
- [#10677](https://github.com/microsoft/typespec/pull/10677) Fix custom auth scheme models leaking into `components.schemas` when declared inside the service namespace. They are now emitted only under `components.securitySchemes` as expected.
- [#10656](https://github.com/microsoft/typespec/pull/10656) Propagate `@JsonSchema.uniqueItems` to query, path and header parameter schemas. The decorator was only applied to body model property schemas; for HTTP parameter schemas (which go through `applyIntrinsicDecorators`) it was silently dropped, so arrays declared on operation parameters never emitted `uniqueItems: true` even when the decorator was present.
- ```tsp
- op listUsers(
- @query
- @JsonSchema.uniqueItems
- + 3 more
📦 @typespec/json-schema
- No changes, version bump only.
🐛 Bug Fixes
- [#10847](https://github.com/microsoft/typespec/pull/10847) Improved telemetry instrumentation for `install-global-compiler-cli`, `preview-openapi3`, `start-server`, and `server-path-changed` events by adding missing `lastStep` tracking and error detail logging. Added actionable error message when compiler is found but neither `node` nor `tsp` is available on PATH, guiding users to fix common nvm/fnm/volta configuration issues.
📦 @typespec/prettier-plugin-typespec
- No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
✨ Features
- [#10640](https://github.com/microsoft/typespec/pull/10640) Improve render of complex emitter options
- [#10640](https://github.com/microsoft/typespec/pull/10640) Render documentation for sub exports
🐛 Bug Fixes
- [#10880](https://github.com/microsoft/typespec/pull/10880) Render function type signatures with arrow syntax and avoid internal compiler imports.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
🐛 Bug Fixes
- [#10697](https://github.com/microsoft/typespec/pull/10697) Don't show file tree view in output when there is only a single file
- [#10455](https://github.com/microsoft/typespec/pull/10455) Retain the emitter query parameter in the URL when a sample is selected
- [#10815](https://github.com/microsoft/typespec/pull/10815) Fix unused `using` statements not being dimmed in the playground editor
✨ Features
- [#10798](https://github.com/microsoft/typespec/pull/10798) Support replacing member references with alternate types during mutation.
- ```ts
- return engine.replaceAndMutateReference(referenceTypes[0], alternateType, options, halfEdge);
- ```
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
✨ Features
- [#10841](https://github.com/microsoft/typespec/pull/10841) add test for discriminator model without subtypes and query params with `# @typespec/http-specs prefixes
✨ Features
- [#10799](https://github.com/microsoft/typespec/pull/10799) Added support for `Http.File` response bodies. File bodies are treated as _raw_ bytes, and the `filename` is represented in the `Content-Disposition` header.
🐛 Bug Fixes
- [#10799](https://github.com/microsoft/typespec/pull/10799) Fixed an issue with handling of `bytes` response bodies with content-types other than "application/json" that would cause http-server-js to emit an invalid attempt to call `Uint8Array.toJsonObject`.
✨ Features
- [#10372](https://github.com/microsoft/typespec/pull/10372) Rewrite using emitter framework and alloy engine
✨ Features
- [#10558](https://github.com/microsoft/typespec/pull/10558) Improve formatting of union expressions
- [#10352](https://github.com/microsoft/typespec/pull/10352) Add support for configurable options on linter rules
- Linter rules can now define typed options with defaults using `defaultOptions`, and users can pass options when enabling rules in `tspconfig.yaml` or rulesets.
- Defining a rule with options:
- ```ts
- const myRule = createRule({
- name: "no-model-with-name",
- severity: "warning",
- + 30 more
🐛 Bug Fixes
- [#10618](https://github.com/microsoft/typespec/pull/10618) [LSP] Fix code fixes often not running when selected
- [#10567](https://github.com/microsoft/typespec/pull/10567) Fix server crashes caused by undefined symbol declarations: add null checks for `getSymNode()` in hover, completion, type-details, and type-signature handlers, and use fallback name for empty DocumentSymbol names
- [#10351](https://github.com/microsoft/typespec/pull/10351) Fix formatter crash when an operation's parameter list contains only a block comment (e.g. `op find(/* conditions */): unknown;`). Dangling comments in empty parameter lists are now preserved instead of being dropped.
- [#10556](https://github.com/microsoft/typespec/pull/10556) Fix formatting of decorators on operations and augment decorators. Decorators on operations now break to separate lines when the total line exceeds the print width. Augment decorator arguments are now consistently indented when the line breaks, matching TypeScript/prettier function call formatting.
- [#10580](https://github.com/microsoft/typespec/pull/10580) Hide cursor during spinner animation to prevent flicker on Windows
🗑️ Deprecations
- [#9884](https://github.com/microsoft/typespec/pull/9884) Deprecate use of `@patch(#{implicitOptionality: true})`.
- Migrate using one of the following patterns depending on intended semantics:
- 1. Preserve previous behavior with an explicit patch model (optional properties)
- ```diff lang=typespec
- model Pet {
- name: string;
- age: int32;
- }
- + 16 more
✨ Features
- [#10180](https://github.com/microsoft/typespec/pull/10180) [API] Operation returning a union of types without status code or content type will be treated as a single response
📦 @typespec/openapi
- No changes, version bump only.
🐛 Bug Fixes
- [#10180](https://github.com/microsoft/typespec/pull/10180) Fix examples when operation return type have union of response mapping to same status code
- [#10268](https://github.com/microsoft/typespec/pull/10268) Fix missing discriminator mapping entry when the first union variant causes a circular emit, affecting both the OpenAPI 3.0 and 3.2 emitters.
📦 @typespec/json-schema
- No changes, version bump only.
🐛 Bug Fixes
- [#10567](https://github.com/microsoft/typespec/pull/10567) Handle unhandled exceptions in VS Code extension: add custom error handler for server crashes with restart notification, wrap commands with graceful exception handling, and add null guards to prevent extension host errors when LSP client is unavailable
- [#10523](https://github.com/microsoft/typespec/pull/10523) Show "Launching TypeSpec language service..." progress in the status bar instead of as a notification to avoid blocking the UI
- [#10527](https://github.com/microsoft/typespec/pull/10527) Ensure operation telemetry events always carry a valid `result` value. Previously the `start-extension` event (and any other operation whose callback returned `void`) was sent with `result="undefined"` and classified as an error event. The `doOperationWithTelemetry` callback is now constrained to return `ResultCode | Result<...>`, so the result is always derived from the operation's return value.
📦 @typespec/prettier-plugin-typespec
- No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
🐛 Bug Fixes
- [#10501](https://github.com/microsoft/typespec/pull/10501) Fix broken (404) links to linter rule pages on auto-generated linter reference pages. The links no longer drop the website base path.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
✨ Features
- [#10598](https://github.com/microsoft/typespec/pull/10598) Map TypeSpec optionality (`?`) to protobuf `optional` where appropriate.
- `optional` is applied to fields with protobuf scalar types to set explicit presence.
- `optional` is _not_ applied to fields with message types, because they _always_ have explicit presence.
- Attempting to convert a TypeSpec optional property where the type is an array or `Protobuf.Map` instance produces a warning, because protobuf cannot differentiate between "empty" and "unset" `repeated`/`map`-typed fields.
💥 Breaking Changes
- [#10468](https://github.com/microsoft/typespec/pull/10468) Remove the `newChangeDiff` emitter option. Diff highlighting of changed files and lines is now always enabled in the output viewer.
✨ Features
- [#10349](https://github.com/microsoft/typespec/pull/10349) Add compilation spinner, diff highlighting, and output preservation
🐛 Bug Fixes
- [#10442](https://github.com/microsoft/typespec/pull/10442) Fix line-level diff highlighting not appearing in the playground output editor, and reduce typing freezes by coalescing recompilations triggered while a compile is already running.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
