ember-cli-typescript icon indicating copy to clipboard operation
ember-cli-typescript copied to clipboard

Should `router.ts` also be supported?

Open Bouke opened this issue 7 years ago • 7 comments
trafficstars

I've changed my router.js into router.ts. However with v2.0.0 of ember-cli-typescript, generating a new route expects router.js to exist. Should router.ts also be supported?

ember generate route account/change-password
installing route
  create app\routes\account\change-password.ts
  create app\templates\account\change-password.hbs
ENOENT: no such file or directory, open '..\app\router.js'

Bouke avatar Mar 06 '18 19:03 Bouke

We'd need to update the route blueprint to check for router.ts and make changes to ember-router-generator, which uses recast to add a this.route() call. Recast itself just landed initial TS support, but I'm not sure how much effort it's going to be to actually get that up and running (or whether it's even made it into a published release yet).

One option for the short term would be to just avoid throwing an error if we don't find router.js and emit a message instead warning the user that they'll need to update router.ts by hand.

dfreeman avatar Mar 06 '18 22:03 dfreeman

One option for the short term would be to just avoid throwing an error if we don't find router.js and emit a message instead warning the user that they'll need to update router.ts by hand.

sounds like a good thing to do for now

championswimmer avatar Mar 16 '18 15:03 championswimmer

@championswimmer if we don't get somewhere in the next bit, yep; but I know @jamescdavis actually has a spike where he's gotten a good part of the way through it, so I'm waiting to hear on that (and a lot of us were at EmberConf and had travel to/from/after this week).

chriskrycho avatar Mar 16 '18 16:03 chriskrycho

Any updates on this?

raido avatar Apr 14 '20 20:04 raido

Thanks for checking! No progress at the moment (or for the last very many moments!) but hopefully relatively soon. Supporting this dovetails with a couple other things I’m hoping to tackle in the next few months!

chriskrycho avatar May 21 '20 01:05 chriskrycho

Just ran into this too

knownasilya avatar Aug 26 '20 18:08 knownasilya

Making a router.ts possible would be great. Any news?

mertenhanisch avatar Jan 04 '21 12:01 mertenhanisch

This got implemented natively via ember-cli/ember-cli#9972! Huzzah!

chriskrycho avatar Sep 28 '23 21:09 chriskrycho