What’s New in v1000
Implicit Context Management
The biggest change is that you no longer need to passctx everywhere:
Key Benefits
- Simpler API - No more
ctxparameter threading - Better DX - Code reads more naturally
- Still powerful - Custom contexts available when needed
- Familiar patterns - Similar to other signal libraries
Reatom v1000 uses implicit context by default, but you can still create custom contexts for SSR, testing, or isolation. This gives you the best of both worlds.
Migration Strategy
1
Update dependencies
Update all Reatom packages to v1000:
2
Update TypeScript types
Replace old type names with new ones throughout your codebase.
3
Remove ctx parameters
Remove
ctx from all atom callbacks and action bodies.4
Update API calls
Replace v3 methods with v1000 equivalents.
5
Test thoroughly
Run your test suite and verify behavior matches expectations.
API Changes Reference
Core Context APIs
Type Changes
Primitive Changes
Extension Changes
Step-by-Step Examples
1. Simple Atom Migration
Before (v3):2. Computed Atom Migration
Before (v3):3. Action Migration
Before (v3):4. Resource Migration
Before (v3):5. Effect Migration
Before (v3):6. React Integration Migration
Before (v3):reatomComponent is a computed-enhanced React component that automatically tracks dependencies and re-renders efficiently.Advanced: Custom Contexts
While v1000 uses implicit context by default, you can still create custom contexts for:- SSR - Isolate state per request
- Testing - Clean state between tests
- Multi-tenancy - Separate state per tenant
Clear Default Context
Create Custom Context
Testing with Custom Context
Common Migration Issues
Issue: “ctx is not defined”
Problem:Issue: “Missing async stack”
Problem: Async operations lose context because promises aren’t wrapped. Solution: Wrap all promises withwrap():
Issue: TypeScript errors after migration
Problem:Package Deduplication
After updating, deduplicate Reatom packages to avoid version conflicts: NPM:Reatom core is a singleton package with internal state. Multiple versions can cause type incompatibilities and runtime errors.
Versioning Strategy
Reatom v1000 uses epoch-based versioning:- Epoch (1000, 2000, etc.) - Major architectural changes
- Major (1001, 1002, etc.) - Breaking changes within epoch
- Minor/Patch - Standard SemVer
Migration Checklist
- Update all
@reatom/*packages to v1000+ - Deduplicate dependencies
- Replace
Ctxtypes with implicit context - Replace
AtomwithAtomLikewhere appropriate - Replace
AtomMutwithAtom - Change
atom(callback)tocomputed(callback) - Change
ctx.spy(atom)toatom() - Change
ctx.get(atom)topeek(atom) - Change
atom(ctx, value)toatom.set(value) - Change
ctx.schedule(promise)towrap(promise) - Replace
reatomAsyncwithaction().extend(withAsync()) - Replace
reatomResourcewithcomputed().extend(withAsyncData()) - Replace
reactionwitheffect - Replace extension methods with
extend()calls - Update test helpers to use
createTestCtx - Run full test suite
- Check build target is ES2017+
Getting Help
If you encounter issues during migration:- GitHub Discussions - Ask questions
- Discord - Real-time help
- Migration Examples - Reference code
Further Reading
- [History and Evolutionhttps://github.com/reatom/reatom - Why v1000 was created
- Performance Guide - Optimize your migrated app
- DevTools Guide - Debug during migration