Skip to content
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

Adding instructions for Typescript/Babel 7 setup #300

Closed
Asim13se opened this issue Apr 4, 2019 · 3 comments
Closed

Adding instructions for Typescript/Babel 7 setup #300

Asim13se opened this issue Apr 4, 2019 · 3 comments
Labels
Community 👨‍👧 Something initiated by a community Documentation 📖 Issues about docs Help Wanted 🆘 Extra attention is needed

Comments

@Asim13se
Copy link

Asim13se commented Apr 4, 2019

Currently this framework does not work with Babel 7 and @babel/preset-typescript setup, the reasons are:
1- Parameter decorators is not supported by @babel/plugin-proposal-decorators
2- Babel strips type information thus Reflect.getMetadata() returns undefined, more explanation url

After spending few hours to come to this conclusion i solved these issues by installing this babel plugin babel-plugin-transform-typescript-metadata url

I liked this framework and i almost gave up on it because of these issues,
It will be good to include this in the installation guide, to make it easy for developers with Babel 7 and @babel/preset-typescript setup which is a common setup.

Thanks

@Asim13se Asim13se changed the title Adding instructions for Typescript/Babel 7 integration Adding instructions for Typescript/Babel 7 setup Apr 4, 2019
@MichalLytek
Copy link
Owner

With #296 TypeGraphQL will turn more toward TypeScript compiler, so you will miss a lot new goodness by sticking to babel.

And feel free to create a PR with a new doc page in Others section with info how to setup Typescript/Babel correctly, maybe even with an example in the repository.

@MichalLytek MichalLytek added Community 👨‍👧 Something initiated by a community Documentation 📖 Issues about docs Help Wanted 🆘 Extra attention is needed labels Apr 4, 2019
@Asim13se
Copy link
Author

Asim13se commented Apr 4, 2019

Great work on #296
Since i am not using babel heavily on backend projects it will be reasonable to switch to Typescript compiler.

Thanks

@Asim13se Asim13se closed this as completed Apr 4, 2019
@vjpr
Copy link

vjpr commented Apr 27, 2019

@Asim13se

Use this plugin: https://github.com/leonardfactory/babel-plugin-transform-typescript-metadata#readme

Also see bug in #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community 👨‍👧 Something initiated by a community Documentation 📖 Issues about docs Help Wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants