-
Notifications
You must be signed in to change notification settings - Fork 196
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 files are published and not transpiled to JavaScript before #2106
Comments
For V1 addons, the addon controls it's own build behavior. I've just tested this by creating a new JS Ember project and adding ember-bootstrap to it. Adding a bs-button just works as expected. For a live demo, check out the component docs for BsButton. https://www.ember-bootstrap.com/components/button |
Yes. But we don't have a dependency on ember-cli-typescript or typescript or any other package, which may handle the transpilation. That's why I'm surprised that it's working. Even if we can delay transpilation to JS to build-time of consuming app with v1 addon, I don't think we should do so. It increases technical complexity and has a negative affect on build-time performance. |
I think it's just using
That is a valid concern. I do think that most V1 Typescript addons keep the TS in place though. Should we try to precompile the js files and remove the Typescript files from the build bundle? I really should dive back into the V2 addon stuff. For that one atleast I'm sure we should only ship compiled js (except for the types, ofcourse). |
I was surprised to see that this is not the standard. If it's not too much work, we should do it in my opinion. Maybe it's just about running |
I might get confused having only worked on v2 addons for a while, but I do think that our current setup is the "blessed" one as Sander pointed out. Compare this to e-c-ts docs and its precompile compile command (run as part of v2 addons do the compilation upfront, as they have to. But I don't think it's worth our time to try to do this as a v1 addon. Also not sure if there is really much benefit, because our v1 addon's code still has to go through ember-cli-babel, with or without TS, and stripping the types away shouldn't be much additional work I think? |
I noticed that we are publishing the TypeScript files. They are not transpiled to JavaScript before publishing. See
addon/components/bs-button.ts
as an example. I think that's not what we intended and may break consumers not using TypeScript.The text was updated successfully, but these errors were encountered: