Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Make Frame an iFrame possible #4

Open
stolinski opened this issue Apr 28, 2022 · 7 comments
Open

Make Frame an iFrame possible #4

stolinski opened this issue Apr 28, 2022 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@stolinski
Copy link
Contributor

This seems pretty crutial to how many of this type of tool works. I need to figure out how to share state between svelte and iframe. If you have exp with this, I'd love to explore.

@stolinski
Copy link
Contributor Author

I might need some help with this. I've been looking at https://github.com/sveltejs/sites/blob/master/packages/repl/src/lib/Output/Viewer.svelte

and have a prototype where it's kinda working, it's just html rn. No css or JS.

@stolinski stolinski added the help wanted Extra attention is needed label May 10, 2022
@oneezy
Copy link

oneezy commented May 30, 2022

here's an example of a REPL inside a REPL (which makes use of an iframe)
https://svelte.dev/repl/eefc5b3e2311457693f153dcdf3ece2f?version=3.31.0

it has the html / css / js being applied

@stolinski
Copy link
Contributor Author

Oh dang. This is exactly what I need. Thank you for the link!

@oneezy
Copy link

oneezy commented Jun 2, 2022

no problemo homie! looking forward to boo 👻 coming through

@stolinski
Copy link
Contributor Author

So now it feels like I'm completely re-implementing the REPL now that I'm getting into dealing with imports and nested components. I really want this iframe aspect to work but it's def a big beast beyond just getting a single component rendered into the iframe.

I might need to fork large parts of the repl repo and use their bundler as it's already taking care of the hard stuff (imports) Def feels like a lot of work. 😅

@stolinski
Copy link
Contributor Author

stolinski commented Jun 7, 2022

I've been hacking on this all day and have now really hit some bumps with Typescript and this approach . Kinda feels like this approach of dealing with Svelte compiling inside of Bookit might not be the right approach. I did have a working prototype that used a portal with an iframe but need to find some way to get component state to update.

@ghost
Copy link

ghost commented Aug 13, 2022

Maybe, rather than passing code to the iframe, generate a page from the code and add that route to the iframe. Svelte will take care of the rest JS or TS.

Maybe a preprocessor would be the way to handle the generation ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants