-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
new core modules go under a namespace #21551
Conversation
86f0c41
to
bf4b588
Compare
|
be12c96
to
ff00cc8
Compare
@nodejs/npm @nodejs/security @nodejs/modules ... we really need to make sure we are coordinating on this to make sure we do not accidentally introduce any security issues with older versions of Node.js that do not understand the |
@jasnell I believe we can (and should) backport the resolver to all current LTS versions of the platform. If we consider it a security patch we can do so as a patch |
@jasnell as long as node owned the |
ff00cc8
to
4e3aa7e
Compare
While I'm +1 on the idea of putting new modules under a namespace, I don't think the PR enabling this should alias existing modules.
|
I don’t think it’s a good idea to be opportunistic here and try to pile on “improvements” on top of namespacing. |
I know not everyone will agree. That's why I think it should be a separate discussion that shouldn't block new modules to be under a namespace. |
I do not think this is the correct approach, and a full implementation will require doing this via the resolver. Every file that we add increase the startup time, and we are currently trying to reduce it. |
I agree with @mcollina ... This is something that can be done within the resolver. Adding this kind of indirection is not the right approach. |
That’s totally fine; the implementation of that is equally straightforward. @mcollina do i need to put up a new PR that contains a string to string mapping, or would we be able to defer debating the implementation details until after the underlying direction has been decided? |
We can debate on the implementation details after the @nodejs/tsc agrees with the approach. |
Update: TSC has provisionally agreed on the approach; I'll update this PR with an actually workable implementation (this was originally just a prototype) |
What's the progress on this? |
@jasnell i have to update the PR based on #21551 (comment); conferences, travel, and life have interfered for the last month or two. I'm still planning to get on it soon :-) |
@ljharb Are you able to rebase this and we can pick it up again? |
@Trott sure, i'll try to do that now. (edit: i talked to myles; he'll replace my commits with his own) |
4e3aa7e
to
6025b50
Compare
I had started working on something after seeing @Trott's ping and with @ljharb's blessing I've force pushed an alternative implementation of this that works via the resolver. I'm pretty sure that this can be improved by moving some of the logic to C++, but wanted to get some feedback before pushing much further. The majority of the implementation is in 4fdc880 48779a5 updates tests and benchmarks... so I've made it a separate commit to make it easier to review without the noise. My initial implementation was with
As the PR here had originally been made with One thing to note, the implementation currently throws if you attempt to load anything from the TL;DR of what I think we need to reach consensus on (which may require separate issues)
/cc @nodejs/tsc @nodejs/modules |
I would like to avoid, if at all possible, a situation where we migrate twice:
This leaves us in a situation where:
(Which, to me, seems like unnecessary technical and UX debt.) |
Because we cross-posted, just want to say I share @Fishrock123's concerns, he decribes the worst-case that we don't want, but it sounds like the URI-like prefixes (like |
Shipping |
I'd like to propose a different look at this: Schemes versus Namespaces That said, |
This was discussed at last TSC meeting, does it still need to be on the upcoming meeting's agenda? |
removed from the agenda. Conversations need to be had in this or another thread. |
Was there some sort of outcome from the tsc meeting? |
Do we have a feeling for how close we are on a call here? We're starting to use Unless we make another call, I assume |
|
It's an implementation detail until it stops being one. The longer we delay moving that implementation detail to the official solution, the higher the risk that we unflag with it, it does leak in some use cases, and we're stuck with it unless we break the ecosystem. |
I needed some URL mapping for policies, which are not integrated with ESM so it also exists in policies under the PR @jkrems linked. So it exists in at least 2 places currently. For policies it is meant to be publicly used. |
I recall first noticing it in electron and nwjs — in dev tools — not that I am saying it should not, just how it ends up there can be relevant to keep in mind. |
What should we do with this? Close it? Push it forward? Put it on the TSC agenda to see if it can get traction with someone else? |
I'm still planning on picking this up. The built in modules proposal is
still being worked on at tc39 and there is hope for stage advancement at
next week's meeting.
If it lands at TC39 I will likely explore and experimental implementation
of it for core
…On Thu, Nov 28, 2019, 12:05 AM Rich Trott ***@***.***> wrote:
What should we do with this? Close it? Push it forward? Put it on the TSC
agenda to see if it can get traction with someone else?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21551?email_source=notifications&email_token=AADZYVZMOMJWTB5ZB6WSMRLQV5GTHA5CNFSM4FHDCYU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFLON6A#issuecomment-559343352>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZYV5WTQTK2TWBKSY23QDQV5GTHANCNFSM4FHDCYUQ>
.
|
It’s not on the agenda for next week’s meeting and the stage advancement deadline has passed. |
I have mispoken then, didn't check agenda, was under impression it was
going to be on agenda
Apologies
…On Thu, Nov 28, 2019, 11:50 AM Jordan Harband ***@***.***> wrote:
It’s not on the agenda for next week’s meeting and the stage advancement
deadline has passed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21551?email_source=notifications&email_token=AADZYV7DT5XJ3GKQ6UK6D3DQV7ZGLA5CNFSM4FHDCYU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNDB5Y#issuecomment-559558903>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZYV2ZCLUX3T2W5JK7LG3QV7ZGLANCNFSM4FHDCYUQ>
.
|
this pr isn't about js std anyway right? |
This PR isn't, but we have discussed which semantics to use for the
namespace and similar behavior to what TC39 uses for built in modules would
be desirable IMHO
…On Thu, Nov 28, 2019, 12:51 PM Gus Caplan ***@***.***> wrote:
this pr isn't about js std anyway right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21551?email_source=notifications&email_token=AADZYV6I2KPNF3GSQMKXL7TQWAAJDA5CNFSM4FHDCYU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNGOPI#issuecomment-559572797>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZYV43LBPKTPLRN4SGDTTQWAAJDANCNFSM4FHDCYUQ>
.
|
8ae28ff
to
2935f72
Compare
This has not been updated in quite a while, has not seen further progress, is out of date. Closing but can reopen if it is picked back up again and updated |
Per nodejs/TSC#389 (comment)
Do not merge this - this is solely a demonstration of how a namespaced module could exist.
Existing core modules would be aliased, either like this, using symlinks, or in the CJS/ESM loaders.
New modules would live inside
lib/@nodejs
, just like current ones live insidelib/
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes