@ipxjs/refract 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -215,24 +215,24 @@ image requests blocked.
|
|
|
215
215
|
|
|
216
216
|
### Bundle Size Snapshot
|
|
217
217
|
|
|
218
|
-
The values below are from a local run on February
|
|
218
|
+
The values below are from a local run on February 16, 2026.
|
|
219
219
|
|
|
220
220
|
| Framework | JS bundle (raw) | JS bundle (gzip) |
|
|
221
221
|
|---------------------------|----------------:|-----------------:|
|
|
222
|
-
| Refract (`core`) | 8.
|
|
223
|
-
| Refract (`core+hooks`) |
|
|
224
|
-
| Refract (`core+context`) |
|
|
225
|
-
| Refract (`core+memo`) | 9.
|
|
226
|
-
| Refract (`core+security`) | 9.
|
|
227
|
-
| Refract (`refract`) |
|
|
222
|
+
| Refract (`core`) | 8.62 kB | 3.24 kB |
|
|
223
|
+
| Refract (`core+hooks`) | 10.28 kB | 3.85 kB |
|
|
224
|
+
| Refract (`core+context`) | 9.12 kB | 3.47 kB |
|
|
225
|
+
| Refract (`core+memo`) | 9.29 kB | 3.48 kB |
|
|
226
|
+
| Refract (`core+security`) | 9.53 kB | 3.54 kB |
|
|
227
|
+
| Refract (`refract`) | 15.20 kB | 5.55 kB |
|
|
228
228
|
| React | 189.74 kB | 59.52 kB |
|
|
229
229
|
| Preact | 14.46 kB | 5.95 kB |
|
|
230
230
|
|
|
231
231
|
Load-time metrics are machine-dependent, so the benchmark script prints a fresh
|
|
232
232
|
per-run timing table (median, p95, min/max, sd) for every framework.
|
|
233
233
|
|
|
234
|
-
From this snapshot, Refract `core` gzip JS is about 18.
|
|
235
|
-
and the full `refract` entrypoint is about
|
|
234
|
+
From this snapshot, Refract `core` gzip JS is about 18.4x smaller than React,
|
|
235
|
+
and the full `refract` entrypoint is about 10.7x smaller.
|
|
236
236
|
|
|
237
237
|
### Component Combination Benchmarks (Vitest)
|
|
238
238
|
|
|
@@ -242,16 +242,16 @@ Higher `hz` is better.
|
|
|
242
242
|
|
|
243
243
|
| Component usage profile | Mount (hz) | Mount vs base | Reconcile (hz) | Reconcile vs base |
|
|
244
244
|
|-------------------------|------------|---------------|----------------|-------------------|
|
|
245
|
-
| `base` |
|
|
246
|
-
| `memo` |
|
|
247
|
-
| `context` |
|
|
248
|
-
| `fragment` |
|
|
249
|
-
| `keyed` |
|
|
250
|
-
| `memo+context` |
|
|
251
|
-
| `memo+context+keyed` |
|
|
245
|
+
| `base` | 5341.47 | baseline | 3932.98 | baseline |
|
|
246
|
+
| `memo` | 5821.44 | +9.0% | 5202.62 | +32.3% |
|
|
247
|
+
| `context` | 3960.70 | -25.9% | 5108.06 | +29.9% |
|
|
248
|
+
| `fragment` | 4739.90 | -11.3% | 4114.70 | +4.6% |
|
|
249
|
+
| `keyed` | 6008.81 | +12.5% | 4816.85 | +22.5% |
|
|
250
|
+
| `memo+context` | 5670.29 | +6.2% | 5231.58 | +33.0% |
|
|
251
|
+
| `memo+context+keyed` | 5813.60 | +8.8% | 4606.91 | +17.1% |
|
|
252
252
|
|
|
253
|
-
In this run, `
|
|
254
|
-
`memo` was the fastest reconcile profile.
|
|
253
|
+
In this run, `keyed` was the fastest mount profile, while
|
|
254
|
+
`memo+context` was the fastest reconcile profile.
|
|
255
255
|
|
|
256
256
|
### Running the Benchmark
|
|
257
257
|
|
|
@@ -301,24 +301,27 @@ How Refract compares to React and Preact:
|
|
|
301
301
|
| **Hooks** | | | |
|
|
302
302
|
| useState | Yes | Yes | Yes |
|
|
303
303
|
| useEffect | Yes | Yes | Yes |
|
|
304
|
-
| useLayoutEffect |
|
|
304
|
+
| useLayoutEffect | Yes | Yes | Yes |
|
|
305
|
+
| useInsertionEffect | Yes | Yes | Yes |
|
|
305
306
|
| useRef | Yes | Yes | Yes |
|
|
306
307
|
| useMemo / useCallback | Yes | Yes | Yes |
|
|
307
308
|
| useReducer | Yes | Yes | Yes |
|
|
308
309
|
| useContext | Yes | Yes | Yes |
|
|
309
|
-
| useId |
|
|
310
|
-
|
|
|
310
|
+
| useId | Yes | Yes | Yes |
|
|
311
|
+
| useSyncExternalStore | Yes | Yes | Yes |
|
|
312
|
+
| useImperativeHandle | Yes | Yes | Yes |
|
|
313
|
+
| useTransition / useDeferredValue | Partial⁵ | Yes | Partial⁷ |
|
|
311
314
|
| **State & Data Flow** | | | |
|
|
312
315
|
| Built-in state management | Yes | Yes | Yes |
|
|
313
316
|
| Context API | Yes | Yes | Yes |
|
|
314
317
|
| Refs (createRef / ref prop) | Yes | Yes | Yes |
|
|
315
|
-
| forwardRef |
|
|
318
|
+
| forwardRef | Yes⁶ | Yes | Yes |
|
|
316
319
|
| **Rendering** | | | |
|
|
317
320
|
| Event handling | Yes | Yes | Yes |
|
|
318
321
|
| Style objects | Yes | Yes | Yes |
|
|
319
322
|
| className prop | Yes | Yes | Yes¹ |
|
|
320
323
|
| dangerouslySetInnerHTML | Yes | Yes | Yes |
|
|
321
|
-
| Portals |
|
|
324
|
+
| Portals | Yes | Yes | Yes |
|
|
322
325
|
| Suspense / lazy | No | Yes | Yes² |
|
|
323
326
|
| Error boundaries | Yes³ | Yes | Yes |
|
|
324
327
|
| Server-side rendering | No | Yes | Yes |
|
|
@@ -333,13 +336,16 @@ How Refract compares to React and Preact:
|
|
|
333
336
|
| memo / PureComponent | Yes | Yes | Yes |
|
|
334
337
|
| **Ecosystem** | | | |
|
|
335
338
|
| DevTools | Basic (hook API) | Yes | Yes |
|
|
336
|
-
| React compatibility layer |
|
|
337
|
-
| **Bundle Size (gzip, JS)** | ~2
|
|
339
|
+
| React compatibility layer | Yes⁶ | N/A | Yes⁷ |
|
|
340
|
+
| **Bundle Size (gzip, JS)** | ~3.2-5.6 kB⁴ | ~59.5 kB | ~6.0 kB |
|
|
338
341
|
|
|
339
342
|
¹ Preact supports both `class` and `className`.
|
|
340
343
|
² Preact has partial Suspense support via `preact/compat`.
|
|
341
344
|
³ Refract uses the `useErrorBoundary` hook rather than class-based error boundaries.
|
|
342
345
|
⁴ Refract size depends on entrypoint (`refract/core` vs `refract` full).
|
|
346
|
+
⁵ Refract exposes `useTransition` / `useDeferredValue` but currently runs both synchronously (no concurrent scheduling).
|
|
347
|
+
⁶ Available via opt-in compat entrypoints (`refract/compat/react*`).
|
|
348
|
+
⁷ Preact compatibility is provided through `preact/compat`.
|
|
343
349
|
|
|
344
350
|
## License
|
|
345
351
|
|