Skip to content

Commit 19ad282

Browse files
jamesrwebclaude
andauthored
feat: Add updater prop, refactor types, tighten docs and build (#372) (#573)
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

.github/workflows/claude.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
issues:
99
types: [opened, assigned]
1010
pull_request_target:
11-
types: [opened, assigned, synchronize, ready_for_review]
11+
types: [assigned]
1212
pull_request_review:
1313
types: [submitted]
1414

@@ -19,7 +19,7 @@ jobs:
1919
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
2020
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
2121
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) ||
22-
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == github.repository)
22+
(github.event_name == 'pull_request_target')
2323
runs-on: ubuntu-latest
2424
permissions:
2525
contents: write

0 commit comments

Comments
 (0)