effector / effector/router

RFC: chainRoute API naming & composition (vs createVirtualRoute)

Open
#32 1 comment 0 reactions 1 assignee Claimed by @sergeysova View on GitHub
enhancement scope:core
Dominant language
TypeScript
Stars
8
Forks
2
Avg merge
13h 44m
Merged PRs (30d)
1

Description

## Context (updated for current API)
`@effector/router` already ships a public `createVirtualRoute` (`packages/core/lib/create-virtual-route.ts`), and `chainRoute` (`packages/core/lib/chain-route.ts`) still takes the chained route via `route:` and returns a `VirtualRoute`. So the naming/shape concern from atomic-router is partially overtaken, but the specific ergonomics point remains open.

## RFC
Clarify the parent/child relationship in the chaining API. Options:
- Rename `chainRoute`'s `route` to `parentRoute` to make direction explicit (preferred).
- Or introduce a `virtualRoute({ parentRoute, openOn?, condition?, onParentNavigated? })`-style API layered on `createVirtualRoute`.
- Preserve existing composition/navigation-hook behavior.

## Open questions
- How does this interact with the already-public `createVirtualRoute`?
- Migration path / deprecation for the current `chainRoute` signature.

## Traceability
Source: atomic-router/atomic-router#61 — https://github.com/atomic-router/atomic-router/issues/61

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.