Skip to content

What I Learned Today

A daily learning diary — short notes on things I read, discovered, or figured out.

1 entry in 2026

LessMore
JanFebMarAprMayJunJulAugSepOctNovDecMonWedFri
TIL

React Server Components

  • Server Components render on the server and send only HTML to the client — no JS bundle
  • ใช้ "use client" directive เฉพาะเมื่อต้องการ interactivity เท่านั้น
  • สามารถ access database หรือ filesystem ได้ตรงๆ ใน component

Docker Multi-stage Builds

  • ลด image size ได้เยอะมากโดยแยก build stage กับ runtime stage
  • ใช้ FROM node:20 AS builder แล้วตามด้วย FROM node:20-slim
  • Copy เฉพาะ production artifacts จาก builder stage
reactnextjsdocker