---
changeKind: breaking
packages:
  - "@typespec/compiler"
---

Remove deprecated items:
  - `@deprecated` decorator, use `#deprecated` directive instead

    ```diff lang=tsp
    - @deprecated("Message")
    + #deprecated "Message"
    ```

  - `@service` `versions` support. Either migrate to `@OpenAPI.info` or the versioning library
  
    ```diff lang=tsp
    - @service({version: "1.0"})
    + @service
    + @OpenAPI.info(#{version: "1.0"})
    ```

  - Removed `@knownValues`. Use a union with a string variant instead
    
    ```diff lang=tsp
    - enum MyKnownValues {a, b}
    - @knownValues(MyKnownValues)
    - scalar Custom extends string;
    + union Custom {
    +   "a", "b", string
    + };
    ```

  - Removed `@projectedName` Migrate to `@encodedName` instead.

    ```diff lang=tsp
    - @projectedName("json", "nbf")
    + @encodedName("application/json", "nbf")
    notBefore: int32;
    ```

  - CLI configuration value `output-path`, use `output-dir` instead.

  - Support for `cadlMain` in `package.json`. Migrate to `exports["."].tsp` instead.
    
    ```diff lang=json
    - "cadlMain": "lib/main.tsp",
    + "exports": {
    +   ".": {
    +     "tsp": "lib/main.tsp"
    +   }
    + }
    ```
    
  - Compiling `.cadl` files, use `.tsp` instead.

  - `decoratorArgMarshalling` flag in `$flags` was removed and support for the `legacy` 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` -> Use `extern dec` to define the signature of decorators instead
    - `validateDecoratorParamType` -> Use `extern dec` to define the signature of decorators instead
    - `createDecoratorDefinition` -> Use `extern dec` to define the signature of decorators instead
    - `CompilerOptions#emitters` -> Use `emit` and `options` field instead.
    - `Type#templateArguments` -> Use `templateMapper` instead.
    - `ModelProperty#default` -> Use `defaultValue` instead.
    - `Union#options` -> Use `variants` instead.
    - `linter` in `createTypeSpecLibrary` -> Use `export const $linter = defineLinter({ ... })` instead.
    - Accessor for removed `@knownValues` decorator
      - `getKnownValues`
    - Accessor for removed `@projectedName` decorator
      - `getProjectedNames`
      - `getProjectedName` 
      - `hasProjectedName` 
