-
Notifications
You must be signed in to change notification settings - Fork 53
fix: expose correct types #98
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: expose correct types #98
Conversation
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.
I assume you mean "treated", not "threaten" (that has a very, very different meaning), but I don't think this is what we want to do; if anything, the runtime behavior should change in the next major.
If users are using shadow DOM then they really should be explicitly stating the mode. I think it's better if our types lie here a bit as it forces users onto better, more explicit patterns.
Yep treated was what I meant, anyways to force users to pass the mode isn't bad at all but this should have been done via a breaking change IMHO. |
Unfortunately we don't control the TS team's roadmap, this causing a breakage was out of our control. The intention has always been pretty clear though, even if at runtime this is massaged over. |
I'm pretty sure the types were written prior to this; we didn't make any breaking change ourselves, to my knowledge. If anything, it was a bug/lack of a feature in TS that allowed you to get away without specifying in the past which we'd generally call acceptable. |
What about users which used |
Oh you're saying Let me take another look, but it'll be a few hours. |
OK, I’ll take the blame for this misunderstanding — it seems the language barrier is bigger than I had feared. If you ever find yourself in Austria, I’m definitely inviting you for a few beers! 🍻 😆 |
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.
You're absolutely right and I screwed up, sorry!
I obviously misunderstood what version you were referring to (I assumed it was TS and a change in how they handle types), but also when I was investigating, I saw #85 and mistakenly opened up the commits list rather than viewing the files overall... the PR author originally added a .d.ts
file before switching it over to JSDoc, and I incorrectly interpretted that as us always having a .d.ts
file.
Sorry for the mix-up and I appreciate you bearing with me 😅
Since
mode
prop is definitely treated as an optional:this behaviour should be reflected in the typedef as well since v4.4.0 is breaking for TypeScript users.