Skip to content

Export ASCII art as a self-contained React component#44

Draft
benjaminleonard wants to merge 3 commits into
mainfrom
feat/export-react-bundle
Draft

Export ASCII art as a self-contained React component#44
benjaminleonard wants to merge 3 commits into
mainfrom
feat/export-react-bundle

Conversation

@benjaminleonard
Copy link
Copy Markdown
Collaborator

@benjaminleonard benjaminleonard commented Jun 3, 2026

New pass at #41


Adds Download React: exports a single .tsx that bundles the program + Mitos runtime (via esbuild-wasm, rendering into a <pre>) and runs the art live, rather than baking frames. Tiny and size-independent of animation length (sin ≈ 7.5 KB).

  • Parity with all stock programs — generative, npm (unpkg), @/utils, and image sources all export and render.
  • Image/GIF support — bakes the derived 0→1 value grid, not the source image, packed as one byte/cell (decoded back to number[][] at load). Static image 23→11 KB; a 24-frame GIF ≈ 88 KB and animates correctly.
  • Restored the text renderer removed in Canvas recorder #43.
  • /sandbox page (dev + deployed) to drag exported components in and preview them.
  • Plus a Figma-style zoom-to-cursor tweak in the preview.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mitos Ready Ready Preview Jun 3, 2026 12:12pm

Request Review

@benjaminleonard benjaminleonard changed the title React Export Alternate Export ASCII art as a self-contained React component Jun 3, 2026
@benjaminleonard
Copy link
Copy Markdown
Collaborator Author

@austinmrobinson what do you think? You can try downloading one and then drop it in /sandbox to preview.

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