-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
apps/site/pages/en/learn/asynchronous-work/understanding-processnexttick.md
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7682 +/- ##
==========================================
+ Coverage 74.63% 74.80% +0.16%
==========================================
Files 96 98 +2
Lines 7689 7842 +153
Branches 192 197 +5
==========================================
+ Hits 5739 5866 +127
- Misses 1948 1974 +26
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 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. |
Using the event loop documentation as an example to illustrate the behavior of nextTick()—do you think this might be too heavy? |
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. |
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
npm run format
to ensure the code follows the style guide.npm run test
to check if all tests are passing.npx turbo build
to check if the website builds without errors.