-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: support type imports #3706
Conversation
Only reason for an option rather than being default behavior is that it requires TS 3.8. Maybe some "minimum TS version" rather than an explicit option makes more sense? |
This is awesome! Thank you @SimenB ! This could work, and could be optional via configuration. What about importing enums and other things? how is it effected? because |
Are enums imported as values anywhere? The test should probably try to compile the module we generate with https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function |
For example, there are const enums used as values not types. So I think |
|
3ec140a
to
4f425e8
Compare
Any chances this useful feature to be merged? 😺 |
@vatosarmat merging :) Thanks @SimenB , sorry it took so long. |
The latest changes of this PR are available as alpha in npm: Quickly update your package.json by running:
|
Thanks @dotansimha! I believe this was still incomplete, happy to hear you'll fix the missing parts 👍 I wanted to add some tests with |
Tested this out now in the new release, and it works for some cases. However, it does not affect
@dotansimha My OSS backlog is really long right now, so I won't be able to work on this to properly polish it. 🤞 you can 😀 |
Very rough start on #3695. Not sure how you want to handle this. I'll probably just do the ones we need at work (which means Apollo TS), but it should be fine to expand as we go?
(is there some watch mode I can run that builds as we go? right now I do a full
yarn build
every time I change something, which seems suboptimal)