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

Fix types (#266) #267

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Fix types (#266) #267

merged 1 commit into from
Mar 6, 2024

Conversation

chancancode
Copy link
Contributor

@chancancode chancancode commented Mar 6, 2024

With a small change we should be able to make the types we already have apply to the ./helpers/svg-jar module.

Not addressed here:

  • The types claim the helper to be a class-based helper
  • Do we want people to be importing from ./helpers/svg-jar or do we want a re-export
  • Do we want to restrict what can be imported via package.json's exports field

...etc

Basically keeping things working as it is

Fixes #266

With a small change we should be able to make the types we already
have apply to the `./helpers/svg-jar` module.

Not addressed here:

- The types claim the helper to be a class-based helper
- Do we want people to be importing from `./helpers/svg-jar` or do
  we want a re-export
- Do we want to restrict what can be imported via package.json's
  `exports` field

...etc

Basically keeping things working as it is
@evoactivity
Copy link
Owner

evoactivity commented Mar 6, 2024

Wouldn't this change address this

The types claim the helper to be a class-based helper

since it's now importing the default export of the JS as a type?

edit: I didn't notice you renamed the file 😅

Do we want people to be importing from ./helpers/svg-jar or do we want a re-export

A re-export would be nicer

Do we want to restrict what can be imported via package.json's exports field

Adding an exports field would probably help us pass https://arethetypeswrong.github.io/?p=ember-svg-jar%402.4.8 so I'm in favour of that

@evoactivity evoactivity merged commit b37b976 into evoactivity:master Mar 6, 2024
14 of 15 checks passed
@chancancode
Copy link
Contributor Author

What I meant is that it's that it claims to be a Ember.Helper when it is a Ember.helper; small difference, but for example the type currently claims that you can subclass the default export when you absolutely cannot do that.

The proper thing to do is probably have an optional peer dependency on @glint/template and use HelperLike and whatnot, but probably easier to just make it a plain function in the next major.

A re-export would be nicer

Yeah that would be my preference too

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 this pull request may close these issues.

Type not found in strict mode
2 participants