ember-cli-babel
                                
                                 ember-cli-babel copied to clipboard
                                
                                    ember-cli-babel copied to clipboard
                            
                            
                            
                        auto-strip typescript
Should we simply auto-strip typescript by default? This would mitigate the need for typescript'd code to be prebuilt built.
cc @rwjblue / @chriskrycho
Huh, interesting thought. So then the work of ember-cli-typescript and similar would just be providing the build/publish hooks to let people generate their type definitions (as desired) and injecting build failures if they so desired. 🤔 cc. @dfreeman @dwickern @mike-north
What do you mean RE: auto-stripping? Remove from the build without compiling from .ts -> .js? How would that actually work?
No, just doing the "compile" step for TS as Babel understands it – just stripping the types.
@rwjblue Babel/swc support a non/type checking ts -> JavaScript transform, this transform being enabled is what I meant by auto-stripping
This is effectively what ember-cli-typescript@2 is already doing today (though granted you have to opt into it by adding e-c-ts as a dependency).
The prepublish build step we have there is for generating declaration files in a location discoverable by tsc, since the actual sources in addon/**/*.ts won't have the addon/ segment in their ultimate import path.
@dfreeman ya, I wonder though if we should consider pushing it down the stack to reduce maintenance/keep stuff in sync, enable this by default. That may allow e-c-ts to focus on the typechecking side of things
It's an interesting idea. Today adding the plugin is pretty trivial for us to do, but in the future (e.g. if we start getting things like swc in the mix) I can definitely see the appeal of not having to manage the transpilation setup ourselves in ember-cli-typescript.
On the other hand, there's a maintenance/sync problem on the TypeScript language side as well. @babel/plugin-transform-typescript isn't the only thing you necessarily need to include to get full TypeScript support. Today you also have to add the class properties plugin (and potentially decorators), but the set of needed plugins for full coverage will be a moving target if TS adopts proposals before they hit stage 4 and get handled automatically by present-env. Is that something we'd want to take on handling here?
FWIW, we have made a bit of progress here. Currently, ember-cli-babel will detect if ember-cli-typescript is present (and at the right minimum version) and add the babel plugins itself.
That was added in #314.