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

refactor: migrate addon to TypeScript #447

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

dannycalleri
Copy link
Collaborator

@dannycalleri dannycalleri commented Oct 5, 2023

This PR migrates the addon code to TypeScript.

This safely removes the {eager: false} option introduced in ea239a3 to prepare for ember-modifier@4 migration: https://github.com/ember-modifier/ember-modifier/blob/main/MIGRATIONS.md#when-is-this-a-breaking-change

Now that we're using v4, we can safely remove it since it's the default behavior. Also, ember-modifier types do not support that parameter anymore.

@dannycalleri dannycalleri added the enhancement New feature or request label Oct 6, 2023
@dannycalleri dannycalleri marked this pull request as ready for review October 6, 2023 15:36
@vscav
Copy link
Member

vscav commented Oct 9, 2023

Thanks @dannycalleri 🙏 I have one question/comment: I think we are missing the exportation of the types through the Registry. Without it, we couldn't access the type info when using the addon in a consuming app. Is it on purpose? Do you plan to do it in a separate PR?

@dannycalleri
Copy link
Collaborator Author

Thanks @dannycalleri 🙏 I have one question/comment: I think we are missing the exportation of the types through the Registry. Without it, we couldn't access the type info when using the addon in a consuming app. Is it on purpose? Do you plan to do it in a separate PR?

I thought that each dependant could add it on its own, with an example to be added on the test app PR. But I like the approach we followed here: https://github.com/qonto/ember-amount-input/blob/cff4ba9306b553ce7ac66cbb549c3a4498c0ac84/ember-amount-input/src/template-registry.ts

I added the same!

@vscav
Copy link
Member

vscav commented Oct 9, 2023

With @m-jovan, we discussed introducing some jobs to lint the addon with different TypeScript versions. This way, we can offer a reliable TypeScript compatibility information. Here is an example in ember-amount-input. What do you think about this? Do you think we should consider adding the same here?

@dannycalleri
Copy link
Collaborator Author

dannycalleri commented Oct 9, 2023

With @m-jovan, we discussed introducing some jobs to lint the addon with different TypeScript versions. This way, we can offer a reliable TypeScript compatibility information. Here is an example in ember-amount-input. What do you think about this? Do you think we should consider adding the same here?

I think it's a very good idea! 👍

Right now I see that we're specifying the working dir as working-directory: ember-amount-input (https://github.com/qonto/ember-amount-input/pull/589/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR110).

I think that it would be beneficial to lint also the test-app, so that we keep the repo aligned. What do you think?

EDIT: this eventual change for the test-app will be done in #436

@dannycalleri dannycalleri force-pushed the typescript-addon-migration branch 3 times, most recently from ff37d71 to be47159 Compare October 9, 2023 12:54
@vscav
Copy link
Member

vscav commented Oct 9, 2023

I think that it would be beneficial to lint also the test-app, so that we keep the repo aligned. What do you think?

Yes, good idea 👍 In that case we'd need to introduce the same command (lint:types) in the PR for the migration of the test-app

@dannycalleri dannycalleri force-pushed the typescript-addon-migration branch 3 times, most recently from 8c24849 to 95b681a Compare October 10, 2023 16:41
@dannycalleri dannycalleri marked this pull request as draft October 11, 2023 10:01
@dannycalleri dannycalleri force-pushed the typescript-addon-migration branch 5 times, most recently from f6ef3b5 to cce2347 Compare October 12, 2023 09:14
@dannycalleri dannycalleri marked this pull request as ready for review October 12, 2023 09:51
.github/workflows/ci.yml Outdated Show resolved Hide resolved
ember-autofocus-modifier/src/modifiers/autofocus.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
test-app/package.json Show resolved Hide resolved
test-app/package.json Outdated Show resolved Hide resolved
@dannycalleri dannycalleri force-pushed the typescript-addon-migration branch 2 times, most recently from 005b4b6 to 759be62 Compare October 12, 2023 10:50
@vscav
Copy link
Member

vscav commented Oct 18, 2023

Just thought about this: I'd suggest to update the allowJs option to an explicit false in the tsconfig, wdyt?

Copy link
Member

@vscav vscav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@dannycalleri dannycalleri merged commit 383d8f8 into master Oct 19, 2023
14 checks passed
@dannycalleri dannycalleri deleted the typescript-addon-migration branch October 19, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants