-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support TS in sdk #3
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
@magicmatatjahu There is no way of doing this manually currently, right? Since I can't change what plugins are sent to the rollup invocation. Or even better, is there a way to disable rollup? Things seemed to work just fine for me, running it all through ts-node, but now rollup can't include my .ts-files. |
@Stmated theoretically you could do your own pre-transpilation process. i.e. keep the template files under a different folder and then add your own transpiler process and output it to the Also if you feel the need for the option to disable the entire transpilation process feel free to create an issue with the use-case 😄 |
We wanted add TS supports in first And as @jonaslagoni wrote, at the moment you can write template in separate folder (e.g.
Rollup is needed for simplify template code and transform |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
Supporting TS has a one (for me huge) problem -> DefinitelyTyped/DefinitelyTyped#20544 TS always complains about returned string from components: function Component() {
return "foobar";
}
function App() {
return (
<Component /> // error JSX element type 'string' is not a constructor function for JSX elements.
);
} So we must wrap string to fragment like |
@magicmatatjahu hmm, yea I would consider that a problem as well... However I think I could live with that as well, the problem (to me at least) is being able to effectively describe this to the template developers 🤔 This issue combined with #37, do you think there is any way we can create a wrapper for React to selectively exclude errors/warnings from react? While still making it maintainable of course... |
|
This issue has been automatically marked as stale because it has not had recent activity 😴 |
Still relevant, but we must handle that problem #3 (comment) |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Is this still a problem, because there exists a import React, { ReactElement } from 'react'
function Component() {
return ("foobar" as unknown) as ReactElement
}
function App() {
return (
<Component /> // no error
);
``` |
Something that may help is adding export declare type PropsWithChildrenContent<P> = P & {
children?: ReactNode;
childrenContent?: string;
}; |
Reason/Context
As in title. Support TS in react-sdk. It should be done at this same moment next to asyncapi/generator#455
Description
It need to be use the official TS Rollup plugin https://github.com/rollup/plugins/tree/master/packages/typescript
The text was updated successfully, but these errors were encountered: