-
Notifications
You must be signed in to change notification settings - Fork 404
Typescript extractor #228
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 extractor #228
Conversation
…sform-typescript only supports very old Typescript version.
5155fa4
to
e7c8ae1
Compare
One more thing, no idea where to write unit test for this |
@huan086 Thank you for this PR! Great work! Babel 7 will be used in next major version (3.x). Right now it's used in For the unittests, I would put then in |
Currently writing the Typescript definitions and submitting them to DefinitelyTyped. Facing difficulties for @lingui/react because the react types are quite hard to understand. After the typings are done, I'll be able to write the unit tests without typescript complaining about xxx is not a module. |
Fix typescript extractor not able to parse non-JSX Typescript files.
This looks solid! Would you be interested in updating Typescript guide? Is there any special setup required to make typescript work or is it enough to install |
No special setup needed. The original typescript implementation already did all the groundwork 😊 |
Awesome! 👍 |
Fixed and released in v2.2.0. Thanks to all involved! |
Resolves #151 by using
typescript
to output ES2016 to preserve tagged template literal, and to preserve JSX. The result is then passed to existing lingui transforms and extract.Known issues:
typescript
currently supports new features like fragment syntax<>children</>
, but these are only supported in Babel 7. Thus the extractor cannot parse files using the new features. I'm not sure if we should upgrade to Babel 7 (still in beta) to solve this.