-
Notifications
You must be signed in to change notification settings - Fork 171
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
provide core internals via import meta #491
Conversation
bd1506e
to
11c4e74
Compare
11c4e74
to
a0266d7
Compare
a0266d7
to
556a93a
Compare
At a glance I'm not very convinced this is an improvement... If anything, it makes it easier to access the core, which is not something desirable, in general. |
Why does it make it easier to access the core? Only internal JS should now be able to access the core? |
Because it's accessible to any JS module, without having to jump through the hidden symbol hoop.
That has always been the case 😅 The public API is the |
Sorry my reply was a bit misleading. Completly hiding the internals was exactly the goal. As far as I understand it and as far as I tried it, only the internal JS will be able to access Though maybe I am overlooking something? |
Hum, is that because you are not adding it to the meta object for non internal modules? |
Basically. Usually this would also be tricky when internal js imports another internal modue, since import.meta is redefined for every module, but since the internal js is compiled into a single file it is fine. |
@saghul just to be clear on the state of this. Do you still looking into it / thinking about it? Or are you waiting for me to finish the draft? Or... |
TBH I'm not sure. I appreciate the elegance of it, but I worry there is no scape hatch if I need one... I'd like to leave this in pause a little bit since it has no actual impact and come back to it when something tells us it's either the right thing to pursue or drop. |
Some time has passed and I am currently happy with the current solution. We can always come back to this PR if we find a good reason to do that. Thanks for the effort though! |
The other tjs.internal symbols could be resolved similar.