-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
JS Learn area: async module rewrite #12930
Conversation
console.log(`result: ${result3}`); | ||
}); | ||
}); | ||
}); |
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 concerned that the first use of the arrow function is used in the last example only; if people are confused they may think the arrow function makes it asynchronous. Would it be possible to include an arrow function expression elsewhere, much earlier?
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 there a particular place where you would like to see them? There are lots of arrow functions earlier in this article, and arrow functions are explained earlier in the course and consistently used throughout. I hope that people taking this course, who haven't the disadvantage of having learned JS before arrow functions, will see them as the default, normal way to write anonymous callback functions.
Co-authored-by: Hamish Willee <[email protected]>
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 looks good to me! Great to see how it evolved and got even better from the first PR that you had filed for async.
* upstream/main: (237 commits) Fixes anchor to browser compatibility table (mdn#13549) Fix incorrect casing of getTitlebarAreaRect (mdn#13631) Typo (missing s for plural) (mdn#13609) Fix a link (mdn#13621) Reduce redirects (mdn#13618) Adapt api.Window.onappinstalled to new events structure (mdn#13615) Add an example on how to list files from a `FileSystemDirectoryHandle` (mdn#13510) Fix a llink in the async Learn module (mdn#13623) Undo incorrect fix to justify-items syntax (mdn#13622) JS Learn: update client-side APIs, part 2 (mdn#13123) JS Learn area: async module rewrite (mdn#12930) Fix a link (mdn#13619) JS Learn: update client-side APIs, part 1 (mdn#13121) Adapt api.SharedWorker.onerror to new events structure (mdn#13599) Adapt api.OfflineAudioContext.oncomplete to new events structure (mdn#13568) Adapt MediaKeySession API to new events structure (mdn#13527) Adapt api.Document.onvisibilitychange to new events structure (mdn#13206) Change HTML table to a modern list (AudioProcessingEvent) (mdn#13606) Adapt api.Performance.onresourcetimingbufferfull to new events structure (mdn#13603) Few changes to outline. (mdn#13414) ...
This PR contains a rewrite of the JS async module. It replaces #12525: this PR contains versions of the 2 articles in that PR, plus three new articles that should complete the module.
I'm marking this draft because it should be merged along with the corresponding update to the learning-area repo over in mdn/learning-area#453, and changes in either PR might mean we need changes in the other one. So let's not merge this until mdn/learning-area#453 is approved (and vice versa).
But it should be ready for review.
Before this PR, the module contained the following articles:
For the reasons given in #12525, I thought I'd try rewriting this module and streamlining it. In this PR we have 5 articles:
I'm hoping that this will be more digestible than what was there before and hope that I haven't jettisoned too much stuff.
Note that the links to example code won't work until mdn/learning-area#453 is merged, but you could see them at the
wbamberg
equivalent, such as https://wbamberg.github.io/learning-area/javascript/asynchronous/sequencing-animations/finished.