dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

Lazy load iframe variants #40

Closed therealpecus closed 5 years ago

therealpecus commented 5 years ago

Is your feature request related to a problem? Please describe. When components have a high number of variants, the web page slows down to a crawl loading all of the iframes for the variants.

Describe the solution you'd like We integrated Yall.js https://github.com/malchata/yall.js/ and patched the component template to lazy load the variant iframe. This, combined with the existing anchor navigation, allows to load only variants needed for display, speeding up the page considerably. We have pages with 30 to 40 variants (which means 10 ~ 15 variants over 3 themes).

Describe alternatives you've considered None.

Additional context We have a PR ready but would like to discuss the overall benefit for the project and/or additional use cases before submitting it. Of course we can open a PR to share the code. Let us know what would work best.

dennisreimann commented 5 years ago

Nice, I‘d like to have a look at this in a PR :)

In another project I have used lazyload before and it was great to work with. It might be worth exploring which lib is the best fit.