GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: documentation of sync methods links now to async methods by iwko · Pull Request #21243 · nodejs/node

Conversation

@iwko

@iwko iwko commented Jun 10, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation of sync methods links now to async methods if it made sense

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines

Refs: #21197

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. fs Issues and PRs related to file-system APIs and the fs module. labels Jun 10, 2018
vsemozhetbyt
vsemozhetbyt reviewed Jun 10, 2018
View reviewed changes

@vsemozhetbyt vsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

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.

Thank you! There are some nits we need to fix)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/fs.md Outdated

This comment was marked as resolved.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/fs.md Outdated

This comment was marked as resolved.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott reviewed Jun 10, 2018
View reviewed changes
Comment thread doc/api/fs.md Outdated

@Trott Trott Jun 10, 2018

Copy link
Copy Markdown
Member

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 unnecessary given the immediately previous sentence.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott
Trott reviewed Jun 10, 2018
View reviewed changes
Comment thread doc/api/fs.md Outdated

@Trott Trott Jun 10, 2018

Copy link
Copy Markdown
Member

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 would greatly prefer we stick with the wording used elsewhere:

This is the synchronous version of [`fs.exists()`][].

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott
Trott previously requested changes Jun 10, 2018
View reviewed changes

@Trott Trott left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Many of these contain links we should definitely add while many others of these changes also seem to add unnecessary sentences, as they often repeat the information in the sentence that comes right before them.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Trott

Trott commented Jun 10, 2018

Copy link
Copy Markdown
Member

Hi, @iwko! Welcome, and thanks for the pull request! Documentation changes can often attract a lot of review comments. I hope you'll be patient and not be discouraged. Thanks!

iwko reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jun 10, 2018

Copy link
Copy Markdown
Contributor

cc @joyeecheung to chime in.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Jun 10, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@Trott See #21197 and #21193

Also I was confused when I got started with fs documentation as well. There are no clear indications that you should click the link to find out more information e.g. about what the arguments actually mean. Just listing arguments without any explanation following by Synchronous version of <a link> is not enough IMO, people would just think that the documentation of the async API would not be informative either if they don't get curious and actually click the link.

Maybe a better way to fix this would be instead of saying Synchronous version of <a link>, say

For detailed information, see the documentation of the asynchronous
version of this API: <a link>

But I guess the point of saying Synchronous version of is to make sure people are aware that the async version is preferred?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jun 10, 2018

Copy link
Copy Markdown
Member

For detailed information, see the documentation of the asynchronous version of this API:

@joyeecheung Something like that would make sense to me. But given what you wrote, I guess the current version of this is still an improvement. I'll remove my request for changes. This can always be iterated on going forward.

@nodejs/documentation

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott dismissed their stale review June 10, 2018 21:18

reconsidering

@iwko

iwko commented Jun 11, 2018

Copy link
Copy Markdown
Contributor Author

So, should I change my changes to For detailed information, see the documentation of the asynchronous version of this API: <a link>?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jun 11, 2018

Copy link
Copy Markdown
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/874/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Jun 11, 2018

Copy link
Copy Markdown
Member

So, should I change my changes to For detailed information, see the documentation of the asynchronous version of this API: ?

I would say yes, but let's see what other people from @nodejs/fs @nodejs/documentation think. With that style we will lose the emphasis on making the async versions the perferred APIs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jun 17, 2018

Copy link
Copy Markdown
Contributor

How should we proceed?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jun 18, 2018

Copy link
Copy Markdown
Member

I hate to do this but this is more than a week old and has attracted very little attention from @nodejs/documentation so I'm going to do the dreaded @nodejs/collaborators...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Jun 18, 2018

Copy link
Copy Markdown
Member

The text LGTM as is

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davisjam

davisjam commented Jun 19, 2018

Copy link
Copy Markdown
Contributor

@iwko Thank you for this PR! Here are some comments.

  1. I share @Trott's concerns about repetition. While it's true that "This is the synchronous version of X" doesn't necessarily indicate that X has more complete documentation, I'm not sure that presenting this in separate sentences like "This is the synchronous version of X. See X for the full API." is the right approach.

We could prefix this document with "The asynchronous version of APIs documents parameters. The synchronous version indicates only the return value and exceptional behavior.". That would only help someone who bothers to read the complete document though.

I would prefer merging the two into a single sentence as @Trott proposed: "For detailed information, see the documentation of the asynchronous version of this API: a link". I don't think we need to explicitly mention everywhere that you should use asynchronous APIs. That's more the job of guides like this one. I don't think API docs need to take as firm a stance on this, especially not on a per-API basis.

  1. fs is not the only module with synchronous and asynchronous versions. For example, the crypto module has synchronous and asynchronous versions of pbkdf2. The approach to documenting the sync vs. async versions seems inconsistent between fs and crypto. Should this PR attempt to achieve uniformity across all such modules?
iwko reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu TimothyGu mentioned this pull request Jun 23, 2018
doc: explicitly mention that the explanation of an synchronous fs API live in the docs of the async API #21197
Closed
@BeniCheni BeniCheni mentioned this pull request Jun 23, 2018
doc: explicitly mention sync APIs with doc links of the related async… #21479
Closed
3 tasks done
@joyeecheung

joyeecheung commented Jun 23, 2018

Copy link
Copy Markdown
Member

@davisjam I agree that merging the sentences would more better, but we can probably leave the crypto docs for another PR.

@iwko Can you update the PR according to the suggestions above? Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iwko

iwko commented Jun 23, 2018

Copy link
Copy Markdown
Contributor Author

@joyeecheung Sure thing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iwko

iwko commented Jun 23, 2018

Copy link
Copy Markdown
Contributor Author

@joyeecheung done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jun 23, 2018

Copy link
Copy Markdown
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/890/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TimothyGu
TimothyGu approved these changes Jun 24, 2018
View reviewed changes
joyeecheung
joyeecheung reviewed Jun 25, 2018
View reviewed changes
Comment thread doc/api/fs.md Outdated

@joyeecheung joyeecheung Jun 25, 2018

Copy link
Copy Markdown
Member

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.

@iwko I believe @davisjam and @Trott and I meant that sentence like

 This is the synchronous version of [`fs.chmod()`][].

Should be removed after sentences like

For detailed information, see the documentation of the asynchronous version of
this API: [`fs.chmod()`][].

are added to avoid duplication?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iwko iwko Jun 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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 am a little confused now. So documentation for fs.chmod() should look like this?

Synchronously changes the permissions of a file. Returns undefined. For detailed information, see the documentation of the asynchronous version of this API: [fs.chmod()][]. See also: chmod(2).
?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@joyeecheung joyeecheung Jun 25, 2018

Copy link
Copy Markdown
Member

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.

@iwko Yes, that's my understanding

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iwko iwko Jun 28, 2018

Copy link
Copy Markdown
Contributor Author

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.

@joyeecheung done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iwko

iwko commented Jun 29, 2018

Copy link
Copy Markdown
Contributor Author

I've done all changes. What do You think? @vsemozhetbyt @Trott @davisjam @joyeecheung

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung approved these changes Jun 29, 2018
View reviewed changes
@joyeecheung joyeecheung added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jun 29, 2018
@davisjam

davisjam commented Jun 29, 2018

Copy link
Copy Markdown
Contributor

@iwko I will have time to look today or tomorrow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Jun 29, 2018
View reviewed changes
vsemozhetbyt
vsemozhetbyt approved these changes Jun 30, 2018
View reviewed changes
Comment thread doc/api/fs.md Outdated

@vsemozhetbyt vsemozhetbyt Jun 30, 2018

Copy link
Copy Markdown
Contributor

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.

Is it worth to completely skip these notes? We usually do not state anything if a function returns undefined.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/fs.md Outdated

@vsemozhetbyt vsemozhetbyt Jun 30, 2018

Copy link
Copy Markdown
Contributor

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.

Nit: this one should go after the next reference, ABC-wise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

davisjam reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
davisjam
davisjam approved these changes Jun 30, 2018
View reviewed changes

@davisjam davisjam left a comment

Copy link
Copy Markdown
Contributor

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, thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iwko

iwko commented Jul 8, 2018

Copy link
Copy Markdown
Contributor Author

When this PR will be merged?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 8, 2018

Copy link
Copy Markdown
Member

When this PR will be merged?

@iwko Can you address the two nits from @vsemozhetbyt? Specifically, there's no need to indicate that undefined is returned by a function, and there's one reference that is out of alphabetical order.

Once that's done, we can run CI and probably land this promptly. (There may be an issue with the merge commit recently added to the branch. Our CI setup does not like merge commits, or at least didn't used to. But we'll deal with that when we get there.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iwko

iwko commented Jul 8, 2018

Copy link
Copy Markdown
Contributor Author

@Trott I've made changes

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jul 8, 2018

Copy link
Copy Markdown
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/905/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iwko added 7 commits July 8, 2018 21:25
@iwko @Trott
doc: documentation of sync methods links now to async methods
bc0d71c
@iwko @Trott
doc: Link fs.ftruncate and fs.symlink methods
651d11a
@iwko @Trott
doc: fs sync methods links now to async methods
1dc060a
@iwko @Trott
doc: fix max line length in fs.md
373e6fd
@iwko @Trott
doc: Remove sentences like 'This is the synchronous version of..' from
c53f7f4
fs.md
@iwko @Trott
doc: change fs.chmod() description
36a392e
@iwko @Trott
doc: remove unnecessary info about returned value in fs.chmod.
9921a76
@Trott
Trott force-pushed the fs-doc-sync-methods branch from 038be2d to 9921a76 Compare July 9, 2018 04:26
@Trott

Trott commented Jul 9, 2018

Copy link
Copy Markdown
Member

Looks like CI failed because of the merge commit. I've squashed out the merge commit.

CI: https://ci.nodejs.org/job/node-test-pull-request-lite/906/

Would probably be good for people who have approved this to look it over again and make sure they still approve. I don't expect anyone to rescind their approval but this has nonetheless gone through substantial evolution.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iwko

iwko commented Jul 9, 2018

Copy link
Copy Markdown
Contributor Author

@vsemozhetbyt @joyeecheung @davisjam @TimothyGu @jasnell

Are you still ok with those changes?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jul 9, 2018

Copy link
Copy Markdown
Contributor

Still LGTM)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Jul 9, 2018
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott pushed a commit to Trott/io.js that referenced this pull request Jul 9, 2018
@iwko @Trott
doc: improve documentation of fs sync methods
65208d0
Add links to async methods and make wording consistent.

PR-URL: nodejs#21243
Refs: nodejs#21197
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Jamie Davis <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@Trott

Trott commented Jul 9, 2018

Copy link
Copy Markdown
Member

Landed in 65208d0.

Thanks for the contribution! 🎉

vsemozhetbyt and iwko reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Jul 9, 2018
targos pushed a commit that referenced this pull request Jul 10, 2018
@iwko @targos
doc: improve documentation of fs sync methods
cd77d87
Add links to async methods and make wording consistent.

PR-URL: #21243
Refs: #21197
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Jamie Davis <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@targos targos mentioned this pull request Jul 17, 2018
v10.7.0 proposal #21851
Merged
This was referenced Jul 18, 2018
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#207
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#208
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#209
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#210
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#211
Closed
@snyk-bot snyk-bot mentioned this pull request Mar 18, 2020
[Snyk] Upgrade: gatsby, gatsby-image, gatsby-plugin-catch-links, gatsby-plugin-manifest, gatsby-plugin-no-sourcemaps, gatsby-plugin-offline, gatsby-plugin-react-helmet, gatsby-plugin-sharp, gatsby-plugin-styled-components, gatsby-remark-autolink-headers, gatsby-remark-prismjs, gatsby-source-filesystem, gatsby-transformer-remark O330oei/node#3
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@jasnell jasnell jasnell approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@Trott Trott Trott left review comments
+3 more reviewers
@TimothyGu TimothyGu TimothyGu approved these changes
@vsemozhetbyt vsemozhetbyt vsemozhetbyt approved these changes
@davisjam davisjam davisjam approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. doc Issues and PRs related to Node.js documentation. fs Issues and PRs related to file-system APIs and the fs module.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@iwko @Trott @vsemozhetbyt @joyeecheung @targos @davisjam @mcollina @jasnell @TimothyGu @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.