-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Use esModuleInterop
flag, adopt star-imports
#214144
Conversation
@@ -77,11 +77,20 @@ export function connectProxyResolver( | |||
} | |||
|
|||
function createPatchedModules(params: ProxyAgentParams, resolveProxy: ReturnType<typeof createProxyResolver>) { | |||
|
|||
function proxyAssign(module: any, patch: any) { |
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.
@jrieken Any reason for not adding a setter for this proxy?
Due to this change, our Postman extension is failing in the latest Insider Release, as we need to re-assign tls.createSecureContext
for https://github.com/postmanlabs/postman-request/blob/00acf088467643fafb5b5c5bb0100f05a6ec5cca/index.js#L185
Issue reported to us: postmanlabs/postman-app-support#12923
VS Code Issue raised at #214584
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.
@jrieken Any reason for not adding a setter for this proxy?
No special reason, we don't need it and therefore didn't add it. I can investigate doing this
as we need to re-assign tls.createSecureContext for
FYI that long term, once ESM is actually happening, this won't be an option anymore. So, please be on the lookout for an alternative. Already today, the star-import wrapper that TS generates doesn't allow module modification anymore. Hence, the proxy trick.
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.
No special reason, we don't need it and therefore didn't add it. I can investigate doing this
Thanks. Please have a look at it and provide a setter so that it doesn't break existing extensions
FYI that long term, once ESM is actually happening, this won't be an option anymore. So, please be on the lookout for an alternative. Already today, the star-import wrapper that TS generates doesn't allow module modification anymore. Hence, the proxy trick.
Can you shed some more light on it?
I tried to create a minimal implementation by reassigning the module function, and it seems to work Code Sandbox
No description provided.