Skip to content

refactor!: merge ComponentEffects into ComponentEffect and improve React README#49

Merged
ivanbanov merged 3 commits into
mainfrom
react-drop-component-effects-alias
Jul 14, 2026
Merged

refactor!: merge ComponentEffects into ComponentEffect and improve React README#49
ivanbanov merged 3 commits into
mainfrom
react-drop-component-effects-alias

Conversation

@ivanbanov

Copy link
Copy Markdown
Member

Why/What

ComponentEffects<M, P> was a pure alias for ComponentEffect<M, P>[] — a second public name for the same concept, with no semantics of its own (it can't enforce the static-list rule it documented). One concept, one export. Rides along: a rewrite of the react README, which opened mid-architecture and had no complete example.

Changes

  • Breaking: remove the ComponentEffects type from @dunky.dev/react-state-machine and its @dunky.dev/native-state-machine re-export; useMachine's effects param is now ComponentEffect[], and the static-list rule lives in ComponentEffect's docblock. Changeset included (minor, per the 0.x convention); migration is mechanical: ComponentEffects<M, P>ComponentEffect<M, P>[].
  • Docs: react README rewritten — what-the-package-does list, vertical flow diagram, end-to-end tooltip quick start (config → connect → component), trimmed reference sections, and the normalize table replaced with a pointer to src/normalize.ts so it can't go stale.

Verified: typecheck clean, 261/261 react+native tests pass, lint clean.

Issues

🤖 Generated with Claude Code

ivanbanov and others added 2 commits July 14, 2026 18:09
ComponentEffects<M, P> was a pure alias for ComponentEffect<M, P>[] — a
second public name for the same concept with no semantics of its own (it
can't enforce the static-list rule it documented). One concept, one
export: the effects param is now typed ComponentEffect[], and the
static-list rule lives in ComponentEffect's docblock. Removed from the
react package and its native re-export.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The old README opened mid-architecture (the generated useXxxApi framing)
and had no complete example. Now: a short what-this-package-does list, a
vertical flow diagram, an end-to-end tooltip quick start (config ->
connect -> component), and trimmed reference sections. The normalize
mapping table is replaced with a pointer to src/normalize.ts so it can't
go stale.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dunky-state-machine Ready Ready Preview, Comment Jul 14, 2026 4:25pm

@ivanbanov ivanbanov changed the title refactor!: merge ComponentEffects into ComponentEffect refactor!: merge ComponentEffects into ComponentEffect and improve React README Jul 14, 2026
- website/react.mdx: fix invalid string-shorthand transitions (the engine
  takes { target } objects, not strings — a bare string silently no-ops),
  author the config via setup.infer().createMachine, drop the unused
  closeOnEscape context seed, replace the normalize table with a taste +
  link to normalize.ts so it can't go stale, strengthen the useSelector
  isEqual warning, add the ComponentEffect list rules.
- website/react-native.mdx: same normalize taste + link treatment.
- website/comparison.mdx: same string-shorthand fix.
- packages/native/README.md: the package had no README (blank npm page);
  add one mirroring the react README — re-export framing, a press-driven
  disclosure quick start, BackHandler ComponentEffect, RN normalize +
  mergeProps reference.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ivanbanov ivanbanov merged commit 521440e into main Jul 14, 2026
8 checks passed
@ivanbanov ivanbanov deleted the react-drop-component-effects-alias branch July 14, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant