-
Notifications
You must be signed in to change notification settings - Fork 561
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
webcomponent output has TypeScript in a .js file #473
Comments
Good catch. Fixing default extensionsNow that we are starting to add types to the Mitosis generators' output, we need to rename the default extension(s) that our mitosis/packages/cli/src/build/helpers/extensions.ts Lines 3 to 16 in ab0708f
Allow CLI to toggle outputsAlso, we might want to add some logic to toggle TS output on/off in the CLI commands, and select
The PS: We can probably reuse this function for transpilation:
|
An a PR coming soon I’m looking to address just the first part of this, getting the extensions right. Once Mitosis can emit valid TypeScript in all cases, there shouldn't be any need to have another code path to directly emit JavaScript; TypeScript could be emitted always, with a flag/option to ask Mitosis to call |
fixes BuilderIO#473 fixes BuilderIO#476 fixes BuilderIO#499
fixes BuilderIO#473 fixes BuilderIO#476 fixes BuilderIO#499
@kylecordes spun out #511 for the second part. You'd be surprised at how many people still refuse to use TypeScript today 😄. I think we should allow folks to toggle whether Mitosis should output JS, TS, or both. It won't really be any additional code-path to directly emit JS: Mitosis generators will always output TS, and the JS option will be an |
Scope
Describe the bug
The webcomponent output has a ".js" file, which has TypeScript code in it. Downstream tools... are not expecting this.
To Reproduce
look at
packages/e2e-app/output/webcomponent/src/components/my-component.js
Expected behavior
Ideally: Emit TS, compile it to JS+d.ts for proper downstream consumption.
OK: Emit JS (in a .js file).
Screenshots
The text was updated successfully, but these errors were encountered: