November 2023
New Features
Section titled âNew Featuresâ@typespec/compiler New Features
Section titled â@typespec/compiler New Featuresâ- Add new
unixTimestamp32scalar to standard library. - Emitter Framework: Add hook for handling circular references.
- Emitter Framework:
TypeEmitternow supports Tuples. - Emit error diagnostic if a model spreads itself within its declaration.
- Stop showing empty code frame when diagnostic has no location.
@typespec/json-schema New Features
Section titled â@typespec/json-schema New Featuresâ- Add support for
TupleLiteral.
@typespec/openapi3 New Features
Section titled â@typespec/openapi3 New Featuresâ- Support
@summaryon data types which emit the JSON Schematitleproperty.
@typespec/playground New features
Section titled â@typespec/playground New featuresâ- Add a format button to the playground command bar.
- Add a notification to the standalone playground when the playground has been saved.
- Add resizable panes for the editor and output.
Bug Fixes
Section titled âBug Fixesâ@typespec/compiler Bug Fixes
Section titled â@typespec/compiler Bug Fixesâ- Fix:
@docand jsdoc comments disappear from multi-segment or nested namespaces. - Fix: Using
@overloadcould result in incorrectunassignabletype errors. - Fix: Referencing a template in an alias might cause augment decorators to not be applied on types referenced in the aliased type.
- Fix: Issues with removing keys from
RekeyableMap. - Fix: Properties filtered with
@withVisibilitywill have their visibility removed. This prevent visibility from being applied twice and rendering invalid models.
@typespec/openapi3 Bug Fixes
Section titled â@typespec/openapi3 Bug Fixesâ- Fix: Stops emitting an error when using
@body _: voidin operation parameters and treat it as no body. - Fix: Using shared routes would, in some cases, result in a
duplicate-headererror.
Breaking Changes
Section titled âBreaking ChangesâTypescript types breaking change
Section titled âTypescript types breaking changeâThe package.json files for all packages have been changed to use the standard types field instead of the legacy typesVersions field to specify types for subpath exports. This means that packages consuming TypeSpec must use the moduleResolution setting with node16 or nodenext in their tsconfig.json.
You might see the following error:
Cannot find module '@typespec/compiler/testing'. Did you mean to set the 'moduleResolution' option to 'nodenext'This can be resolved by changing the following in tsconfig.json:
"moduleResolution": "ESNext","moduleResolution": "node16",Dropped Support for Node version 16
Section titled âDropped Support for Node version 16â- All TypeSpec packages now specify node 18 as the minimum version. Consuming packages should no longer use node 16 and update the node specification in the
enginessection of their package.json file appropriately.
@typespec/playground Breaking Changes
Section titled â@typespec/playground Breaking Changesâ- Styles must be imported seperately with
import \"@typespec/playground/styles.css\";.
@typespec/versioning Breaking Changes
Section titled â@typespec/versioning Breaking Changesâ- Update targets for
@added,@removed,@renamedFrom,@madeOptionaland@typeChangedFromto more clearly communicate where they can be used. Specs that applied these decorators to types that could not be versioned (likenamespace) will now receive an error diagnostic.