Skip to content

Commit

Permalink
Fix #401: Error with subgraphs due to accidentally proxying undefined…
Browse files Browse the repository at this point in the history
… values

Update deps to fix build
  • Loading branch information
newcat committed Mar 20, 2024
1 parent dafc905 commit b928560
Show file tree
Hide file tree
Showing 11 changed files with 306 additions and 117 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"packages/*"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.23.0",
Expand All @@ -27,7 +27,7 @@
"prettier-eslint": "^16.3.0",
"rimraf": "^5.0.5",
"typedoc": "^0.25.12",
"typescript": "^5.4.2",
"typescript": "^5.4.3",
"vitepress": "^1.0.0-rc.45",
"vue-eslint-parser": "^9.4.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typedoc": "^0.25.12",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"publishConfig": {
"access": "public"
Expand Down
22 changes: 21 additions & 1 deletion packages/core/src/graphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ export function getGraphNodeTypeString(template: GraphTemplate): string {
return GRAPH_NODE_TYPE_PREFIX + template.id;
}

/** Properties that should not be proxied to the original interface */
const PROXY_INTERFACE_SKIP_PROPERTIES: Array<string | symbol> = [
"component",
"connectionCount",
"events",
"hidden",
"hooks",
"id",
"isInput",
"name",
"nodeId",
"port",
"templateId",
"value",
] satisfies Array<keyof NodeInterface>;

export function createGraphNodeType(template: GraphTemplate): new () => AbstractNode & IGraphNode {
return class GraphNode extends AbstractNode implements IGraphNode {
public type = getGraphNodeTypeString(template);
Expand Down Expand Up @@ -161,7 +177,11 @@ export function createGraphNodeType(template: GraphTemplate): new () => Abstract
return new Proxy(newInterface, {
get: (target, prop) => {
// we can't proxy the "__v_isRef" property, otherwise we get a maximum stack size exceeded error
if (prop in target || (typeof prop === "string" && prop.startsWith("__v_"))) {
if (
PROXY_INTERFACE_SKIP_PROPERTIES.includes(prop) ||
prop in target ||
(typeof prop === "string" && prop.startsWith("__v_"))
) {
return Reflect.get(target, prop);
}
// try to find the interface connected to our graph input
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"url": "https://github.com/newcat/baklavajs/issues"
},
"devDependencies": {
"typescript": "^5.4.2"
"typescript": "^5.4.3"
}
}
2 changes: 1 addition & 1 deletion packages/full/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
},
"devDependencies": {
"esbuild": "^0.20.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
}
}
2 changes: 1 addition & 1 deletion packages/interface-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"rollup-plugin-visualizer": "^5.12.0",
"rollup-plugin-vue": "^6.0.0",
"sass": "^1.72.0",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"typescript": "^5.4.3",
"vite": "^5.2.2",
"vite-plugin-dts": "^3.7.3",
"vue": "^3.4.21",
"vue-tsc": "^2.0.6"
"vue-tsc": "^2.0.7"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"rimraf": "^5.0.5",
"sass": "^1.72.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"declaration": true,
"baseUrl": ".",
"skipLibCheck": true
},
"exclude": ["node_modules"]
Expand Down
Loading

0 comments on commit b928560

Please sign in to comment.