Skip to content

fix(learn): improve the learn Asynchronous Work doc #7682

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

Merged
merged 7 commits into from
Apr 28, 2025

Conversation

kekekuli
Copy link
Contributor

Description

The 'Understanding process.nextTick()' doc have one messy example code and example ouput caused by setImmediate() vs setTimeout(). Example code in that doc saying that setImmediate will always have higher order been executed, which may confused for the readers

Validation

The example code has been reviewed to correctly reflect the behavior of the executed order for both setImmediate and setTimeout.
Reviewers should verify that the updated explanation is both technically correct and clearly communicates. No functional or visual changes—only documentation improvements.

Related Issues

#7681

Check List

  • [Yes] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [Yes] I have run npm run format to ensure the code follows the style guide.
  • [Yes] I have run npm run test to check if all tests are passing.
  • [Yes] I have run npx turbo build to check if the website builds without errors.
  • [Yes] I've covered new added functionality with unit tests if necessary.

@kekekuli kekekuli requested a review from a team as a code owner April 24, 2025 14:58
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Apr 26, 2025 2:58am

@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.83%. Comparing base (0b24039) to head (d85af46).
Report is 8 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7682      +/-   ##
==========================================
+ Coverage   74.63%   74.83%   +0.19%     
==========================================
  Files          96       98       +2     
  Lines        7689     7840     +151     
  Branches      192      197       +5     
==========================================
+ Hits         5739     5867     +128     
- Misses       1948     1971      +23     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

I don't think we should give an example, and then say "Hey, this isn't always the case"

I think we should replace the entire section with a link to where a user can find valid examples / use cases, as I said in my other comment.

@kekekuli
Copy link
Contributor Author

kekekuli commented Apr 25, 2025

I don't think we should give an example, and then say "Hey, this isn't always the case"

I think we should replace the entire section with a link to where a user can find valid examples / use cases, as I said in my other comment.

The problem is the behavior of setTimeout vs setImmediate is not the key in the section. May be we can choose one to leave, and choose one to keep.

@kekekuli
Copy link
Contributor Author

kekekuli commented Apr 25, 2025

I don't think we should give an example, and then say "Hey, this isn't always the case"
I think we should replace the entire section with a link to where a user can find valid examples / use cases, as I said in my other comment.

The problem is the behavior of setTimeout vs setImmediate is not the key in the section. May be we can choose one to left.
After that, left one link that redirect to the

I don't think we should give an example, and then say "Hey, this isn't always the case"

I think we should replace the entire section with a link to where a user can find valid examples / use cases, as I said in my other comment.

I don't think we should give an example, and then say "Hey, this isn't always the case"

I think we should replace the entire section with a link to where a user can find valid examples / use cases, as I said in my other comment.

Using the event loop documentation as an example to illustrate the behavior of nextTick()—do you think this might be too heavy?

@kekekuli kekekuli closed this Apr 25, 2025
@kekekuli kekekuli reopened this Apr 25, 2025
@avivkeller
Copy link
Member

What I'm saying is:

I think we should remove the entire example. The example isn't accurate, as you said, and we have an entire article dedicated to explaining the order of execution.

Now, if we are removing the example, it would make sense to include a link to its successor, that is, the other article.

@kekekuli
Copy link
Contributor Author

What I'm saying is:

I think we should remove the entire example. The example isn't accurate, as you said, and we have an entire article dedicated to explaining the order of execution.

Now, if we are removing the example, it would make sense to include a link to its successor, that is, the other article.

I've removed the example code and replaced it with a link. Let me know if you'd like any changes.

@avivkeller avivkeller enabled auto-merge April 28, 2025 16:29
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 97 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 96 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@avivkeller avivkeller added this pull request to the merge queue Apr 28, 2025
Merged via the queue into nodejs:main with commit e2828b8 Apr 28, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants