New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ResizeObserver instead of iframes if available #5524
Conversation
This is very cool, but I don't think we can switch between ResizeObserver and iframes for the same binding — you could much too easily fall into a situation where something works when you test it locally in Chrome, but doesn't work for all of your users (because you've used it on an element that can't contain an iframe, like an inline-level element or an SVG element). Instead, perhaps we should add a new set of bindings... <div bind:contentRect bind:contentBoxSize bind:borderBoxSize>...</div> ...which are documented with the caveat that they don't work in IE11 etc. |
has anyone suggested adding an ie11 compat toggle to svelte:options yet? |
why is this PR closed ? |
I'm sorry I was deleting some of my svelte branches, I assumed those linked to an open PR would prompt a confirm dialog |
@pushkine are you interested in updating this PR for the |
Implements ResizerObserver per @Rich-Harris sveltejs#5524 (comment) Done poorly, looking for guidance on doing this correctly or for someone else to take it on.
Would love to has this merge too. I've recently encountered a performance issue when rendering large arrays of elements that uses Re: ResizeObserver types Re: Can't use iframes in some elements and FWIW ResizeObserver now has 92% global usage |
Fixes an issue where gridded legend scale would be the wrong size on initial load on Firefox when screen width was ~900px. Also improves performance a little bit, in theory. Based on sveltejs/svelte#5524 which hasn't merged upstream because of older browser support that we don't have to worry about (since some of the WebGL stuff requires a somewhat recent browser anyways).
See #5524 (comment) Closed in favour of #5963 |
Implements ResizerObserver per @Rich-Harris sveltejs#5524 (comment) Done poorly, looking for guidance on doing this correctly or for someone else to take it on.
https://caniuse.com/resizeobserver 87%
note that typescript dom libs do not include types for ResizeObserver
untested