-
Notifications
You must be signed in to change notification settings - Fork 414
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
TypeScript support #197
Comments
Hi, any news on this? |
To make that happen we'll need to migrate to Babel 7 and make sure all works with |
This, however, will not help the ones working on projects bootstrapped with |
No, it won't work. Linaria is a Babel preset. AFAIK TypeScript doesn't allow you to transform its AST like Babel does. However, with Babel 7 you should be able to technically pre-compile your app (typescript and linaria presets required) before it goes to |
TypeScript has support for transformers: microsoft/TypeScript#13764 |
Not only that, but a type declaration ( |
cc @Esemesek, our ts hero |
Thanks, I'll check later tonight when I'm home.
…On Fri, 19 Oct 2018, 18:04 Satyajit Sahoo, ***@***.***> wrote:
@resir014 <https://github.com/resir014> can you check #263
<#263> if it helps?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#197 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFZshdl4HLc6RZbwXDMM5BY9-Zedfv_fks5umbGlgaJpZM4RuQMf>
.
|
Can this be closed? We now use Babel 7 and also ship TypeScript definitions. |
For TS support: you need to use babel 7 with typescript preset. |
Fucking around with linaria on weekends in preparation for when we stop supporting IE11 in production and i can swap from styled-components. Making sure the SSR all works etc etc i'm finding the lack of documentation for typescript support basically null, after reading the documentation it's starting to look like i'm literally forced to stop using awesome-typescript-loader (in dev) and ts-loader (in prod build for multi-threading with happypack which comes in slightly faster than ATL), just to use linaria and instead reconfigure my entire application to use babel. Is there a workaround where i can configure the SSR to work without using babel and not get the "Error using the "styled" tag in runtime is not supported....." |
Unfortunately no, TypeScript compiler do not provide public API for writing custom transformers, so we cannot support |
FWIW, here's the issue that tracks adding support for custom transformers to the TypeScript compiler: microsoft/TypeScript#14419 |
@zamotany Anychance in the intermediatory period we could have some cool babel cats out there setup a typescript example setup of both frontend / backend Typescript + Babel + Linaria? Spent about 8 hours now trying to configure something that will work but as someone with little babel experience (and someone who finds the babel documentation and plugin system confusing) it would be great to have an example template which shows the two running together. (Backend with Linaria/Typescript/Babel for SSR). |
Hi and thanks for linaria! In our project we use typescript namespaces, so we can't move to @babel/preset-typescript (it doesn't support namespaces). It would be really cool to have linaria worked with ts-loader. Is there any chance? |
@geakstr have you tried running babel in front of ts-loader? |
@chrisabrams yes, from webpack config:
.babelrc
In runtime: |
Wow, got it work! The problem was |
Hi, It seems like Related documentation: https://github.com/TypeStrong/ts-loader#getcustomtransformers |
Hello, this project looks awesome but it requires Babel... I have rich experience in writing TypeScript transformers, for example react-refresh-typescript to the official I'd like to write a TypeScript version so I (and other people) can use this project with ts-loader. But if I made that, will this project accept the PR? |
Hi @Jack-Works We will. But I bet that it wouldn't be simple :) |
@Jack-Works If you really want to try, you can create an issue and I will help you with planning and implementation, because such a task requires a few new abstractions in our existing code base. |
I'd like to introduce jest-file-snapshot and let test cases become a folder on their own (so I can share the test with TypeScript after I start coding). An example in my project: Is this ok? @Anber |
Sounds good to me. |
No description provided.
The text was updated successfully, but these errors were encountered: