tezvyn:

TypeScript & Web APIs

TypeScript, browser APIs, WebAssembly, PWAs

246 bites

TypeScript & Web APIs2 min read

What isolatedModules enforces and why bundlers need it

WHAT IT TESTS: Single-file transpilation constraints. OUTLINE: isolatedModules forbids features needing cross-file type info because Babel and esbuild compile each file alone; const enums, certain re-exports, and namespace tricks are flagged.

TypeScript & Web APIs84 sec read

First compilerOptions to set after tsc --init

WHAT IT TESTS: Practical tsconfig priorities. OUTLINE: Enable strict for full type safety, set target and module to match the runtime, and choose outDir/rootDir or moduleResolution; each tightens checks or aligns output.

TypeScript & Web APIs2 min read

WebRTC signaling: SDP, ICE, and the signaling server

WHAT IT TESTS: WebRTC connection setup. OUTLINE: Peers exchange SDP offer and answer describing media via an out-of-band signaling server, then trade ICE candidates to find a network path using STUN and TURN.

TypeScript & Web APIs2 min read

Dedicated vs Shared vs Service Workers compared

WHAT IT TESTS: Browser worker types and roles. OUTLINE: Dedicated worker serves one page for offloading CPU; Shared worker is one instance across same-origin contexts via ports; Service worker is a network proxy for caching and push, event-driven and killable.

TypeScript & Web APIs88 sec read

Generic merge with an intersection return type

WHAT IT TESTS: Generics and intersection types. OUTLINE: Use two type parameters T and U, return T & U, spread both objects; note later spread wins on key collisions and the type may not reflect that.

TypeScript & Web APIs84 sec read

Promise .catch() versus async/await try...catch

WHAT IT TESTS: Async error-handling models. OUTLINE: .catch() handles rejection for all preceding chain steps and reads functionally; try/catch reads synchronously and can scope errors per await, but only catches awaited rejections.

TypeScript & Web APIs84 sec read

Implementing the Singleton pattern in TypeScript

WHAT IT TESTS: Encapsulating single-instance access. OUTLINE: Private constructor blocks new, a static private instance field caches it, static getInstance lazily creates and returns the one instance.

TypeScript & Web APIs2 min read

Understanding this in TypeScript

In TypeScript, this is determined by how a function is called, not where it is defined; arrow functions capture the enclosing this lexically, and TypeScript adds optional this parameters to type-check the expected context at compile time.

Matt Pocock's Free React TypeScript Tutorial
TypeScript & Web APIs2 min read

Matt Pocock's Free React TypeScript Tutorial

Matt Pocock's free React TypeScript tutorial teaches typing for hooks, props, events via hands-on exercises. Covers ComponentProps, useRef, and reading React's type defs to debug errors. Bookmark this if your team is adopting TypeScript.

Matt Pocock Tutorial Covers Ten TypeScript Errors
TypeScript & Web APIs81 sec read

Matt Pocock Tutorial Covers Ten TypeScript Errors

Cryptic TypeScript errors waste hours. Matt Pocock's new tutorial isolates ten common messages from "Type Not Assignable" to "Property Does Not Exist" in interactive exercises. Clone the repo or use Gitpod to build debugging instincts instead of guessing.

TypeScript & Web APIs85 sec read

Chrome 136 cuts JS startup 630ms with compile hints

Chrome 136 ships Explicit Compile Hints, cutting parse and compile times by 630ms in V8 tests. The //# allFunctionsCalledOnLoad comment triggers eager background compilation for entire files, avoiding main-thread bottlenecks.

TypeScript & Web APIs2 min read

Chrome M137 Ships Speculative Deopts and Inlining for Wasm

Chrome M137 adds speculative inlining and deoptimization to V8's WebAssembly engine, cutting Dart microbenchmarks by over 50%. It targets WasmGC, making Java, Kotlin, and Dart faster using JS-style JIT assumptions. Benchmark WasmGC apps on M137 now.

TypeScript & Web APIs89 sec read

V8 doubles JSON.stringify speed with side-effect-free fast path

V8 doubled JSON.stringify speed with a side-effect-free fast path. Every network and storage serialization of plain objects gets faster with zero code changes. Check your profiles if JSON encoding shows up hot.

Mozilla WAICT Verifies Web App JavaScript in Nightly
TypeScript & Web APIs2 min read

Mozilla WAICT Verifies Web App JavaScript in Nightly

WAICT in Firefox Nightly binds client code to public manifests so browsers reject unlogged JavaScript. This stops compromised servers from silently injecting malicious code into encrypted web apps like Signal. Test it at waict.dev.

Claude Mythos Cracks Firefox Bugs Fuzzing Missed
TypeScript & Web APIs89 sec read

Claude Mythos Cracks Firefox Bugs Fuzzing Missed

Claude Mythos Preview found 20-year-old XSLT and JIT bugs in Firefox that survived years of fuzzing. Mozilla shows AI now catches sandbox escapes and memory corruption. Add LLM security scanning to hardening workflows before attackers adopt them.

Firefox 151 Ships Web Serial API for Hardware
TypeScript & Web APIs2 min read

Firefox 151 Ships Web Serial API for Hardware

Firefox 151 ships Web Serial API support, letting web apps talk directly to microcontrollers, 3D printers, and USB power meters without native installers. You can flash firmware and read sensors straight from the browser, so test your hardware workflows in…

TypeScript & Web APIs2 min read

Type a UMD library for script tags and CommonJS/ESM

Tests TypeScript UMD declarations for dual global and module usage. Use export as namespace MyLib for the global, export = MyLib for require, and declare the API inside a namespace. Red flag: default exports or declare global instead of export as namespace.

TypeScript & Web APIs2 min read

How do you write a declaration file for a JavaScript class?

WHAT IT TESTS: Ambient class declarations that model instance and static members of untyped JS. ANSWER OUTLINE: Declare a class in a .d.ts, type the constructor, add instance members, and attach statics on the class.

TypeScript & Web APIs2 min read

How does export = differ from export default in TypeScript declarations?

It tests CommonJS to ES module interop in TypeScript. export = maps to the entire module.exports object and must be imported with import = require() or ES interop, while export default creates a named binding. A red flag is claiming they are interchangeable.

TypeScript & Web APIs2 min read

Create a CustomEvent with typed detail and a type-safe listener

Tests TypeScript generics with DOM events. Strong answer: generic CustomEvent wrapper, typed detail, listener typed via generic param. Red flag: using any for detail or casting event.target instead of parameterizing the event type.