

Hasty Treat - JavaScript Event Buzzwords — Sync, Concurrent, Defer, Blocking, Wo...
source link: https://syntax.fm/show/367/hasty-treat-javascript-event-buzzwords-sync-concurrent-defer-blocking-workers
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Jul 5th, 2021
Hasty Treat - JavaScript Event Buzzwords — Sync, Concurrent, Defer, Blocking, Workers
👇 Download Show✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes define some JavaScript Buzzwords and talk about what they mean!
Freshbooks - Sponsor
Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the "How did you hear about us?" section.
Sentry - Sponsor
If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.
Show Notes
03:24 - Synchronous / Async
05:23 - Multi-threaded
- JavaScript has a single "main thread"
- But you can have more threads with web workers
08:12 - Blocking
- JavaScript can stop other things on the page from running
- A script tag can block HTML from being parsed
- Most stuff in JavaScript is non-blocking
- Node.js write to filesystem can be blocking
10:27 - Concurrent + Parallel
- JavaScript start/stop are concurrent
- The API runs on a different thread
- Doesn't REALLY matter
- https://joearms.github.io/published/2013-04-05-concurrent-and-parallel-programming.html
13:22 - Consecutive / Waterfall
- One after another
13:48 - Callback
- A function to run when this thing happens or is done
- Click event callback
- Websocket on data callback
- Like a tweet stream
- Data fetch callback
- Almost entirely replaced with async + await
- http://callbackhell.com/
- https://caolan.github.io/async/v3/
17:56 - Script Tag Async + Defer
- Doesn't block other content
- Runs when ready - doesn't care about DOMcontentLoaded
- Wait until the page is loaded before running
- If the script tag is above content, don't wait for it
- Good for things that aren't called on page load
21:54 - Lazy
- Load it in later - maybe when it's scrolled into view, or as needed
- Not mission-critical
Tweet us your tasty treats!
Recommend
-
12
✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about all things color in CSS, both current and coming soon! Sentry - Sponsor ...
-
9
Nov 2nd, 2020Hasty Treat - Certifications? Government Specified JavaScript Skills?👇 Download Show
-
8
Oct 4th, 2021Hasty Treat - Spicy Takeout - PHP Is Good and We’re Just Re-Creating It👇 Download Show
-
12
Jun 7th, 2021Hasty Treat - Making a Vaccine Bot with JavaScript👇 Download Show✏...
-
11
✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about the hottest new tech they love! Linode - Sponsor Whether you’re working...
-
12
✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about JavaScript's drag and drop API — how it works, concerns, best practices, and more!...
-
7
May 4th, 2020Hasty Treat - Things You Should Know About Javascript Events👇 Download Show
-
6
Jun 10th, 2019Hasty Treat - Std Lib in JavaScript👇 Download Show✏️ Edit Show Notes
-
9
Oct 26th, 2020Hasty Treat - Temporal Date Objects in JavaScript👇 Download Show
-
7
Sep 28th, 2020Hasty Treat - Records and Tuples in JavaScript👇 Download Show✏️ Edit Sh...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK