https://github.com/glimmerjs/glimmer-resolver/blob/master/src/resolver.ts#L110 … seriously tho these functions in the resolver return any and it made me sad for at least 5 minutes
-
-
Replying to @chriseppstein @tomdale
mea culpa … we can return `Opaque` there I suppose
1 reply 0 retweets 0 likes -
No worries. Webpack made me sad for like 3 weeks so this was relatively minor in comparison ;) I'm not familiar with Opaque. Link?
1 reply 0 retweets 0 likes -
Replying to @chriseppstein @tomdale
Opaque is defined in @glimmer/util as https://github.com/glimmerjs/glimmer-vm/blob/7f40b03952e9bd11f517279cdfe61b4888e3ef2d/packages/%40glimmer/interfaces/lib/core.d.ts#L1 … It is generally preferred in the Glimmer projects over `any`.
1 reply 0 retweets 0 likes -
With that said, I’m not sure it would have prevented your bug. I’m guessing the resolution just didn’t match your expectations?
1 reply 0 retweets 0 likes -
Huh. It might have because it would have forced an explicit cast. But why not use a generic?
1 reply 0 retweets 0 likes -
Replying to @chriseppstein @tomdale
Yeah, it’s no generic (not yet anyway). I’m not clear on the history or future of Opaque like perhaps
@wycats or@krisselden.1 reply 0 retweets 0 likes -
Replying to @dgeb @chriseppstein and
We should use Opaque for public returns.
2 replies 0 retweets 0 likes -
I still don't understand why this isn't a generically typed Interface.
2 replies 0 retweets 0 likes -
Replying to @chriseppstein @wycats and
I agree it should be generic
https://github.com/glimmerjs/glimmer-vm/blob/more-aot/packages/%40glimmer/interfaces/lib/di.d.ts …2 replies 0 retweets 3 likes
But observe that resolve is generic on the function on our implementation. Not much better than Opaque but adds type assertion.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.