Skip to content

Releases: carbon-design-system/sveld

v0.20.0

20 Apr 21:31
Compare
Choose a tag to compare

Features

  • support component generics via the custom @generics tag

Currently, to define generics for a Svelte component, you must use generics attribute on the script tag. Note that this feature is experimental and may change in the future.

However, the generics attribute only works if using lang="ts"; the language server will produce an error if generics is used without specifying lang="ts".

<!-- This causes an error because `lang="ts"` must be used. -->
<script generics="Row extends DataTableRow = any"></script>

Because sveld is designed to support JavaScript-only usage as a baseline, the API design to specify generics uses a custom JSDoc tag @generics.

Signature:

/**
 * @generics {GenericParameter} GenericName
 */

Example

/**
 * @generics {Row extends DataTableRow = any} Row
 */

The generated TypeScript definition will resemble the following:

export default class Component<Row extends DataTableRow = any> extends SvelteComponentTyped<
  ComponentProps<Row>,
  Record<string, any>,
  Record<string, any>
> {}

v0.19.2

09 Apr 00:05
Compare
Choose a tag to compare

Fixes

  • ComponentParser should remove carriage returns (Windows)

This package is now published with provenance.

v0.19.1

18 Oct 03:43
Compare
Choose a tag to compare

Fixes

  • only print outFile when writing Markdown file (#110)
  • upgrade svelte-preprocess and typescript to ameliorate peer dependency warning (#111)

v0.19.0

19 Jul 16:00
Compare
Choose a tag to compare

Breaking Changes

  • if using Svelte 3, the generated TypeScript definitions now require version 3.55 or higher

Features

  • support Svelte 4 in the generated TypeScript definitions (#109)

v0.18.1

04 Jun 16:46
Compare
Choose a tag to compare

Fixes

v0.18.0

22 Oct 20:38
Compare
Choose a tag to compare

Breaking Changes

  • remove sveltekit:* attributes from type definitions (ce06f35, #96)

Features

  • support @slot tag descriptions for named slots (f2ad4aa, #100)
  • support @event tag descriptions (0f04d91, #99)

v0.17.2

13 Jun 14:59
Compare
Choose a tag to compare

Fixes

v0.17.1

03 Jun 01:20
Compare
Choose a tag to compare

Fixes

  • use correct type for forwarded cut/copy/paste events (0dc6cf8, #92)

v0.17.0

21 May 20:17
Compare
Choose a tag to compare

Breaking Changes

  • remove @required tag; directly infer if a prop is required (06997cf, #91)

    Input

    /**
      * @type {boolean}
      */
    export let prop;

    Output

    export interface InputProps {
      /**
      * @default undefined
      */
      prop: boolean;
    }

v0.16.1

20 May 15:21
Compare
Choose a tag to compare

Fixes