sbyeol3 / articles

Learn.. Run.. 🏃
34 stars 1 forks source link

[정리] RFC: React Server Components #27

Open sbyeol3 opened 2 years ago

sbyeol3 commented 2 years ago

2021.12.21 원문

요약

Motivation

Zero-Bundle-Size 컴포넌트

// NoteWithMarkdown.server.js - Server Component === zero bundle size

import marked from 'marked'; // zero bundle size
import sanitizeHtml from 'sanitize-html'; // zero bundle size

function NoteWithMarkdown({text}) {
  const html = sanitizeHtml(marked(text));
  return (/* render */);
}

Full Access to the Backend

Automatic Code Splitting

No Waterfalls

Avoiding the Abstraction Tax

Distinct Challenges, Unified Solution