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

babel-plugin-inferno equivalent as a TypeScript custom transformer #1154

Closed
plievone opened this issue Jun 22, 2017 · 12 comments
Closed

babel-plugin-inferno equivalent as a TypeScript custom transformer #1154

plievone opened this issue Jun 22, 2017 · 12 comments

Comments

@plievone
Copy link

Both webpack ts-loader and awesome-typescript-loader now support TypeScript custom transformers, so it could be a good time to start sketching out a babel-plugin-inferno equivalent for .tsx (without needing to pipe to babel).

Example transformer: https://github.com/TypeStrong/ts-loader/blob/master/test/comparison-tests/customTransformer/uppercaseStringLiteralTransformer.js
With typings: TypeStrong/ts-loader#535 (comment)
Usage in webpack ts-loader: https://github.com/TypeStrong/ts-loader/blob/master/test/comparison-tests/customTransformer/webpack.config.js#L18-L22

@longlho
Copy link
Member

longlho commented Jun 22, 2017 via email

@sijad
Copy link

sijad commented Jul 2, 2017

2.4 is out now, is there anything I can help with?

@Havunen
Copy link
Member

Havunen commented Jul 11, 2017

I had a really quick look at this yesterday, I believe its do-able but we would need to copy paste some functions from typescript main repo as they are not exposed :/ In The end its all about copying JSX related code from main TS repository and replacing React related things with Inferno equilevants Babel-plugin-inferno is good source for that.

@Havunen
Copy link
Member

Havunen commented Aug 9, 2017

@sijad I'm currently busy with working on Inferno 4.0, if you could work on this task it would be great for TS - inferno community 👍, I dont know if @longlho already started this or what is the status, but I guess we don't even have public repo for this atm.

Basically somebody needs to look into typescript plugins, how we could hook into the system and transform JSX nodes our own way. Here is link to babel plugin to check how JSX nodes are compiled into vNodes https://github.com/infernojs/babel-plugin-inferno

@deamme
Copy link
Member

deamme commented Aug 23, 2017

I'm working on this and I've come pretty far but just need to convert the project into TypeScript and add tests.

@deamme
Copy link
Member

deamme commented Aug 26, 2017

Please check it out: https://github.com/deamme/ts-transform-inferno
Any feedback, questions etc. is appreciated.

@longlho
Copy link
Member

longlho commented Aug 26, 2017

looks pretty good, maybe some examples & docs would be great :)

@deamme
Copy link
Member

deamme commented Aug 27, 2017

I've tried to improve README.md and there is an example folder that one can try to build and learn from.

@Havunen
Copy link
Member

Havunen commented Sep 8, 2017

Somebody please test @deamme 's solution, it looks awesome!

@deamme
Copy link
Member

deamme commented Sep 8, 2017

Not quite working with dynamic imports (code-splitting not possible). This should work but I haven't truly tried: TypeStrong/ts-loader#624

@lucat1
Copy link

lucat1 commented Oct 11, 2017

It would be awesome if rollup was also supported!

@Havunen
Copy link
Member

Havunen commented Nov 23, 2017

@deamme Can you send PR to mention this plugin in Inferno's Readme and website (https://github.com/infernojs/inferno-website) Lets close this issue :) Good job!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants