Repository navigation
feat(embed): add iframe-embeddable REPL + event loop widget - #27
Merged
Merged
Conversation
Add a standalone /embed route that reuses the existing Workbench (console or event-loop view) with no app shell chrome, preloads a snippet via ?example=<id> (REPL examples or interview patterns), and is explicitly exempted from frame-blocking headers so it can be dropped into third-party iframes. Documents the embed in README. Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a standalone, iframe-friendly
/embedroute that reuses the existingWorkbenchcomponent (no fork) for dropping into a blog post or docs page.Workbenchitself, and a small "via runtime.js" footer badge linking back to/. NoAppShellchrome (no Sources tab, no search, no theme toggle).REPL_EXAMPLES[0];?example=<id>looks up either a REPL example id or an interview-pattern id (INTERVIEW_PATTERNS) and preloads its code, falling back to the default on unknown ids.?view=loopopens the event-loop view.embedFrameMiddlewareinsrc/start.ts) explicitly stripsX-Frame-Optionsand setsContent-Security-Policy: frame-ancestors *only on/embed, so third-party sites can embed it while the rest of the site keeps its normal frame protection.<iframe>snippet.Verification
npm run typecheck— cleannpm run lint— 0 errors (8 pre-existing warnings, unrelated)npm test— 45 passnpm run build— succeeds; embed emitted as its own chunk/embedpreloadsREPL_EXAMPLES[0]?example=event-loop-orderand?example=starvationpreload their snippets?example=does-not-existfalls back to the default/embed?view=looprenders<iframe>on a throwaway local page renders the tool with no framing block; response headers carryframe-ancestors *and noX-Frame-OptionsFiles
src/routes/embed.tsx(new)src/start.ts(frame-exemption middleware)src/routeTree.gen.ts(auto-regenerated with/embed)README.md(embed docs)