You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch from svelte.JSX to svelte/elements (depends on Svelte 3.55.0)
Decide whether to use svelte-package or augment sveld
svelte-package allows us to write components with <script lang=ts> and ship carbon-components-svelte with .svelte and .d.ts pairs. Sveld is likely still needed to generate documentation.
We probably have to add Svelte as a peerDependency, making this a breaking change.
I tried to use <script lang=ts> for TextInput and assigned a type to one of the prop variables.
Is there some more setup that needs to happen before TypeScript can be adopted?
5:50:05 pm [vite] Internal server error: C:/code/carbon-components-svelte/src/TextInput/TextInput.svelte:10:20 Unexpected token
- Did you forget to add a TypeScript preprocessor? See https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/preprocess.md for more information.
Plugin: vite-plugin-svelte
File: C:/code/carbon-components-svelte/src/TextInput/TextInput.svelte:10:20
8 | * Set to "char" to enable display the character counter or "word" to display the word count.
9 | */
10 | export let counter: "char" | "word" | undefined = undefined;
^
11 |
12 | /** Set to `true` to disable the input */
Using lang="ts" is out of scope for the time being. We may eventually use it after closing #1871 since @sveltejs/package can convert .svelte files containing lang="ts" into respective .svelte and .svelte.d.ts files (it actually runs all preprocessors); allowing users to consume carbon-components-svelte, with type safety, and only optionally needing vitePreprocess.
Users today can use carbon-components-svelte with or without TS. If we adopt lang="ts" it can be done incrementally, post-v1, and without needing to ship a breaking change
Please use JSDoc for now, as Sveld can build declarations files and documentation for us.
As advised in #1614 (comment)
svelte.JSX
tosvelte/elements
(depends on Svelte 3.55.0)svelte-package
or augmentsveld
svelte-package
allows us to write components with<script lang=ts>
and shipcarbon-components-svelte
with.svelte
and.d.ts
pairs. Sveld is likely still needed to generate documentation.We probably have to add Svelte as a
peerDependency
, making this a breaking change.Related: #1629, #1871
The text was updated successfully, but these errors were encountered: