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.
Johannes Rieken (@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.
Johannes Rieken (@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.
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.