FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: clarify examples section in REPL doc by dario-piotrowicz · Pull Request #57762 · nodejs/node · GitHub

/ node Public

doc: clarify examples section in REPL doc - #57762

Merged
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
dario-piotrowicz:dario/doc/repl-examples-format
Apr 8, 2025
Merged

doc: clarify examples section in REPL doc#57762
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
dario-piotrowicz:dario/doc/repl-examples-format

Conversation

dario-piotrowicz commented Apr 5, 2025
edited
Loading

Copy link
Copy Markdown
Member

This is pretty minor, but I just figured a little bit of polishing wouldn't hurt 🙂

The current examples presented at the bottom of the REPL doc have three issues which I am trying to address here:

  • they look like they're part of the section above (on how to run multiple REPL instances in the same process) but they are not

    see the table of contents at the top of the REPL page:

    before after
    (the examples are under the multiple REPL section) (the examples are listed on their own)
  • they link to old gists with code that uses outdates JS syntax (e.g var) and deprecated utilities (e.g. new Buffer)
    (so not something really ideal to present as an official example)

  • the alert informing readers not to use the second example in production environments can be wrongly interpreted as to refer to both examples

    (this might be just me, but when I read the text there it really looked to me like the warning was referring to both examples and that This example was likely a typo and that These examples was supposed to be used)

    before after
    the warning is ananbiguously in the section specific for the example

nodejs-github-bot added doc Issues and PRs related to the documentations. repl Issues and PRs related to the REPL subsystem. labels Apr 5, 2025
dario-piotrowicz force-pushed the dario/doc/repl-examples-format branch from bb2fea9 to 1edd98a Compare April 5, 2025 18:33
Comment thread doc/api/repl.md Outdated
Comment thread doc/api/repl.md Outdated
Comment thread doc/api/repl.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wonder if it still makes sense to link to an external gist, maybe we should copy the code over (not sure how it's licensed though it seems short enough to not fall under copyrightable code).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I totally agree, an external gist to a personal github user feels off to me 😕

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMO, We should create our own example derived from the sample and still link over to the gist for credit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can definitely do that 🙂👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

done 🙂 0c1abbe

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah yeah, one last question! 🙂

Do you think that the multi REPL section should also be moved under the new examples section? 🙂

dario-piotrowicz and others added 3 commits April 6, 2025 20:10
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues
Capitalize list items

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
dario-piotrowicz force-pushed the dario/doc/repl-examples-format branch from 29b0720 to 0c1abbe Compare April 6, 2025 20:25
Comment thread doc/api/repl.md Outdated
Comment thread doc/api/repl.md Outdated
Comment thread doc/api/repl.md Outdated
Comment thread doc/api/repl.md Outdated
Comment on lines +1095 to +1100
// Hack to thread stdin and stdout
// simultaneously in curl's single thread
const iv = setInterval(() => {
res.write(buf0);
}, 100);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this still needed? I can't see what difference it makes

dario-piotrowicz Apr 6, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No I just tried the example without it (I'm on Ubuntu) and it does not seem necessary

I wasn't actually fully sure why this was needed and feared that removing might break the example under some conditions / on some platform? 🤷

However do think that quite likely this is not needed, so I'm totally happy removing it, we can always re-add it if in some cases it is right? 🙂

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Removed 🙂 a977fbe

(PS: thanks so much for the suggestion 🫶)

dario-piotrowicz and others added 2 commits April 7, 2025 00:45
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Apr 8, 2025
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 8, 2025
nodejs-github-bot merged commit b396991 into nodejs:main Apr 8, 2025

Copy link
Copy Markdown
Collaborator

Landed in b396991

dario-piotrowicz deleted the dario/doc/repl-examples-format branch April 8, 2025 23:01
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
The current examples presented at the bottom
of the REPL doc have two issues:
 - they look like they're part of the section
   above (on how to run multiple REPL instances
   in the same process) but they are not
 - the alert informing readers not to use the
   second example in production environments
   can be wrongly interpreted as to refer to
   both examples
The changes here address both these issues

PR-URL: #57762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
ghost mentioned this pull request Jun 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL