Skip to main content
Reatom v1000 is an epoch release that solves the most significant pain point of v3: explicit context management. The new version operates with implicit global context like other signal libraries, while still supporting custom contexts for advanced use cases.

What’s New in v1000

Implicit Context Management

The biggest change is that you no longer need to pass ctx everywhere:

Key Benefits

  • Simpler API - No more ctx parameter 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):
After (v1000):

2. Computed Atom Migration

Before (v3):
After (v1000):

3. Action Migration

Before (v3):
After (v1000):
Use wrap() around promises to preserve Reatom context across async boundaries. This is crucial for proper context management.

4. Resource Migration

Before (v3):
After (v1000):

5. Effect Migration

Before (v3):
After (v1000):

6. React Integration Migration

Before (v3):
After (v1000):
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:
Solution:

Issue: “Missing async stack”

Problem: Async operations lose context because promises aren’t wrapped. Solution: Wrap all promises with wrap():
Ensure your build target is ES2017 or higher. Lower targets transform async/await into .then() chains, which breaks context preservation.

Issue: TypeScript errors after migration

Problem:
Solution:

Package Deduplication

After updating, deduplicate Reatom packages to avoid version conflicts: NPM:
Yarn:
PNPM:
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
The next epoch (v2000) is planned for 2026-2027.

Migration Checklist

  • Update all @reatom/* packages to v1000+
  • Deduplicate dependencies
  • Replace Ctx types with implicit context
  • Replace Atom with AtomLike where appropriate
  • Replace AtomMut with Atom
  • Change atom(callback) to computed(callback)
  • Change ctx.spy(atom) to atom()
  • Change ctx.get(atom) to peek(atom)
  • Change atom(ctx, value) to atom.set(value)
  • Change ctx.schedule(promise) to wrap(promise)
  • Replace reatomAsync with action().extend(withAsync())
  • Replace reatomResource with computed().extend(withAsyncData())
  • Replace reaction with effect
  • 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:

Further Reading

  • [History and Evolutionhttps://github.com/reatom/reatom - Why v1000 was created
  • Performance Guide - Optimize your migrated app
  • DevTools Guide - Debug during migration