Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions directory/skills/raea/motion/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,28 @@ the native one (Rune) chosen by `export const app = { target }`, is `raea app ru
- Packages: `raea add @assistant-ui/react` writes `package.json` and `raea.lock` and lays out `node_modules`. raea's own package
manager does it; no Node, npm or bun is needed, and install scripts never run.
- A React library that needs a real DOM (assistant-ui, Radix, shadcn) runs as an app: a module whose default export is
a component taking `{ width, height }`, running on real react-dom in a document of its own. Place it:
a component taking `{ width, height }`, running on react-dom in a document of its own (@raea/ui's, on a Blitz page:
what raea feed runs on), with the CSS its modules import and Tailwind's for its folder. Place it:
- on a screen in 3D: `<Screen name="chat" app="chat.tsx" resolution={[480, 640]} crt={false} />` (beside the 3D, or
as a Model's `screens` entry). The path is relative to the composition's folder;
- as an app panel or tool: `export const surface = "dom"` in the panel's file.
- Input in live play: the pointer reaches an app screen through the 3D (where it lands on the picture). Pressing on the
screen gives it the keys, and the game gets none until a press elsewhere or Escape.
- Renders: an app runs on the frame clock (timers, `Date`, `performance.now`, `requestAnimationFrame` follow the frame),
so a render repeats frame for frame.
- Exported games: `export-game` bundles each app with its packages. The player must be built with them:
`cargo build --profile game -p raea-app-game --bin raea-game --features player,surfaces` (+6.7 MB); export refuses
an app screen with a player built without.
- Renders: an app screen is stepped once a frame on the frame clock (its timers and `performance.now` follow the frame),
so a render repeats frame for frame. A render of a play's input log (`render --input`) gives it what reached it in
the play, so the render draws what was played.
- Exported games: `export-game` bundles each app with its packages (`chat.tsx.surface.js` and `.surface.css`), and the
player draws it on its own Blitz page.

Not yet:
- An app as a flat 2D layer of a composition. It can be a 3D `<Screen>` or an app panel only; for a flat look, put a
`crt={false}` screen square to the camera.
- A composition itself importing a DOM library. Only an app (above) can; the composition's own React is raea's lite
runtime.
- Input to an app in a render: `render --input` replays the page's input, but an app screen gets none. Script what it
should show inside the app, on its own timers.
- `Date` in an app screen: it reads the wall clock, so a render shows another time than its play. Use timers or
`performance.now`.
- A drag that leaves an app screen: it ends at the edge (a browser's goes on). A double click on one.
- The page host's desktop calls in an app screen (the clipboard, links, notifications).
- Anything in front of a screen blocking its clicks: the ray hits the nearest screen, through other objects. It also
assumes the 3D fills the stage.
- Network calls in an app during a render: nothing records and replays them, so a render that calls a model doesn't
Expand Down
19 changes: 11 additions & 8 deletions skills/raea/motion/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,28 @@ the native one (Rune) chosen by `export const app = { target }`, is `raea app ru
- Packages: `raea add @assistant-ui/react` writes `package.json` and `raea.lock` and lays out `node_modules`. raea's own package
manager does it; no Node, npm or bun is needed, and install scripts never run.
- A React library that needs a real DOM (assistant-ui, Radix, shadcn) runs as an app: a module whose default export is
a component taking `{ width, height }`, running on real react-dom in a document of its own. Place it:
a component taking `{ width, height }`, running on react-dom in a document of its own (@raea/ui's, on a Blitz page:
what raea feed runs on), with the CSS its modules import and Tailwind's for its folder. Place it:
- on a screen in 3D: `<Screen name="chat" app="chat.tsx" resolution={[480, 640]} crt={false} />` (beside the 3D, or
as a Model's `screens` entry). The path is relative to the composition's folder;
- as an app panel or tool: `export const surface = "dom"` in the panel's file.
- Input in live play: the pointer reaches an app screen through the 3D (where it lands on the picture). Pressing on the
screen gives it the keys, and the game gets none until a press elsewhere or Escape.
- Renders: an app runs on the frame clock (timers, `Date`, `performance.now`, `requestAnimationFrame` follow the frame),
so a render repeats frame for frame.
- Exported games: `export-game` bundles each app with its packages. The player must be built with them:
`cargo build --profile game -p raea-app-game --bin raea-game --features player,surfaces` (+6.7 MB); export refuses
an app screen with a player built without.
- Renders: an app screen is stepped once a frame on the frame clock (its timers and `performance.now` follow the frame),
so a render repeats frame for frame. A render of a play's input log (`render --input`) gives it what reached it in
the play, so the render draws what was played.
- Exported games: `export-game` bundles each app with its packages (`chat.tsx.surface.js` and `.surface.css`), and the
player draws it on its own Blitz page.

Not yet:
- An app as a flat 2D layer of a composition. It can be a 3D `<Screen>` or an app panel only; for a flat look, put a
`crt={false}` screen square to the camera.
- A composition itself importing a DOM library. Only an app (above) can; the composition's own React is raea's lite
runtime.
- Input to an app in a render: `render --input` replays the page's input, but an app screen gets none. Script what it
should show inside the app, on its own timers.
- `Date` in an app screen: it reads the wall clock, so a render shows another time than its play. Use timers or
`performance.now`.
- A drag that leaves an app screen: it ends at the edge (a browser's goes on). A double click on one.
- The page host's desktop calls in an app screen (the clipboard, links, notifications).
- Anything in front of a screen blocking its clicks: the ray hits the nearest screen, through other objects. It also
assumes the 3D fills the stage.
- Network calls in an app during a render: nothing records and replays them, so a render that calls a model doesn't
Expand Down
Loading