Newslurp

<< Stories

Stripe’s monorepo 💲, good vs bad refactoring 🛠️, tech lead tips ✍️

TLDR Web Dev <dan@tldrnewsletter.com>

August 20, 11:09 am

TLDR WebDev
The developer environment at Stripe has tools and infrastructure built to support a large Ruby monorepo. Code is run on cloud-based devboxes 

TLDR

 TLDR Web Dev 2024-08-20

🧑‍💻

Articles & Tutorials

Stripe's monorepo developer environment (20 minute read)

The developer environment at Stripe has tools and infrastructure built to support a large Ruby monorepo. Code is run on cloud-based devboxes instead of local machines. The company's team team invested heavily in automated code synchronization and a unified command-line tool called "pay" to manage devbox interactions. This post discusses the importance of organizational scale and codebase characteristics in shaping the design and success of the developer tooling.
An approach to optimizing TypeScript type checking performance (16 minute read)

You can optimize TypeScript's type-checking performance by first diagnosing inefficiencies using tools like --extendedDiagnostics, --generateTrace, and benchmarking libraries. You should iteratively test hypotheses by grouping related operators and refining overload order.
Parsing Protobuf at 2+GB/s: How I Learned To Love Tail Calls in C (16 minute read)

This blog post discusses a novel technique for optimizing interpreter loops and protobuf parsing using tail calls in C. The author discovered that by utilizing the `[[clang::musttail]]` attribute, they got a huge performance boost, achieving protobuf parsing speeds exceeding 2 GB/s. The key benefit of tail calls is the elimination of function call overhead, resulting in more efficient control flow and reduced stack usage.
🧠

Opinions & Advice

Good Refactoring vs Bad Refactoring (12 minute read)

Good code refactoring is incremental and preserves functionality while avoiding any new unnecessary complexity. Bad refactoring practices include drastic style changes, unnecessary abstractions, inconsistency in code patterns, refactoring without fully understanding the existing code, and ignoring the business context.
Tips from 8 months of TanStack/Router in production (5 minute read)

After using TanStack Router in production for eight months, this author believes in organizing code into vertical modules, using loaders for page-level data and suspense queries for component-specific data, and avoiding premature code generalization. He promotes a “go gardening approach” that involves abstracting code only when clear patterns show up.
Types -> Sets (8 minute read)

You can think about TypeScript's type system as a functional programming language that operates over sets of values. By imagining types as sets of all possible values they can construct, it becomes easier to reason about features like intersections, unions, and type mappings.
🚀

Launches & Tools

🇬🇧 Join Idris Elba and global blockchain developers at Meridian 2024, happening this October in London (Sponsor)

If you've got any interest at all in blockchain and web3, you belong at Meridian 2024 - the Stellar Development Foundation's annual conference. Attend fascinating keynotes and connect with the blockchain ecosystem: developers, founders, and leaders. Don't miss the special developer track and innovation showcase! Get your tickets now
Srcbook (GitHub Repo)

Srcbook allows developers to create TypeScript and JavaScript notebooks to prototype quickly. These notebooks can run code locally with a web interface, export to Markdown, and be shared easily.
Parallel DOM (GitHub Repo)

The parallel-dom npm package offloads heavy DOM operations to parallel iframes for faster rendering. It supports both plain JavaScript and React.
Pragtical (Website)

Pragtical is a lightweight, highly extensible cross-platform text editor that prioritizes performance, ease of use, and open-source principles.
🎁

Miscellaneous

ECMAScript Safe Assignment Operator Proposal (9 minute read)

This proposal introduces the ?= operator, which makes error handling easier by transforming function results into a [error, result] tuple. It also supports recursive handling of promises and objects implementing Symbol.result, making error checking streamlined across various JavaScript APIs.
LLMs Know More Than What They Say (11 minute read)

An approach called Latent Space Readout (LSR) can improve the accuracy of AI application evals. LSR uses interpretability research by projecting evaluation model activations onto meaningful linear directions, which makes it more sample efficient than fine-tuning. This means that much less human feedback is required for these evals to be more accurate.
The gigantic and unregulated power plants in the cloud (12 minute read)

There's a dangerous lack of regulation for cloud-based management platforms controlling millions of solar panels across Europe. These platforms, mostly run by companies outside of Europe, have the power to shut down vast amounts of power, potentially causing grid collapse. While individual solar panels pose little threat, their concentrated control creates a huge risk, especially due to recent hacking attempts.

Quick Links

Ask HN: How do you work as a tech lead? (Hacker News Thread)

A Hacker News commenter asks how to effectively manage a team of junior engineers, and responses cover topics such as team interaction, communication with managers, meetings, documentation, time management, and team alignment.
Client-side filtering of private data is a bad idea (6 minute read)

A security researcher found that an app leaked sensitive user data due to client-side filtering, including preferred genders, sexualities, and relationship situations, through its GraphQL API.
Sourcegraph went dark (8 minute read)

Eric Fritz, a former Sourcegraph engineer, explains how he preserved links to Sourcegraph's codebase after a repository went private by creating a fork, scraping relevant commits, and rewriting all references to his fork.
TIL: 8 versions of UUID and when to use them (4 minute read)

This blog post explains the eight versions of UUIDs, how they are generated, and when to use each version based on their strengths and weaknesses.

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.