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

Further type improvements for or helper #200

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

wagenet
Copy link
Contributor

@wagenet wagenet commented Sep 11, 2023

  • Improves the or helper types to correctly handle removing falsy types.
  • Corrects TruthConvert types to better handle non-literal types (e.g. number vs 1).

@wagenet wagenet changed the title Improve or types Further type improvements Sep 11, 2023
@SergeAstapov SergeAstapov changed the title Further type improvements Further type improvements for or helper Sep 11, 2023
@SergeAstapov SergeAstapov merged commit e3d26c2 into jmurphyau:master Sep 11, 2023
12 checks passed
@wagenet wagenet deleted the improve-or branch September 11, 2023 19:08
@SergeAstapov
Copy link
Collaborator

SergeAstapov commented Sep 11, 2023

Published as v4.0.3, thank you @wagenet!

@boris-petrov
Copy link

Can someone explain to me why so much time is spent updating the types for or? That's only relative to Glint, correct? But hasn't everyone configured their Glint to use additionalSpecialForms for or? Why are these improvements here needed in that case at all?

@SergeAstapov
Copy link
Collaborator

But hasn't everyone configured their Glint to use additionalSpecialForms for or?

TBH I only found out this exists only after researching about how generics can be handled in Glint and had no idea that exists before, by stumbling upon this discussion typed-ember/glint#547 (comment)

We could, probably, PR docs for additionalSpecialForms with and and or helpers in Glint and then point to that from ember-truth-helpers README, however I personally not sure that's what exactly we should be doing, but indeed it's an option.

@Techn1x
Copy link
Contributor

Techn1x commented Sep 18, 2023

But hasn't everyone configured their Glint to use additionalSpecialForms for or?

had no idea this existed, I doubt many others know of it either. good to know though, and that typed-ember discussion linked above is very helpful!

@wagenet
Copy link
Contributor Author

wagenet commented Sep 29, 2023

I'm honestly not entirely sold on additionalSpecialForms in Glint. I feel a bit uncomfortable about lying about my actual types.

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

Successfully merging this pull request may close these issues.

5 participants