Skip to content

Extract reusable fire runtime consumers#7

Open
cybrdelic wants to merge 1 commit into
mainfrom
codex/fire-runtime-consumers
Open

Extract reusable fire runtime consumers#7
cybrdelic wants to merge 1 commit into
mainfrom
codex/fire-runtime-consumers

Conversation

@cybrdelic

Copy link
Copy Markdown
Owner

Summary

This is the first extraction pass for issue #6.

The goal here is not to pretend the full app/runtime split is done. The goal is to cut a real seam into the current app so the fire system can already be exercised as a reusable runtime mounted by multiple consumer shells.

This PR does three concrete things:

  1. Extracts the GPU transport/buffer contract into components/fireRuntime/transport.ts so one of the most app-independent runtime pieces no longer lives inside the control-deck component.
  2. Adds a formal consumer registry in components/fireRuntime/consumers.ts that describes the target host shapes the runtime needs to support.
  3. Refactors FluidSimulation so it can mount into different consumer profiles and size itself to its own container instead of assuming it always owns the full browser window.

Consumer Examples Included

The app now ships with a consumer gallery in App.tsx that remounts the same runtime into five host examples:

  • Control Deck: full tuning/diagnostics product surface
  • 3D Scene Embed: minimal scene-mounted runtime shell
  • 2D Site Hero: branded hero/background treatment
  • Cursor Effect: lighter fire-only interactive effect shell
  • Ambient Background: lower-UI ambient/idle consumer

These examples are intentionally run one at a time so we can prove the runtime can serve different products without paying for five simultaneous GPU scenes.

Implementation Notes

  • FluidSimulation now accepts a consumerId and switches chrome/defaults based on the consumer definition instead of hardcoding the control deck as the only host.
  • The simulator now measures its own root container with ResizeObserver, which is the key requirement for future embedding in 3D scenes, 2D sections, and effect surfaces.
  • The full control deck remains intact as the flagship consumer.
  • README project structure/docs were updated so the new runtime seam and consumer examples are discoverable.

What This PR Does Not Claim

  • This is not yet a standalone published runtime package.
  • This does not yet extract all simulation/rendering code out of FluidSimulation.tsx.
  • This does not yet provide adapter packages for React/Three.js/DOM/canvas consumers.

Those remain follow-up work under issue #6. This PR is the first credible step that makes those follow-ups much less speculative.

Validation

  • npm run typecheck
  • npm run build

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant