docs: update SURFACE.md and SAVINGS_ANALYSIS.md for @tanstack/redact #3
Merged
tannerlinsleymerged 1 commit into
main fromrefs/pull/3/head·merged by tannerlinsley Showing 2 changed files with 67 additions and 41 deletions.
x
@@ -1,25 +1,27 @@
-Numbers from `scripts/size-react-real.mjs` (esbuild: bundle + minify + `NODE_ENV=production` + tree-shake + gzip). Both stacks measured identically.
+Numbers from `scripts/size.mjs` (esbuild: bundle + minify + `NODE_ENV=production` + tree-shake + gzip) for `@tanstack/redact@0.0.1`, and `scripts/size-react-real.mjs` for React 19.2.3 measured identically.
-| Entry | React 19 gzip | tanstack-react gzip | Ratio | Savings |
+| Entry | React 19 gzip | `@tanstack/redact` (full) | Ratio | Savings |
-| `react` | 3.3 KB | 2.1 KB | 64% | −1.2 KB |
-| `react/jsx-runtime` | 0.7 KB | 0.2 KB | 29% | −0.5 KB |
-| `react-dom` | 4.4 KB | 6.8 KB | 154% | +2.4 KB\* |
-| `react-dom/client` | **60.3 KB** | **7.1 KB** | **12%** | **−53.2 KB** |
-| `react-dom/server` | 61.1 KB | 4.0 KB | 7% | −57.1 KB |
-| **Client total** (react + react-dom/client + jsx-runtime) | **60.5 KB** | **8.9 KB** | **15%** | **−51.6 KB** |
+| `react` | 3.29 KB | 2.65 KB | 81% | −0.64 KB |
+| `react/jsx-runtime` | 731 B | 189 B | 26% | −542 B |
+| `react-dom` | 4.35 KB | 8.53 KB | 196% | +4.18 KB\* |
+| `react-dom/client` | **60.27 KB** | **9.07 KB** | **15%** | **−51.20 KB** |
+| `react-dom/server` | 61.11 KB | 4.59 KB | 8% | −56.52 KB |
+| **Client total** (`react` + `react-dom/client` + `react/jsx-runtime`) | **60.48 KB** | **11.18 KB** | **18%** | **−49.30 KB** |
-\* `react-dom` (the index) looks worse because React splits it into a tiny facade over `react-dom/client`; ours is one file. Real apps ship `react-dom/client`, so that row is what matters.
+\* `react-dom` (the index) looks worse because React splits it into a tiny facade over `react-dom/client`; ours ships `createPortal`, `flushSync`, `unstable_batchedUpdates`, and resource-hint stubs in one file. Real apps ship `react-dom/client`, so that row is what matters.
+The `nano` preset (every opt-in feature stubbed) brings `react-dom/client` down further to **6.75 KB gzip** — a 2.32 KB savings vs `full` and a **8.9× reduction** vs React's `react-dom/client`.