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