Commit 19ad282
Adds an `updater` prop to P5Canvas that lets users bridge React state
updates from within the p5 lifecycle without leaking React concerns
into sketch logic.
Type system refactor:
- Introduce P5CanvasInternalProps to cleanly separate component
props from user sketch props
- Use destructuring instead of withoutKeys for prop separation
- Remove React.lazy for P5CanvasWithSketch (direct import preserves
generic type flow)
- Remove generics from internal components (only needed at the
public API surface)
- Delete InputProps, P5CanvasPropsWithSketch, WithChildren, and
withoutKeys as they are no longer needed
- Remove boxed primitive instanceof checks from logErrorBoundaryError
Docs:
- Merge duplicate TypeScript examples into single examples with notes
- Collapse advanced topics into details blocks
- Remove buggy falsy guards from updateWithProps examples
- Fix error UI example to use unknown instead of any
- Fix example sketches link to use main branch
Build:
- Remove dead esbuild config, Vite 8 uses OXC by default
- Split p5 into its own chunk in the demo build via manualChunks
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2d5249d commit 19ad282
19 files changed
Lines changed: 349 additions & 428 deletions
File tree
- .github/workflows
- config/vite
- src
- components
- contracts
- utils
- tests
- components
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments