-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Discussion] Consider generating sub-types into separate files as well #18
Comments
One of my use cases for genes is (eventually) publishing some generated js code. To have the best interop (and ease documentation) having the same structure is quite useful. Your scenario I think is actually more of a limitation of javascript tree shaking. If the bundler was "smarter" it should be able to split these (but none do, I tested some similar things). But, the way things currently work, it shouldn't be too hard to add a flag to force every type to get their own module, which would allow your use case too. |
Another option is to produce a warning if you're using dynamicImport but a type from the same module is imported outside of the callback. |
Information like that would be useful too 👍 |
The above code will not enjoy code splitting because of the generated static import for sub-type
Bar
:Could this be improved by generating sub-types into separate files too? Are there any implications?
The text was updated successfully, but these errors were encountered: