April 2023
New Features
Section titled “New Features”@typespec/compiler
Section titled “@typespec/compiler”- Emit diagnostic when ambiguous symbol exists between global and usings
- Add support for referencing metatypes ModelProperty
::type
and Operation::returnType
and::parameters
- Relax constraint on derived type overrides
- Prevent use of augment decorators on instantiated templates.
- Allow projectedNames helpers to work with previous projections
- Add helper
interpolatePath
for emitter to do additional interpolation on config properties - Api: Update
getTypeName
to omit standard library namespace - Allow overloads in interfaces to work under projection
- Add pre-projection support
- Provide access to extended interfaces in type graph
- Document member ordering and fix projection rename reordering
@typespec/openapi3
Section titled “@typespec/openapi3”- Support shared routes
- Update to use new
interpolatePath
logic to resolve theoutput-file
@typespec/migrate
Section titled “@typespec/migrate”- Add migrate script for zonedDateTime
- Add migration script for
@header
and@query
format required
Bug Fixes
Section titled “Bug Fixes”@typespec/compiler
Section titled “@typespec/compiler”- Fix: emitter framework will now visit scalar declarations
- Fix: Alias unknown ref crash
- Fix: Empty model expression assignable to array
- Fix:
tsp code uninstall
not finding extension to uninstall - Fix: Issue where template parameter type check wouldn’t work if constraint is exact same type as next validation
@typespec/rest
Section titled “@typespec/rest”- Fix: Issue where
@action("")
was treated the same as@action
. Now this emits an error.
@typespec/versioning
Section titled “@typespec/versioning”- Fix: Issue with using version as a template parameter across different namespaces. Includes a significant change in the versioning library internals.
- Fix:Use pre-projections to fix issues with versioned resources.
VS Code extension
Section titled “VS Code extension”- Fix: Highlighting of TypeSpec code blocks in markdown.
Breaking Changes
Section titled “Breaking Changes”@typespec/versioning: Removed deprecated versioning symbols.
Section titled “@typespec/versioning: Removed deprecated versioning symbols.”- Removed
@versionedDependency
decorator. Use@useDependency
instead. - Removed
getRenamedFromVersion
. UsegetRenamedFromVersions
instead. - Removed
getRenamedFromOldName
. UsegetNameAtVersion
instead. - Removed
getAddedOn
,addedAfter
,getRemovedOn
andremovedOnOrBefore
. UseexistsAtVersion
instead. - Removed
renamedAfter
. UsehasDifferentNameAtVersion
instead.
@typespec/compiler: Removed zonedDateTime
and replaced with utcDateTime
and offsetDateTime
Section titled “@typespec/compiler: Removed zonedDateTime and replaced with utcDateTime and offsetDateTime”To disambiguate important time concepts and encourage best practice behavior in representing date-time types we
removed zonedDateTime
which was being used to represent a time with offset, and replaced it with two new types that are more precisely defined:
utcDateTime
which represents a precise instant in time. This type should be used to represent time values given in coordinated universal time (UTC) and unix timestamps. This is the preferred mechanism for capturing dateTime in most service specifications.offsetDateTime
which represents a time with offset. Note that while this time contains an offset from UTC, it does not contain any additional time zone information.
Change instances of zonedDateTime
to utcDateTime
Section titled “Change instances of zonedDateTime to utcDateTime”model MyModel { createdAt: zonedDateTime;}
model MyModel { createdAt: utcDateTime;}
Use the (experimental) Migration tool to make this change
Section titled “Use the (experimental) Migration tool to make this change”The (experimental) migration tool will automatically migrate instances of zonedDateTime
to utcDateTime
. To perform all migrations in a TypeSpec or Cadl specification package, execute:
npx @typespec/migrate
If you would like to execute from a different folder or don’t have a package.json that indicates compiler package versions, please see command line options:
npx @typespec/migrate --help
@typespec/http: Removed header and query default format
Section titled “@typespec/http: Removed header and query default format”@header
and @query
no longer default the format
to csv
and multi
respectively. A value must now be provided when the type is an array. The migration tool can also be used to make this change.
@typespec/lint: Removed global state
Section titled “@typespec/lint: Removed global state”Rules from another library can no longer be enabled on a LibraryLinter.