Newslurp

<< Stories

You should use SQLite ⚑️, React infinite queries ♾️, attracting great talent πŸ…

TLDR Web Dev <dan@tldrnewsletter.com>

September 18, 11:10 am

TLDR WebDev
Notion implemented WebAssembly (WASM) SQLite in its web app. This resulted in a 20% reduction in page navigation latency. 

TLDR

 TLDR Web Dev 2024-09-18

πŸ§‘β€πŸ’»

Articles & Tutorials

Yes, you should use SQLite: Notion's creative SQLite usage for 20% faster loads (6 minute read)

Notion implemented WebAssembly (WASM) SQLite in its web app. This resulted in a 20% reduction in page navigation latency. To achieve this, its team used Web Workers to offload database operations to background threads and a SharedWorker with the Web Locks API to fix data integrity issues. They also addressed issues of slow disk reads by implementing a "race" between disk cache and network requests.
How Infinite Queries work (5 minute read)

Infinite queries in React Query, often used in paginated lists or infinite scrolls, allow for continuous data fetching. A bug found in this feature caused queries to restart from the beginning if a page fetch fails during a retry. This article explains how infinite queries work in order to explain how the bug happened, along with the fix, which involves modifying the infinite query behavior to retain the state of the loop, preventing it from restarting from the beginning during retries.
🧠

Opinions & Advice

A different way to think about TypeScript (13 minute read)

This post proposes a new way to understand TypeScript's type system. It suggests thinking of types as sets of possible values they can construct. This means a string type represents the infinite set of all possible character permutations, and a number type represents the infinite set of all possible digit permutations. TypeScript's features like intersection, union, and type introspection can be understood as operations on these sets.
Correlation Does Not Imply Causation (4 minute read)

Simply because two variables move together doesn't mean one directly influences the other. For example, ice cream sales and sunburn rates correlate, but the actual cause is a third variable: temperature. The same applies when making decisions in engineering teams: charts can be helpful, but they shouldn't be taken as the sole representation of reality, as the real world is far more complex.
Being an engineering manager at Amazon (6 minute read)

This engineering manager learned three things from his time at Amazon: solve problems through mechanisms, communicate with precision, and give teams full autonomy. He misses the deep technical talks at Amazon but doesn't miss the inconsistent management culture before Andy Jassy's leadership changes.
πŸš€

Launches & Tools

Arcjet: Native security for Bun, Next.js, Node.js, SvelteKit, Vercel, Netlify, Fly.io and other modern platforms (Sponsor)

Arcjet helps developers protect their apps in code (no agent required). Implement bot protection, rate limiting, email validation, PII detection, and defense against common attacks; test everything locally so you don't break prod. Start free.
Yazi (GitHub Repo)

Yazi is a terminal file manager written in Rust, based on non-blocking async I/O. It offers features including built-in image support, code highlighting, a plugin system, and integration with popular command-line tools.
Eslint-plugin-depend (GitHub Repo)

An ESLint plugin for suggesting optimizations in choice of dependencies, native equivalents, and more. It detects dependency tree bloat and redundant polyfills.
🎁

Miscellaneous

The First Rule of Machine Learning: Start without Machine Learning (8 minute read)

The first rule of machine learning is to start without it. It's best to initially tackle problems using simpler methods like heuristics and rules. This approach provides a baseline understanding of the data and problem and can even outperform machine learning models in certain cases.
What can we do at our company to attract great talent? (Reddit Thread)

Startups can differentiate themselves to attract top engineering talent by offering remote work, better work environments, better pay, and good work-life balance. They also can reach out to potential candidates on LinkedIn and have an engineering blog.
The Pragmatic Engineer: Three Years (17 minute read)

The Pragmatic Engineer newsletter, started by ex-Uber engineer/manager Gergely Orosz, is now three years old. Looking ahead, Orosz will continue his deep dives into interesting tech companies and technologies. The Pragmatic Engineer podcast will also launch next week, featuring interviews with experienced engineers and tech professionals.
⚑

Quick Links

Warning: macOS Sequoia 15 may bypass DNS encryption (3 minute read)

A bug in macOS Sequoia 15 causes some DNS requests to bypass DNS encryption, potentially exposing users' browsing activity to monitoring.
Cleaner JavaScript promises with safe-await (3 minute read)

The "safe-await" package handles a more explicit and structured approach to handling async operations compared to nested try/catch blocks.
Why don't more people use Linux? (3 minute read)

Despite its benefits, Linux's demanding nature prevents widespread adoption, similar to how people choose easy options over healthier choices.
You can't override !important user agent CSS declarations (2 minute read)

!important is often used to override specific CSS styles, but it may not always work in practice because the style is coming from user agent style sheets, which have higher priority than author agent style sheets.

Love TLDR? Tell your friends and get rewards!

Share your referral link below with friends to get free TLDR swag!
Track your referrals here.

Want to advertise in TLDR? πŸ“°

If your company is interested in reaching an audience of web developers and engineering decision makers, you may want to advertise with us.

If you have any comments or feedback, just respond to this email!

Thanks for reading,
Priyam Mohanty, Jenny Xu & Ceora Ford


If you don't want to receive future editions of TLDR Web Dev, please unsubscribe from TLDR Web Dev or manage all of your TLDR newsletter subscriptions.