-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support for gjs/gts files #648
Conversation
@Mikek2252 Hey, would you be able to review this PR? It would be great to have support for the new Template Tag components. |
@vstefanovic97 Looks mostly fine, but i believe |
@Mikek2252 they are all awaited, only thing I did was remove extraneous |
@vstefanovic97 My mistake, this looks fine to me, i'll merge this now and get a release out in the next few days |
Thank you @Mikek2252! |
this leads to errors thrown from these functions to not be converted to promise rejections though, so this needs to be done very carefully. it usually better to keep them as async functions and use |
@Turbo87 I think that is probably only a problem if you are using But if you are using Either way I don't see a difference where this can affect the current logic, but if you prefer I can add back |
@vstefanovic97 it is a problem because it breaks the assumption about Promise-returning functions. aside from that, the tl;dr removing the |
and if you don't believe me, take it from the W3C: https://www.w3.org/2001/tag/doc/promises-guide#always-return-promises 😉 |
@Turbo87 I see your point, I added back the |
async function analyzeFiles(cwd, files, options) { | ||
function analyzeFiles(cwd, files, options) { | ||
let allTranslationKeys = new Map(); | ||
|
||
for (let file of files) { | ||
let translationKeys = await analyzeFile(cwd, file, options); | ||
let translationKeys = analyzeFile(cwd, file, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there are still plenty of places where async/await was removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Turbo87 those don't actually return promises, they are sync functions.
So basically for some reason sync functions had async
keyword which I would say is also confusing
Hey, sorry to be a pain but are there any updates on this PR? |
Apologies, @Turbo87 are you happy with the updates? if so i'll get this merged and create a release |
Pinging @Turbo87 again, are we ok with the changes now? cc: @Mikek2252 |
Would love to get a release with this 💛 |
To avoid anymore delays, im going to merge and create a release for this feel free to reach out @Turbo87 if you need me to update anything |
@vstefanovic97 Thank you for the contribution, version 4.5.0 has been released now |
How this works:
.gjs/.gts
into spec compliant Javascrip/Typescript see https://rfcs.emberjs.com/id/0931-template-compiler-api/analyzeJSFile
on the transpiled JSanalyzeHbsFile
on the templates