add importable exports to cloudflare module#5516
Conversation
|
The generated output of |
3034db4 to
10de35a
Compare
This comment has been minimized.
This comment has been minimized.
|
Hi @anonrig, I love this concept, and ctx.exports is pretty cool, however is this method of consuming it potentially going to get confused by build tools/etc if they are also using https://www.npmjs.com/package/cloudflare? Perhaps Nevermind, looking at the code I see that the actual import would be from |
|
Can you expand on the use case a bit in the PR description to provide some context for what/why this is needed. |
|
It's exactly the same as the use case for importable |
10de35a to
11dd8cd
Compare
11dd8cd to
16fc75f
Compare
0e61fd0 to
c712723
Compare
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
| impl->ctxExports = lock.v8Ref(ctxExports.As<v8::Value>()); | ||
|
|
||
| if (!FeatureFlags::get(js).getDisableImportableEnv()) { | ||
| v8::Local<v8::Object> exportsObj = ns; |
There was a problem hiding this comment.
This is supposed to link up to ctxExports, not to ns.
Adds ability to do the following: