Skip to content

Simplify examples: static builds + iframe embedding#4

Merged
bensie merged 7 commits intomainfrom
bensie/simplify-examples
Mar 8, 2026
Merged

Simplify examples: static builds + iframe embedding#4
bensie merged 7 commits intomainfrom
bensie/simplify-examples

Conversation

@bensie
Copy link
Member

@bensie bensie commented Mar 8, 2026

Summary

Replaces the over-engineered example implementation with a simple, scalable pattern: examples are standalone Vite apps built to static/example-apps/{name}/ and embedded in documentation via iframe with dark mode sync.

Removes custom webpack plugin, alias resolution, separate dependency management, and custom doc item component. Adding a new example now only requires creating a Vite app, writing an MDX page with <ExampleIframe>, and updating the sidebar.

Changes

  • Remove ocular-docusaurus-plugin (custom webpack resolution for example node_modules)
  • Remove ExamplesDocItem (custom doc item wrapper)
  • Add build-examples.sh to build all examples during site build
  • Add ExampleIframe component for embedding with dark mode sync via postMessage
  • Update real-time-chat example for standalone operation
  • Remove postinstall hook for example dependency installation

bensie added 7 commits March 8, 2026 14:34
Replace complex custom webpack plugin, alias resolution, and separate dependency management with a straightforward pattern: examples are standalone Vite apps built to static/example-apps/{name}/, then embedded in documentation via iframe with theme sync via postMessage.

Changes:
- Remove ocular-docusaurus-plugin (custom webpack resolution)
- Remove ExamplesDocItem (custom doc wrapper)
- Remove postinstall hook for example dependency installation
- Add build-examples.sh script to build all examples during site build
- Create ExampleIframe component for embedding with dark mode sync
- Update real-time-chat example for standalone operation (Vite config, index.html with Tailwind CDN)
- Add dark mode listener and Tailwind class-based dark mode config

Adding new examples now requires only: create a Vite app, add MDX page with <ExampleIframe>, update sidebar.
Redesign chat boxes with rounded card layout, avatar initials, iMessage-style
bubbles, and polished input field. Add comprehensive walkthrough of the example
covering authentication, connecting, subscribing, sending/receiving messages,
typing indicators, and cleanup with code snippets.
@bensie bensie merged commit 20e77a6 into main Mar 8, 2026
2 checks passed
@bensie bensie deleted the bensie/simplify-examples branch March 8, 2026 22:52
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