Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
doc: add node protocol to ESM and CommonJS api examples#38620
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
doc: add node protocol to ESM and CommonJS api examples #38620
Uh oh!
There was an error while loading. Please reload this page.
Conversation
jeromecovington commented May 10, 2021
I'll make sure to clean up those markdown lint issues. |
Trott left a comment
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 although depending on collaborator consensus, landing may have to wait.
Trott commented May 16, 2021
@nodejs/documentation |
DerekNonGeneric left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
These all look great, thanks.
DerekNonGeneric commented May 17, 2021
Well, as @ljharb said, wait until node protocol is backported to LTS. I had not seen that comment yet. |
Trott commented May 17, 2021
Are there plans to backport |
DerekNonGeneric commented May 17, 2021
@Trott, core modules should be documented this way. I would say to give it some time for people to gain awareness. I am not aware of any other prior discussions about it though. |
DerekNonGeneric left a comment
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.
@jeromecovington, here is a second-pass review. I will have to get back to you once I have the answer to this, but perhaps @GeoffreyBooth knows what should be stated in these code blocks?
Uh oh!
There was an error while loading. Please reload this page.
doc/api/esm.md Outdated
| <!-- eslint-disable no-duplicate-imports --> | ||
| ```js | ||
| import{defaultascjs } from'cjs'; | ||
| import{defaultascjs } from'node:cjs'; |
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.
This seems wrong to me after looking at it again. There is no core module named cjs.
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.
Thanks I'll be sure to fix 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.
@DerekNonGeneric I fixed this, and a couple other instances of node:cjs.
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.
/cc @nodejs/modules if anyone knows why the code blocks here have a cjs specifier
Uh oh!
There was an error while loading. Please reload this page.
targos commented May 17, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
b2b6fa5 to 8e6349fCompareTrott commented May 19, 2021
@jeromecovington I don't know how this pull request is going to play out, but thank you for your patience and diligence on this, whatever happens! |
Trott commented May 23, 2021
@jasnell You seemed to express support for something like this in #38343 (comment). What do you think of this PR? |
Trott commented May 23, 2021
@guybedford Given #38343 (comment), I'm guessing there's nothing that can be done in this PR to address your reservation expressed there. But if I'm wrong, please do indicate what might happen to make this PR something you endorse, or at least don't have any significant reservations about. |
jasnell commented May 23, 2021
I'm in favor of the change but there's no particular rush on it |
Trott commented Dec 17, 2021
@jeromecovington Thanks for the email ping. If you're up for rebasing to address all the conflicts, this may be ready to go. @guybedford Is @aduh95 |
guybedford commented Dec 17, 2021
@Trott yes I wouldn't block this PR anymore personally. |
ljharb commented Dec 17, 2021
fwiw use of |
aduh95 commented Dec 17, 2021
@ljharb do you have examples of such reports? How is it breaking? I think we could reach out to the maintainers of the tools that don't handle those correctly to gather more feedback on this. |
ljharb commented Dec 17, 2021
@aduh95 one reason is that the |
jasnell left a comment
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'm generally +1 on this change but I think we should wait until 12.x reaches end of LTS support in April 2020. Let's mark this PR blocked until then.
aduh95 commented Mar 23, 2022
@jeromecovington With Node.js v18.0.0 around the corner and Node.js v12.x fading to EOL next month, I think we should consider landing this soon. Would you be available to rebase your branch on top of |
jeromecovington commented Mar 23, 2022
@aduh95 from what I can tell the conflicts are mostly around the addition of cjs/mjs dependency-style code blocks. I should have some time to take care of that later this week or this weekend. Thanks for the heads up. |
jeromecovington commented Mar 28, 2022
The conflicts are now so significant that I think we'll have better luck just cutting a fresh branch off of master and redoing this work, rather than working toward resolving. I can take a look at that later or if someone else has time, I'm happy to shut down this PR in favor of a more up to date approach. |
aduh95 commented Mar 28, 2022
FWIW you don't have to create a new PR to start fresh. You can run the following command when on this PR branch: git fetch https://github.com/nodejs/node.git master git reset FETCH_HEAD --hard # now your local git repo is in a fresh state# and when you're done: git commit git push --force-with-leaseThat being said, if creating a new PR is more convenient for you, you can certainly do that – whatever you do, I'm grateful for the work you're putting to improve Node.js docs :) |
GeoffreyBooth commented Mar 28, 2022
We should add this to the contributors’ guide. |
This PR addresses #38343. As far as I can tell that issue may have only been concerned with updating the
node:protocol for ESM examples, but I think it makes sense to update for CommonJS examples as well, as it seems to me that it also works for that. I'm not sure if there are other areas of the docs other than the api examples that need this change, that's all I've looked at so far.