Skip to content

Commit

Permalink
fix(deps): bump react, react-dom and @types/react (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Moseley <[email protected]>
  • Loading branch information
dependabot[bot] and jmoseley authored Dec 16, 2024
1 parent de65f0d commit 95eaa2b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 54 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
},
"dependencies": {
"openai": "^4.76.0",
"react": "^18.2.0",
"react-dom": "^18.3.1"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@swc/cli": "^0.5.2",
"@swc/core": "^1.10.1",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.10.2",
"@types/react": "^18.2.14",
"@types/react": "^19.0.1",
"@types/react-dom": "^18.3.2",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
Expand Down
67 changes: 24 additions & 43 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions src/utils/renderWorkflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function renderWorkflow(element: React.ReactElement): Step[] {
// Generate a unique key for this workflow instance
const workflowKey = `${type.name}_${
type.displayName || ""
}_${Object.entries(el.props)
}_${Object.entries(el.props as Record<string, unknown>)
.map(
([key, value]) =>
`${key}:${value instanceof Promise ? "Promise" : (value as string)}`,
Expand All @@ -45,7 +45,9 @@ export function renderWorkflow(element: React.ReactElement): Step[] {
async execute(context) {
const resolvedProps = {} as any;
// Resolve any promise props
for (const [key, value] of Object.entries(el.props)) {
for (const [key, value] of Object.entries(
el.props as Record<string, unknown>,
)) {
resolvedProps[key] =
value instanceof Promise ? await value : value;
}
Expand Down Expand Up @@ -79,19 +81,20 @@ export function renderWorkflow(element: React.ReactElement): Step[] {
}

// Check if this is a WorkflowStep
if (el.props["data-workflow-step"]) {
steps.push(el.props.step);
const props = el.props as Record<string, any>;
if (props["data-workflow-step"]) {
steps.push(props.step);
return;
}

// Process children
if (el.props?.children) {
if (Array.isArray(el.props.children)) {
el.props.children.forEach((child: React.ReactNode) => {
if (props.children) {
if (Array.isArray(props.children)) {
props.children.forEach((child: React.ReactNode) => {
processElement(child);
});
} else {
processElement(el.props.children);
processElement(props.children);
}
}
}
Expand Down

0 comments on commit 95eaa2b

Please sign in to comment.