Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

lazy load img avatars #244

Closed
vdias38 opened this issue Jan 25, 2019 · 3 comments
Closed

lazy load img avatars #244

vdias38 opened this issue Jan 25, 2019 · 3 comments
Assignees

Comments

@vdias38
Copy link
Contributor

vdias38 commented Jan 25, 2019

No description provided.

@vdias38 vdias38 self-assigned this Jan 25, 2019
@vdias38
Copy link
Contributor Author

vdias38 commented Jan 25, 2019

I've tried to use ion-img for avatars but face 2 main issues:

  • the anniversaries avatar badly displayed on mobile (web)
  • component is only designed to be used inside the VirtualScroll component, and the VirtualScroll functionality, as currently supplied by Ionic (as of February 2018), is broken. See this post for more details

screenshot_2019-01-29-01-50-26_png

Then I've looked for some alternatives and find these 2 libs interesting:

st-img

Using Stencil Built Web Components with Ionic

Registered in the npm

Not registered in the npm

Publish Stencil component to npm

https://forum.ionicframework.com/t/stencil-publishing-a-stencil-component-to-npm/120940
https://www.joshmorony.com/publishing-a-web-component-using-stencil-and-using-it-anywhere/

ng-defer-load

Preventing Content Reflow From Lazy-Loaded Images

https://css-tricks.com/preventing-content-reflow-from-lazy-loaded-images/

@vdias38
Copy link
Contributor Author

vdias38 commented Jan 28, 2019

The original network activity with imgflow crop to 1024px (browsing live and contacts page) => 38 request to imgs for 5Mb downloaded
infomobi__improve_employee_experience_and_ion-employee_ node ionic_nvm_rc_version__term_program_apple_terminal 100x42_and_environment_ts ion-employee_and_config_xml _infomobi

Resized img avatar to 160x160

Applying imgflow with crop to 160x160 on avatar imgs => 38 request to imgs for 960Kb downloaded
infomobi__improve_employee_experience_and_ion-employee_ node ionic_term_program_apple_terminal_nvm_cd_flags_ _100x42

Resized + lazy load

Applying imgflow with crop to 160x160 + lazy load mmb-avatar-img => 26 request to imgs for 880Kb downloaded
infomobi__improve_employee_experience_and_live_html_ _ion-employee

@vdias38
Copy link
Contributor Author

vdias38 commented Jan 30, 2019

I've tested to integrate a stencil web component built with latest version of @stencil/core, v0.17.0, on Ionic v3, but without success. None error raised but the web component is not interpreted and lib is not loaded.
The st-img stencil web comp. works on Ionic v3 with @stencil/core v0.0.8-9.
I've found a stencil web component web-social-share running on Ionic v3 until @stencil/core@0.8.2.
Another good example of stencil wc web-photo-filter

vdias38 added a commit that referenced this issue Jan 30, 2019
integrate mmb-avatar-img web component

Closes #244
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant