Skip to content

Commit 6956b2d

Browse files
wip add iframe canvas model
1 parent 33165ae commit 6956b2d

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

editor-packages/editor-canvas/canvas/canvas.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ export function Canvas({
243243
node["filekey"] = filekey;
244244
return (
245245
<LazyFrame key={node.id} xy={[node.x, node.y]} size={node}>
246+
{/* 👇 dev only (for performance tracking) 👇 */}
247+
{/* <div style={{ width: "100%", height: "100%", background: "grey" }} /> */}
248+
{/* 👆 ----------------------------------- 👆 */}
246249
{renderItem({
247250
node: node as ReflectSceneNode & { filekey: string },
248251
zoom, // ? use scaled_zoom ?
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Canvas Server page to be embeded in iframe of the canvas.
2+
3+
## Why? - For performance optimization
4+
5+
> e.g.
6+
7+
```tsx
8+
function Host() {
9+
// interact with canvas server via window messaging
10+
return <iframe ref={ref} src="{HOST}/canvas-server" />;
11+
}
12+
```
13+
14+
## Pros
15+
16+
- Performance optimization
17+
18+
## Cons
19+
20+
- Lack of control
21+
- Complex state management
22+
- Where to handle the computational work? - what data should be transfered?
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from "react";
2+
3+
export default function CanvasServer() {
4+
return <></>;
5+
}

0 commit comments

Comments
 (0)