Skip to content

Typescript in template code #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
redmagic opened this issue Jun 30, 2021 · 2 comments
Closed

Typescript in template code #378

redmagic opened this issue Jun 30, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@redmagic
Copy link

Describe the bug
I am using a nullish coalescing operator in template code, like so <span>{$someStore.someProperty ?? ''}</span>

Logs
Nothing special is logged

To Reproduce
Clone from https://github.com/redmagic/transpile-template-code
npm i
npm start
Inspect file dist/main.js and search for "123", here you can see the ?? is not transpiled

Expected behavior
The operator should be transpiled like here: https://www.typescriptlang.org/play?target=2#code/MYewdgziA2CmB00QHMAUBXMATWAzAlmLFgAQD8ZJATAJRA

@kaisermann
Copy link
Member

kaisermann commented Jun 30, 2021

Hey @redmagic 👋

Currently using typescript in expressions inside your markup is not supported. This is kind of being discussed on: #318.

I've added a note about this on the TypeScript limitations section: https://github.com/sveltejs/svelte-preprocess/blob/main/docs/preprocessing.md#typescript---limitations

@kaisermann kaisermann added the enhancement New feature or request label Jun 30, 2021
@redmagic
Copy link
Author

Hi there!

Thanks for your quick reply, I'll keep an eye on that disscussion, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants