You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove unused peer dependencies (`@stackflow/core`, `@stackflow/react`, `react`, `@types/react`) — pure Promise-based utility with no React or Stackflow imports.
Promote Future API to the default entry point and remove the legacy Stable API.
6
+
7
+
-`@stackflow/react/future` and `@stackflow/react/stable` sub-paths removed. Import from `@stackflow/react` directly.
8
+
-`stackflow()` signature changed from `{ activities, transitionDuration }` to `{ config, components }`. Use `defineConfig()` from `@stackflow/config` for activity and route definitions.
9
+
-`useActions()` removed in favor of direct `useFlow()` imports, and `useStepActions()` removed in favor of direct `useStepFlow()` imports.
10
+
-`useActiveEffect()`, `useEnterDoneEffect()`, and `useStep()` are no longer exported from the default API.
11
+
- Step actions moved from `stackflow().actions` to the separate `stackflow().stepActions` object, with renamed methods: `stepPush` -> `pushStep`, `stepReplace` -> `replaceStep`, and `stepPop` -> `popStep`.
12
+
-`stackflow()` no longer returns the `activities` field, `useFlow`, `useStepFlow`, `addActivity`, or `addPlugin`. Hooks are now direct imports and activities are defined in `@stackflow/config`.
13
+
-`stackflow().actions` no longer exposes `getStack()` or `dispatchEvent()`; it now exposes only `push`, `replace`, and `pop`.
14
+
-`__internal__` directory removed; shared utilities are inlined into the main source.
15
+
- New default exports: `useLoaderData()`, `useConfig()`, `usePrepare()`, `lazy()`, and `structuredActivityComponent()`.
16
+
- Activity params now use `declare module "@stackflow/config" { interface Register { ... } }` instead of component props inference.
The Future API (`@stackflow/react/future`) is a preview of Stackflow 2.0 that optimizes initial loading performance through better separation of concerns. Key improvements:
209
+
## API Design
194
210
195
-
-**Config-first approach**: Activities and routes defined in `@stackflow/config` using `defineConfig()`, with React components injected separately
196
-
-**Direct imports**: Hooks (`useFlow`, `useStepFlow`) and `<Link>` component imported directly without factory functions
197
-
-**Loader API**: Built-in data loading without React dependencies for better performance
198
-
-**API Pipelining**: Parallel loading of API data and React app initialization
199
-
-**Enhanced type safety**: Types inferred from config rather than component props
211
+
`@stackflow/react` uses a config-first approach for optimal loading performance:
200
212
201
-
The Future API maintains compatibility with existing code while preparing for Stackflow 2.0. Routes are now declared in the config file alongside activities, and the plugin system has been streamlined to work with the centralized configuration.
213
+
-**Config-first approach**: Activities and routes defined in `@stackflow/config` using `defineConfig()`, with React components injected separately via `stackflow()`
214
+
-**Direct imports**: Hooks (`useFlow`, `useStepFlow`) and `<Link>` component imported directly from `@stackflow/react`
215
+
-**Loader API**: Built-in data loading via `useLoaderData` without React dependencies for better performance
216
+
-**Lazy loading**: Code splitting via `lazy()` for activity components
217
+
-**Enhanced type safety**: Types inferred from config via `declare module "@stackflow/config"` register pattern
0 commit comments