Comments (13)
@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 template
folder. Havent tested it but it should be possible until this issue is resolved.
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 😄
from generator-react-sdk.
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.
from generator-react-sdk.
@magicmatatjahu There is no way of doing this manually currently, right? Since I can't change what plugins are sent to the rollup invocation.
Is there actually any more work required than to just add the typescript plugin along with the babel one?
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.
from generator-react-sdk.
Is there actually any more work required than to just add the typescript plugin along with the babel one?
We wanted add TS supports in first 0.1.0
version, but we realized that we don't have a TS integration inside generator, so we avoided it, but yes, in sdk
there is only needed add rollup plugin for TypeScript and configured it.
And as @jonaslagoni wrote, at the moment you can write template in separate folder (e.g. templateTS
) and check in tsconfig.json
as output dir template
, run tsc
and then run generator.
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.
Rollup is needed for simplify template code and transform ESmodules
to CommonJS
modules. Of course if you want use sdk
as a standalone package, then you can use it without worrying about the rollup. Rollup is for Generator itself.
from generator-react-sdk.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
from generator-react-sdk.
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 <>foobar</>
. @jonaslagoni Can we accept this solution or wait for fixing typings? As you see issue is opened in 2017 year, so I think that it won't be fixed quickly.
from generator-react-sdk.
@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...
from generator-react-sdk.
selectively exclude errors/warnings from react
is not that easy 😄 We can make wrapper for string, but then it will be more difficult to use than using fragments <></>
from generator-react-sdk.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
from generator-react-sdk.
Still relevant, but we must handle that problem #3 (comment)
from generator-react-sdk.
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 ❤️
from generator-react-sdk.
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
<>foobar</>
. @jonaslagoni Can we accept this solution or wait for fixing typings? As you see issue is opened in 2017 year, so I think that it won't be fixed quickly.
Is this still a problem, because there exists a Text
component. It is also possible to use this workaround if still needed.
import React, { ReactElement } from 'react'
function Component() {
return ("foobar" as unknown) as ReactElement
}
function App() {
return (
<Component /> // no error
);
```
from generator-react-sdk.
Related Issues (14)
- Simplify `File template` feature HOT 6
- Update README with new logo banner HOT 3
- unnecessary assertion since it does not change the type of the expression. HOT 6
- Release as version 1 HOT 2
- Need for urgent changes in GitHub Actions automation
- Integrate context inside React renderer HOT 5
- Adding all generator codeowners here HOT 3
- LICENSE file is missing information HOT 9
- Update dependencies. HOT 2
- markdown-template failing for us since generator-react-sdk:0.1.5 was released HOT 2
- JSDoc is not generated HOT 1
- react warnings are loud when generating react templates HOT 7
- Support asynchronous template functions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-react-sdk.