-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
What's the gist of the refactor? A sentence or two as a description would do. |
const debug = require('util').debuglog('esm'); | ||
const ArrayJoin = Function.call.bind(Array.prototype.join); | ||
const ArrayMap = Function.call.bind(Array.prototype.map); | ||
|
||
const defaultName = '\u5343\u4e07\u4e0d\u8981\u7528\u8fd9\u4e2a\u53d8\u91cf' + |
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.
what is up with the default name here?
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.
A local name has to be bound to the default export, and "do not use this variable or you will be fired" in chinese was suggested to me by @TimothyGu.
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.
A local name has to be bound to the default export, and "do not use this variable or you will be fired" in chinese was suggested to me by @TimothyGu.
Would you please add code comments about it and why it's needed. This seems kind of hacky. Are there any other possible ways to tackle this (or APIs we could introduce to better address this)?
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.
I'll add a comment. the API we can introduce is what @guybedford is already working on.
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.
It seems like we could just prefix all names with $
like the old code instead, which I would prefer rather than treating some names differently from others.
@jdalton the original esm loader was using 2 module records for any dynamic module due to a lack of |
541da29
to
285493f
Compare
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.
Don't use special variable names.
const debug = require('util').debuglog('esm'); | ||
const ArrayJoin = Function.call.bind(Array.prototype.join); | ||
const ArrayMap = Function.call.bind(Array.prototype.map); | ||
|
||
const defaultName = '\u5343\u4e07\u4e0d\u8981\u7528\u8fd9\u4e2a\u53d8\u91cf' + |
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.
It seems like we could just prefix all names with $
like the old code instead, which I would prefer rather than treating some names differently from others.
c84a41b
to
7bd1e1c
Compare
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.
LGTM
I would also like to see this upstreamed
@devsnek were you planning to merge this after sorting out the rebase approach then? There don't seem to be any conflicts though so could be worth merging already too. |
@guybedford we shouldn't land anything when our HEAD is this far behind nodejs/node~HEAD. once we're more up to date it should be safe to start landing things again. |
@devsnek didn't we have consensus to do a manual rebase? edit: also since we had consensus to upstream, would it make more sense to simply open this PR on the main repo? |
@MylesBorins oh i wasn't aware we had agreed to do that. i guess i can try to do the rebase this weekend then unless someone else is feeling more masochistic... |
rebase opened in #13 I think this could potentially just be moved to nodejs/node and picked up in a future rebase... thoughts? |
I don't quite understand why we're maintaining the upstream if we're just going to replace it |
It may indeed make merging easier if we don't upstream. |
@devsnek because people are still using it. Unless we plan to completely remove it anything we can do to keep the delta smaller will make a future merge easier imho |
This comment has been minimized.
This comment has been minimized.
7bd1e1c
to
60ec064
Compare
@ljharb I was suggesting that this specific PR could land directly on master. I've retargeting this against |
Failure on arm
Rerunning https://ci.nodejs.org/job/node-test-commit-arm-fanned/4210/ |
2fa778b
to
05ba15a
Compare
60ec064
to
cf533af
Compare
rebased against modules-lkgr |
This is a change from the ecmascript-modules fork. There is no change to behavior and we would like to upstream to reduce the delta between our repos. Refs: https://github.com/nodejs/ecmascript-modules#9 PR-URL: nodejs/node#24560 Refs: #9 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This landed upstream in 2931c50 |
This is a change from the ecmascript-modules fork. There is no change to behavior and we would like to upstream to reduce the delta between our repos. Refs: https://github.com/nodejs/ecmascript-modules#9 PR-URL: #24560 Refs: nodejs/ecmascript-modules#9 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This is a change from the ecmascript-modules fork. There is no change to behavior and we would like to upstream to reduce the delta between our repos. Refs: https://github.com/nodejs/ecmascript-modules#9 PR-URL: nodejs#24560 Refs: nodejs/ecmascript-modules#9 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This is a change from the ecmascript-modules fork. There is no change to behavior and we would like to upstream to reduce the delta between our repos. Refs: https://github.com/nodejs/ecmascript-modules#9 PR-URL: #24560 Refs: nodejs/ecmascript-modules#9 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This is a change from the ecmascript-modules fork. There is no change to behavior and we would like to upstream to reduce the delta between our repos. Refs: https://github.com/nodejs/ecmascript-modules#9 PR-URL: #24560 Refs: nodejs/ecmascript-modules#9 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Use one module wrap instead of two for the dynamic modules implementation.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes