refactor!: merge ComponentEffects into ComponentEffect and improve React README#49
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why/What
ComponentEffects<M, P>was a pure alias forComponentEffect<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
ComponentEffectstype from@dunky.dev/react-state-machineand its@dunky.dev/native-state-machinere-export;useMachine'seffectsparam is nowComponentEffect[], and the static-list rule lives inComponentEffect's docblock. Changeset included (minor, per the 0.x convention); migration is mechanical:ComponentEffects<M, P>→ComponentEffect<M, P>[].src/normalize.tsso it can't go stale.Verified: typecheck clean, 261/261 react+native tests pass, lint clean.
Issues
—
🤖 Generated with Claude Code