-
Notifications
You must be signed in to change notification settings - Fork 112
fix(example): use import type for ActivityComponentType to avoid runtime errors #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
283ae06
831ea39
f6de8d2
fc0c2af
7b0e804
1d33854
6fa0ffe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ import { Callout, Link } from "nextra-theme-docs"; | |
| `stackflow.ts`에서 생성할 수 있는 `useStepFlow()` 훅을 사용해요. 해당 훅 내에 `stepPush()` 함수를 통해 다음과 같이 새 스텝을 쌓을 수 있어요. | ||
|
|
||
| ```tsx showLineNumbers filename="Article.tsx" copy /stepPush/ | ||
| import { ActivityComponentType } from "@stackflow/react"; | ||
| import type { ActivityComponentType } from "@stackflow/react"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainCorrect: switch to type-only import prevents ESM runtime errors. Using To ensure there are no remaining runtime imports of 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Any remaining non-type runtime imports (should return no matches)
rg -nP -C2 $'import\\s*\\{\\s*ActivityComponentType\\s*\\}\\s*from\\s*[\'"]@stackflow/react[\'"]'
# 2) For reference, show the updated type-only imports
rg -nP -C1 $'import\\s+type\\s*\\{\\s*ActivityComponentType\\s*\\}\\s*from\\s*[\'"]@stackflow/react[\'"]'Length of output: 115 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Repo root: $(pwd)"
echo "Git branch: $(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'no-git')"
echo
echo "Looking for the file path (case-sensitive):"
rg -n --hidden -S 'navigating-step.ko.mdx' || true
echo
echo "If present, print first 200 lines of docs/pages/docs/get-started/navigating-step.ko.mdx:"
if [ -f docs/pages/docs/get-started/navigating-step.ko.mdx ]; then
sed -n '1,200p' docs/pages/docs/get-started/navigating-step.ko.mdx || true
else
echo "File not found at docs/pages/docs/get-started/navigating-step.ko.mdx"
fi
echo
echo "Search for any mention of ActivityComponentType in the repo:"
rg -n --hidden -S 'ActivityComponentType' || true
echo
echo "Search for any runtime imports from @stackflow/react that include ActivityComponentType:"
rg -nP -S $'import\\s*\\{\\s*ActivityComponentType\\s*\\}\\s*from\\s*[\'"]@stackflow/react[\'"]' || true
echo
echo "Search for any type-only imports from @stackflow/react that include ActivityComponentType:"
rg -nP -S $'import\\s+type\\s*\\{\\s*ActivityComponentType\\s*\\}\\s*from\\s*[\'"]@stackflow/react[\'"]' || true
echo
echo "Also show any imports from @stackflow/react (for broader context):"
rg -n --hidden -S "@stackflow/react" -g '!*node_modules/*' || trueLength of output: 53434 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for non-type imports that include ActivityComponentType from @stackflow/react or @stackflow/react/future..."
rg -nP --hidden -S "import\s*\{[^}]*ActivityComponentType[^}]*\}\s*from\s*['\"]@stackflow/react(?:/future)?['\"]" -g '!*node_modules/*' || true \
| rg -v "import\s+type" || trueLength of output: 892 Fix required: convert remaining runtime imports of ActivityComponentType to type-only The type-only import change is correct, but I found remaining runtime imports that include ActivityComponentType alongside value exports — these should be split into a type-only import + a runtime import. Files to update:
Suggested fixes (examples): Replace: Replace: 🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @umsungjun Would you apply changes to these files too? PS. I guess it's okay to ignore other comments from coderabbit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ENvironmentSet
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot find
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ENvironmentSet Sorry for the confusion, I misunderstood earlier. As you pointed out, I’ve updated and committed the changes to both Thanks for pointing it out! |
||
| import { AppScreen } from "@stackflow/plugin-basic-ui"; | ||
| import { useStepFlow } from "./stackflow"; | ||
|
|
||
|
|
@@ -59,7 +59,7 @@ export default Article; | |
| `useStepFlow()`의 `stepReplace()` 함수를 활용하면 현재 스텝을 교체할 수 있어요. | ||
|
|
||
| ```tsx showLineNumbers filename="Article.tsx" copy /stepReplace/ | ||
| import { ActivityComponentType } from "@stackflow/react"; | ||
| import type { ActivityComponentType } from "@stackflow/react"; | ||
| import { AppScreen } from "@stackflow/plugin-basic-ui"; | ||
| import { useStepFlow } from "./stackflow"; | ||
|
|
||
|
|
@@ -95,7 +95,7 @@ export default Article; | |
| `useStepFlow()`의 `stepPop()` 함수를 활용하면 현재 스텝을 삭제할 수 있어요. | ||
|
|
||
| ```tsx showLineNumbers filename="Article.tsx" copy /stepPop/ | ||
| import { ActivityComponentType } from "@stackflow/react"; | ||
| import type { ActivityComponentType } from "@stackflow/react"; | ||
| import { AppScreen } from "@stackflow/plugin-basic-ui"; | ||
| import { useStepFlow } from "./stackflow"; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.