Replies: 1 comment 2 replies
-
Hey @Ennoriel, thanks for starting a discussion on this!
Yeah, that would work, happy if you want to submit a PR on this
Oh, yeah, to be honest I haven't really put a lot of thought into that, do you have an example of how you' implement that?
Guessing you're referring to #177 I think @Cahllagerfeld made a component for this in https://github.com/spences10/sveltekit-embed/blob/main/src/lib/components/generic-embed.svelte If you have other thoughts I'd love to hear them, thanks |
Beta Was this translation helpful? Give feedback.
-
I think the library is awesome! 🔥
I have made a Gist component that I can move here: https://github.com/Ennoriel/machyme/blob/master/src/lib/components/blog/Gist.svelte. However, the component is not handled the same way as your iframes since gist are not really embedable with an iframe but more like an external
<script>
. In addition, the height is not set but calculated afterwards. For this reason, the component is not fully SSR.I think that the Observer is great, I would maybe load the iframe a little bit before its visible (say 100 or 200px like lazy loading images). This offset could maybe be configurable (in a context). And I'd like to know why it is dismounted afterwards?
In addition, I've seen a past discussion about adding a common <Iframe> component I strongly agree with. ;)
Beta Was this translation helpful? Give feedback.
All reactions