Problem: You want to use Node with TypeScript.
Solutions:
tsc (compile, then run js via node)
ts-node
tsx
Bun
esbuild
swc
babel-node
vite-note
My favorites? Bun or tsx.
Both are fast, low/no config, and have watch mode built in.
Situation: A web app has no end-to-end (E2E) tests.
Solution: Consider writing E2E tests in phases.
Phase 1: Smoke test - Write E2E tests that merely visit each page and assure it loads.
Phase 2: Happy path - Write E2E tests for each feature's "happy path" (the expected, common use case).
Phase 3: Unhappy path - Write E2E tests for edge cases.
Phase 1 is generally easy and provides basic confidence that the app won't blow up when simply navigated. Consider phase 2 or 3 as the team matures.
Just watched @dan_abramov’s React Conf talk.
Summary: RSC allows two computers to handle React instead of just one.
I really enjoyed his framing. Enlightening.
Talk starts at 5:14: https://t.co/NAzWDCeXu1
React tip: Group related props.
Example: If two props are optional, but both must be set if used, group them via an object. This way, the related props are grouped.
Benefits:
✅ Clearer API
✅ Shorter prop names
✅ Programmatically disallows illogical prop combinations
#react
⚛️ React tip: for most forms, you don't need useState()... or any hooks at all! You can read form data directly from the form by element name:
Object.fromEntries(new FormData(formEl));
You don't even need a form library most of the time.
CSS "content-visibility:auto" is amazing: skip rendering & painting offscreen content until needed. I got a ~1s faster render on a long HTML document on desktop, ~3s on mobile.
https://t.co/Q2X2xPVj6l
There are a bunch of custom hooks you can add to your React apps
@benmvp breaks down:
useDeepCompareEffect
useWindowScroll
useInitialMount
useIsMounted
useRafState
usePrevious
useUniqueId
useMedia
Learn about all these in this article:
https://t.co/Vz1XQ9KGsH