From d319e3324adcb2e33e5bababfe8f7267fac38052 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 14 Jun 2024 11:17:56 -0700 Subject: [PATCH] Add new const keyword breaking note (#3584) fix #3583 --- docs/release-notes/release-2024-06-10.md | 17 ++++++++++++++++- packages/compiler/CHANGELOG.md | 16 ++++++++++++++++ .../release-notes/release-2024-06-10.md | 17 ++++++++++++++++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/release-2024-06-10.md b/docs/release-notes/release-2024-06-10.md index 5e37300aee..e709eb902b 100644 --- a/docs/release-notes/release-2024-06-10.md +++ b/docs/release-notes/release-2024-06-10.md @@ -3,7 +3,7 @@ title: 0.57 - June 2024 --- :::warning -This release contains deprecations +This release contains deprecations and breaking changes ::: ## Values In TypeSpec @@ -51,6 +51,21 @@ const ip: ipV4 = ipV4.fromInt(3232235776); [See values doc for more info](https://typespec.io/docs/language-basics/values) +## Breaking changes + +- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick. + +```tsp +model Test { + // error + const: string; + + // correct + `const`: string; + +} +``` + ## Deprecations ### @typespec/compiler diff --git a/packages/compiler/CHANGELOG.md b/packages/compiler/CHANGELOG.md index ae3b417513..6772d6c83e 100644 --- a/packages/compiler/CHANGELOG.md +++ b/packages/compiler/CHANGELOG.md @@ -2,6 +2,22 @@ ## 0.57.0 + +### Breaking changes + +- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick. + +```tsp +model Test { + // error + const: string; + + // correct + `const`: string; + +} +``` + ### Bug Fixes - [#3399](https://github.com/microsoft/typespec/pull/3399) Preserve leading whitespace in fenced blocks in doc comments diff --git a/packages/website/versioned_docs/version-latest/release-notes/release-2024-06-10.md b/packages/website/versioned_docs/version-latest/release-notes/release-2024-06-10.md index 5e37300aee..e709eb902b 100644 --- a/packages/website/versioned_docs/version-latest/release-notes/release-2024-06-10.md +++ b/packages/website/versioned_docs/version-latest/release-notes/release-2024-06-10.md @@ -3,7 +3,7 @@ title: 0.57 - June 2024 --- :::warning -This release contains deprecations +This release contains deprecations and breaking changes ::: ## Values In TypeSpec @@ -51,6 +51,21 @@ const ip: ipV4 = ipV4.fromInt(3232235776); [See values doc for more info](https://typespec.io/docs/language-basics/values) +## Breaking changes + +- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick. + +```tsp +model Test { + // error + const: string; + + // correct + `const`: string; + +} +``` + ## Deprecations ### @typespec/compiler