-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat: add sync way of requiring and transpiling module #8808
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.
If it's passing, I say ship it - I'd also say be careful w/ this pattern, as it's very easy to cause problems w/ things like tooling (in particular b/c you've not got a discriminating parameter i.e usePromise: true
).
I'll find out pretty quickly if it's going to cause trouble 😄
I'm a little surprised that compiles:
But it's pretty late for me, so I'm not going to question it.
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.
Types LGTM ;)
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Builds on #8756 by adding an override that does not require you to handle a promise unless you pass your own function which returns a promise. This is needed for #8330.
I'm not sure I got the type info correct here, can somebody who actually knows TS tell me if this is correct? 😅 If it's hard with overrides, I'm happy to have another go with 2 different methods rather than
if (isPromise)
./cc @M4rk9696 @G-Rath
Test plan
Still green CI
(purposefully no changelog entry as it's conceptually part of the unreleased #8756)