Skip to content
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

Addons using ember-cli-typescript@4 do not get their TypeScript transpiled #528

Closed
rwjblue opened this issue Sep 15, 2020 · 10 comments · Fixed by #529
Closed

Addons using ember-cli-typescript@4 do not get their TypeScript transpiled #528

rwjblue opened this issue Sep 15, 2020 · 10 comments · Fixed by #529

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented Sep 15, 2020

We discovered this while testing a new version of ember-a11y-testing that uses ember-cli-typescript@4. During the Embroider build the .ts files (located in addon-test-support) are not transpiled into .js in Embroider's working directory.

I'm making a tracking issue here so we can work towards a solution...

@rwjblue
Copy link
Collaborator Author

rwjblue commented Sep 15, 2020

/cc @chriskrycho @dfreeman (for visibility)

@scalvert - Can you share repro steps? Or plausibly make a small Embroider demo app that has the issue?

@scalvert
Copy link

Yep. Will push up a repro repo right now :)

@scalvert
Copy link

scalvert commented Sep 15, 2020

https://github.com/scalvert/a11y-embroider-repro/tree/broken

Running ember t on that branch will result in the error.

@chriskrycho
Copy link
Contributor

Interesting. I believe Embroider at some point had some special handling for ember-cli-typescript, which should no longer be required – I’ll start by looking there tomorrow or Thursday if @dfreeman or @jamescdavis don’t get there first.

@dfreeman
Copy link
Contributor

I'm not super familiar with the implementation details of Embroider, but at a glance this looks suspicious: https://github.com/embroider-build/embroider/blob/2842a3482119a38bed32d9fc7b8050922b46efdf/packages/compat/src/v1-addon.ts#L202:L207

Since ember-cli-typescript no longer adds any explicit plugins to the Babel config, this conditional will no longer get tripped if an addon doesn't have other plugins set up. The TS plugin (and .ts extension) are now handled within ember-cli-babel itself if ember-cli-typescript >= 4 is present or enableTypeScriptTransform is set.

@jamescdavis
Copy link
Contributor

The repro doesn't have ember-a11y-testing as a dep. 😃 After adding [email protected], I was able to repro the issue. The problem has to do with detecting when an addon (but not the host app) uses ember-cli-typescript@4 and setting up Babel. I was able to get things working for the repro by tweaking things in @embroider/compat. I'll put a PR up soon.

@jamescdavis
Copy link
Contributor

jamescdavis commented Sep 16, 2020

@dfreeman, yep that's part of it. #529 gets the repro passing, at least (I have a test package locally, but it's not building right).

@ef4
Copy link
Contributor

ef4 commented Sep 16, 2020

Thanks for testing and reporting, I reviewed #529 with commentary so we can get to the bottom of this.

@scalvert
Copy link

@jamescdavis oops I forgot to add ember-a11y-testing. Can add it and push.

@scalvert
Copy link

Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants