Releases: microsoft/typespec
@typespec/[email protected]
@typespec/[email protected]
@typespec/[email protected]
@typespec/[email protected]
Bug Fixes
- #6648 Fix
tsp install
broken in standalone CLI
@typespec/[email protected]
Bump version to get package out of the state where the current versio…
@typespec/[email protected]
Features
- #6507 Scaffolding updates for rc
@typespec/[email protected]
Bug Fixes
- #6521 Add explicit
application/json
content type for some test cases to avoid wrong content type inferred from http lib.
@typespec/[email protected]
Bug Fixes
- #6521 Fix response scenarios
[email protected]
@typespec/compiler
Breaking Changes
-
#6231 Remove deprecated items:
-
@deprecated
decorator, use#deprecated
directive instead- @deprecated("Message") + #deprecated "Message"
-
@service
versions
support. Either migrate to@OpenAPI.info
or the versioning library- @service({version: "1.0"}) + @service + @OpenAPI.info(#{version: "1.0"})
-
Removed
@knownValues
. Use a union with a string variant instead- enum MyKnownValues {a, b} - @knownValues(MyKnownValues) - scalar Custom extends string; + union Custom { + "a", "b", string + };
-
Removed
@projectedName
Migrate to@encodedName
instead.- @projectedName("json", "nbf") + @encodedName("application/json", "nbf") notBefore: int32;
-
CLI configuration value
output-path
, useoutput-dir
instead. -
Support for
cadlMain
inpackage.json
. Migrate toexports["."].tsp
instead.- "cadlMain": "lib/main.tsp", + "exports": { + ".": { + "tsp": "lib/main.tsp" + } + }
-
Compiling
.cadl
files, use.tsp
instead. -
decoratorArgMarshalling
flag in$flags
was removed and support for thelegacy
decorator arg marshalling. -
Using
@format
on bytes.@format
can only be used on string where it defines a known pattern for the string. -
Javascript functions and typescript types:
stringTemplateToString
CadlLanguageConfiguration
CadlPrettierPlugin
NodePackage
->PackageJson
CadlValue
->TypeSpecValue
createCadlLibrary
->createTypeSpecLibrary
setCadlNamespace
->setTypeSpecNamespace
CadlLibrary
->TypeSpecLibrary
SyntaxKind.CadlScript
->SyntaxKind.TypeSpecScript
isCadlValueTypeOf
->isTypeSpecValueTypeOf
cadlTypeToJson
->typespecTypeToJson
checkFormatCadl
->checkFormatTypeSpec
cadlVersion
->typespecVersion
CadlManifest
->TypeSpecManifest
validateDecoratorTargetIntrinsic
-> Useextern dec
to define the signature of decorators insteadvalidateDecoratorParamType
-> Useextern dec
to define the signature of decorators insteadcreateDecoratorDefinition
-> Useextern dec
to define the signature of decorators insteadCompilerOptions#emitters
-> Useemit
andoptions
field instead.Type#templateArguments
-> UsetemplateMapper
instead.ModelProperty#default
-> UsedefaultValue
instead.Union#options
-> Usevariants
instead.linter
increateTypeSpecLibrary
-> Useexport const $linter = defineLinter({ ... })
instead.- Accessor for removed
@knownValues
decoratorgetKnownValues
- Accessor for removed
@projectedName
decoratorgetProjectedNames
getProjectedName
hasProjectedName
-
-
#6323 Move AST related APIS to
@typespec/compiler/ast
package. This is to mark a clear separation for the AST types and APIs which are considered for advanced usage and might change at any time.- All
*Node
types exprIsBareIdentifier
getFirstAncestor
getIdentifierContext
getNodeAtPosition
getNodeAtPositionDetail
hasParseError
isImportStatement
parse
parseStandaloneTypeReference
positionInRange
visitChildren
- All
-
#6323 Stop exposing APIs that were not meant for external users. Please file issue if you had legitmate use of some of those APIs.
-
Checker
: The check itself should be used very carefully and its wouldn't be covered under the compatibility guarantees. There is some apis that were explicitly marked as internal while other remained until we provide a better way to do the same thing:getGlobalNamespaceType();
->program.getGlobalNamespaceType();
resolveTypeReference();
->program.resolveTypeReference();
checkProgram();
This isn't meant to be used by external users.getLiteralType()
This isn't meant to be used by external users.resolveRelatedSymbols()
This isn't meant to be used by external users.resolveCompletions()
This isn't meant to be used by external users.
-
Program
: Exposed functions on the program are safe to use but a few have been updated to be internal:mainFile
-> UseprojectRoot
instead.literalTypes
This isn't meant to be used by external users.checker
: This is still exposed but to be used carefully, see above.loadTypeSpecScript
: This isn't meant to be used by external users.onValidate
: This isn't meant to be used by external users.reportDuplicateSymbols
: This isn't meant to be used by external users.
-
logVerboseTestOutput
Internal test util, not meant for external users -
validateDecoratorTarget
-> migrate toextern dec
declaration -
validateDecoratorParamCount
: Same as above -
altDirectorySeparator
: Internal path utils -
directorySeparator
: Internal path utils -
isIntrinsicType
: Internal check -
getFullyQualifiedSymbolName
Symbols are an internal aspect of the compiler -
Scanner related APIs:
createScanner
isComment
isKeyword
isModifier
isPunctuation
isStatementKeyword
isTrivia
skipContinuousIdentifier
skipTrivia
skipTriviaBackward
skipWhiteSpace
Token
TokenFlags
type
DocToken,type
Scanner,type
StringTemplateToken,
-
Types
Sym
Symbols are an internal aspect of the compilerSymbolLinks
Symbols are an internal aspect of the compilerSymbolTable
Symbols are an internal aspect of the compilerSymbolFlags
Symbols are an internal aspect of the compilerMutableSymbolTable
Symbols are an internal aspect of the compilerResolutionResult
Internal type used in non exposed resolverNodeLinks
Internal type used in non exposed resolverResolutionResultFlags
Internal type used in non exposed resolverMetaMemberKey
Unused typeMetaMembersTable
Unused typeDirent
Unused type
-
#5977 Minimum node version is now 20
-
#6410 Remove a legacy behavior of resolving package names which wasn't inline with node ESM module resolution.
For example if you were running tsp compile within your node_modules folder(on a test package) and referencing your emitter by name you might need to change this
-tsp compile . --emit my-emitter +tsp compile . ../../ # path to your emitter root instead
-
#6286 Removed deprecated use of
@discriminator
on union. Migrate to@discriminated
-@discriminator("type") +@discriminated(#{envelope: "none", discriminatorPropertyName: "type"}) union Pet;
-
#6327 Remove projection. Projection was an experiemental syntax that was too flawed to be included in 1.0 in that current state.
-
#6388 Remove deprecated type to value conversion. Since the introductions of object values(
#{}
) and array values(#[]
) using model expressions or tuple where values were expected has been deprecated. It is now an error with a codefix.-@service({title: "My service"}) +@service(#{title: "My service"})
-
#6416 Adding new keywords for future use:
statemachine
macro
package
metadata
env
arg
declare
array
struct
record
module
mod
pub
sub
typeref
trait
this
self
super
keyof
with
implements
impl
satisfies
flag
auto
partial
private
public
protected
internal
sealed
local
async
-
#6258 Removed deprecated legacy visibility APIs and converted all warnings for using string-based visibility modifiers to errors.
The removed APIs include:
getVisibility
: usegetVisibilityForClass
instead.getParameterVisibility
: usegetParameterVisibilityFilter
instead.getReturnTypeVisibility
: usegetReturnTypeVisibilityFilter
instead.
Furthermore, the legacy signature of isVisible
that accepts an array of strings has been removed. Please use the new signature that accepts EnumMember
instead.
The changed decorators include:
@visibility
@parameterVisibility
@returnTypeVisibility
@withVisibility
@withDefaultKeyVisibility
The TypeSpec.DefaultKeyVisibility
template also no longer accepts a string as a visibility modifier argument.
Attempting to pass a string to any of the above decorators or templates will now result in a type-checking error. Please use the Lifecycle
visibility modifiers instead.
If you develop a third-party library and you use any custom visibility modifiers, you will need to instead define a visibility class enum. See: Visibility | TypeSpec.
Migration steps:
String-based visibilities can be replaced as follows:
"create"
,"read"
,"update"
,"delete"
, and"query"
can be replaced withLifecycle.Create
,Lifecycle.Read
,Lifecycle.Update
,Lifecycle.Delete
, andLifecycle.Query
respectively.@visibility("none")
can be replaced with@invisible(Lifecycle)
.
For example:
@visibility("create", "read")
example: string;
can be replaced with:
@visibility(Lifecycle.C...
[email protected]
Remove unnecessary empty string check (#6519) Fixes https://github.com/microsoft/typespec/issues/4344