Skip to content

Commit 3285d37

Browse files
docs: implement PR #695 review feedback
Changeset: - Split nine-rabbits-jam.md into react-v2.md, link-v2.md, core-config-v2.md - Remove @stackflow/compat-await-push from removed packages list - Add all missing breaking changes per ENvironmentSet FEP-2130 review Docs: - Delete resolving-circular-reference.{en,ko}.mdx (useActions does not exist in v2) - Delete loader-api.{en,ko}.mdx (content already in preloading); rename preloading title to "Loader API"; update _meta files - Fix ActivityLoaderArgs import path: @stackflow/react -> @stackflow/config - Fix import type { homeActivityLoader } -> import (value used in typeof position) - Fix write-plugin: initialPushedEvent -> overrideInitialEvents (en/ko), typo fix (ko) - Fix link.{en,ko}.mdx: animate default description, remove urlPatternOptions row, ref type ForwardedRef -> RefObject - Fix navigating-activities: ActivityComponentType<ArticleParams> -> ActivityComponentType<"Article"> + Register augmentation - Fix stackflow() destructuring: remove useFlow from { Stack, useFlow } = stackflow() in installation, activity, history-sync, migration-v2 (en/ko) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5bb66e1 commit 3285d37

26 files changed

Lines changed: 95 additions & 228 deletions

.changeset/core-config-v2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@stackflow/core": major
3+
"@stackflow/config": major
4+
---
5+
6+
Major version bump for Stackflow 2.0 ecosystem alignment. No API changes in these packages.

.changeset/link-v2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@stackflow/link": major
3+
---
4+
5+
Promote Future API to default entry point — `@stackflow/link` v2
6+
7+
- `@stackflow/link/future` and `@stackflow/link/stable` sub-paths removed. Import from `@stackflow/link` directly.
8+
- `createLinkComponent()` factory removed. Use `import { Link } from "@stackflow/link"` directly.
9+
- `LinkProps.urlPatternOptions` prop removed (was available in stable Link). Configure URL patterns via `config.historySync` instead.
10+
- `Link` no longer uses `forwardRef``ref` type changed from `React.ForwardedRef<HTMLAnchorElement>` to `React.RefObject<HTMLAnchorElement>`.

.changeset/nine-rabbits-jam.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

.changeset/react-v2.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@stackflow/react": major
3+
---
4+
5+
Promote Future API to default entry point — `@stackflow/react` v2
6+
7+
**Entry point / sub-paths**
8+
- `@stackflow/react/future` and `@stackflow/react/stable` sub-paths removed. Import from `@stackflow/react` directly.
9+
10+
**`stackflow()` signature**
11+
- Input: `StackflowOptions<T extends BaseActivities>` (`{ activities, transitionDuration }`) → `StackflowInput<T, R>` (`{ config, components }`)
12+
- Output: `StackflowOutput<T>` (generic) → `StackflowOutput` — final shape: `{ Stack, actions, stepActions }`
13+
- Removed from output: `activities`, `useFlow`, `useStepFlow`, `addActivity`, `addPlugin`
14+
- Added to output: `stepActions`
15+
16+
**Hooks / Actions**
17+
- `useActions()` removed → use `useFlow()` (direct import from `@stackflow/react`)
18+
- `useStepActions()` removed → use `useStepFlow()` (direct import from `@stackflow/react`)
19+
- `useActiveEffect()`, `useEnterDoneEffect()`, `useStep()` removed
20+
- `stackflow().actions` now exposes only `push`, `replace`, `pop``getStack()` and `dispatchEvent()` removed
21+
- Step actions moved to `stackflow().stepActions`; renamed: `stepPush``pushStep`, `stepReplace``replaceStep`, `stepPop``popStep`
22+
23+
**Type generics**
24+
- `useActivityParams<{ key: string }>()``useActivityParams<"ActivityName">()` (activity name string literal; type inferred from `@stackflow/config` Register)
25+
- `ActivityComponentType<{ title: string }>``ActivityComponentType<"ActivityName">`. Previous params-object API renamed to `ActivityComponentTypeByParams`
26+
- `__internal__` directory removed; shared utilities inlined
27+
28+
**New default exports**
29+
- `useLoaderData()`, `useConfig()`, `usePrepare()`, `lazy()`, `structuredActivityComponent()` now available as direct imports

docs/pages/api-references/plugins/link.en.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ const MyComponent = () => {
4242
| ----------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
4343
| activityName | `string` | The name of the activity you want to link to. It's used to determine which route to navigate. |
4444
| activityParams | `object` | Parameters to be passed to the activity. These parameters will be used to fill the route pattern. |
45-
| animate | `boolean` (optional) | Indicates whether to animate the transition when navigating. If not provided, it defaults to no animation. |
46-
| replace | `boolean` (optional) | If true, replaces the current entry in the history stack instead of pushing a new entry. |
47-
| urlPatternOptions | `UrlPatternOptions` (optional) | Options to customize URL pattern matching and filling. |
48-
| ref | `React.ForwardedRef<HTMLAnchorElement>` (optional) | A reference to the underlying anchor element, allowing direct DOM access if needed. |
45+
| animate | `boolean` (optional) | Indicates whether to animate the transition when navigating. If not provided, the default animation is applied (same as `animate: true`). |
46+
| replace | `boolean` (optional) | If true, replaces the current entry in the history stack instead of pushing a new entry. |
47+
| ref | `React.RefObject<HTMLAnchorElement>` (optional) | A reference to the underlying anchor element, allowing direct DOM access if needed. |
4948
| onClick | `function` (optional) | Function to handle the click event on the link. You can use it to perform additional actions on link clicks. |
5049
| children | `React.ReactNode` | The content to be rendered inside the link. This is typically text or other elements the user can interact with. |
5150
</APITable>

docs/pages/api-references/plugins/link.ko.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ const MyComponent = () => {
4242
| --------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------- |
4343
| activityName | `string` | 이동할 액티비티의 이름이에요. 이 속성은 어느 경로로 이동할지를 결정하는 데 사용되어요. |
4444
| activityParams | `object` | 액티비티에 전달될 매개변수예요. 이 매개변수들은 경로 패턴을 채우는 데 사용되어요. |
45-
| animate | `boolean` (optional) | 내비게이션 시 전환 애니메이션을 사용할지를 결정해요. 제공되지 않으면 애니메이션이 없어요. |
46-
| replace | `boolean` (optional) | true일 경우, 히스토리 스택에서 현재 항목을 대체하고 새로운 항목을 추가하지 않아요. |
47-
| urlPatternOptions | `UrlPatternOptions` (optional) | URL 패턴 매칭과 채우기를 커스터마이즈할 수 있는 옵션이에요. |
48-
| ref | `React.ForwardedRef<HTMLAnchorElement>` (optional) | DOM에 직접 접근할 수 있도록 하위 앵커 요소에 대한 참조를 제공해요. |
45+
| animate | `boolean` (optional) | 내비게이션 시 전환 애니메이션을 사용할지를 결정해요. 제공되지 않으면 기본 애니메이션이 적용돼요 (`animate: true`와 동일). |
46+
| replace | `boolean` (optional) | true일 경우, 히스토리 스택에서 현재 항목을 대체하고 새로운 항목을 추가하지 않아요. |
47+
| ref | `React.RefObject<HTMLAnchorElement>` (optional) | DOM에 직접 접근할 수 있도록 하위 앵커 요소에 대한 참조를 제공해요. |
4948
| onClick | `function` (optional) | 링크의 클릭 이벤트를 처리하는 함수예요. 링크 클릭 시 추가 작업을 수행하는 데 사용해요. |
5049
| children | `React.ReactNode` | 링크 내부에 렌더링할 콘텐츠예요. 주로 사용자와 상호작용할 수 있는 텍스트나 다른 요소예요. |
5150
</APITable>

docs/pages/docs/advanced/_meta.en.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"write-plugin": "Writing Your Own Plugin",
33
"history-sync": "Synchronizing with History",
4-
"resolving-circular-reference": "Resolving Circular Reference in useFlow",
5-
"preloading": "Preloading",
6-
"loader-api": "Loader API",
4+
"preloading": "Loader API",
75
"structured-activity": "Structured Activity",
86
"code-splitting": "Code Splitting",
97
"api-pipelining": "API Pipelining"

docs/pages/docs/advanced/_meta.ko.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"write-plugin": "플러그인 작성하기",
33
"history-sync": "히스토리와 동기화하기",
4-
"resolving-circular-reference": "useFlow 순환참조 해결하기",
5-
"preloading": "프리로딩",
6-
"loader-api": "Loader API",
4+
"preloading": "Loader API",
75
"structured-activity": "구조화된 액티비티",
86
"code-splitting": "코드 스플리팅",
97
"api-pipelining": "API 파이프라이닝"

docs/pages/docs/advanced/history-sync.en.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { config } from "./stackflow.config";
4040
import MyActivity from "./MyActivity";
4141
import Article from "./Article";
4242

43-
const { Stack, useFlow } = stackflow({
43+
const { Stack } = stackflow({
4444
config,
4545
components: {
4646
MyActivity,

docs/pages/docs/advanced/history-sync.ko.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { config } from "./stackflow.config";
4040
import MyActivity from "./MyActivity";
4141
import Article from "./Article";
4242

43-
const { Stack, useFlow } = stackflow({
43+
const { Stack } = stackflow({
4444
config,
4545
components: {
4646
MyActivity,

0 commit comments

Comments
 (0)