Lazy Load Social Buttons tare da Socialite.js

keyboard mai sauri

Yau na kasance mai ban sha'awa rana tare da rukunin yanar gizo a Jerin Angie. Jerin Angie ya kasance yana haɓaka rukunin yanar gizon su a cikin wani laburaren kayan tarihi mai ban sha'awa all kuma duk tsawon lokacin suna ci gaba da hanzarta shafin su. Shafukan su suna lodi da saurin makanta. Idan baku yarda da ni ba, tashi wannan shafin akan Kofofin Garage.

Shafin yana haɗa hotuna, bidiyo, da maɓallan zaman jama'a… kuma har yanzu ana loda abubuwa a cikin milliseconds. Kwatanta shafin su da nawa kamar yin tseren Prius ne da F-16. Ba a yi su ba tukuna, ko dai, koyaushe suna neman hanyoyin haɓaka ƙwarewar abokin ciniki da samun abubuwan da aka samo da raba su.

Ba mu da ƙungiyar ci gaba na cikakken lokaci ko albarkatun kamfanin jama'a, don haka ci gabanmu ya ɗan jinkirta fiye da Jerin Angie. Muna da mashahuri mai ban mamaki tare da Flywheel - ta yin amfani da kwandon ci gaban su da CDN, amma mun san har yanzu akwai wasu abubuwan da ke cutar da mu. Misali, hotunanmu basu inganta ba. Akwai sabis a wajen da zaku iya canza hotunanku zuwa ƙananan ɓangaren girmansu yayin kiyaye tsabtar su… muna dubansu.

Yayin da nake nuna musu rukunin yanar gizonmu, sai na ratse sai na rataye kaina yayin da shafin ya daskare yayin loda maɓallin jama'a. Ina tsammanin Facebook ne. Argh… na biyu ko biyu daga baya madannin ya bayyana kuma sauran shafin an loda su. Ugh.

Lokacin da na bayyana batun, injiniyan su nan da nan ya sami mafita, karafarini.js. Socialite yana samar da hanya mai sauƙi don aiwatarwa da kunna yalwar maɓallan maɓallan zamantakewar - kowane lokacin da kuke so. A kan lodin daftarin aiki, akan shaƙatawa, akan kowane taron! Tunda zamantakewar jama'a ta loda maɓallan asynchronously, takaddar ba zata rataye ba yayin jiran 50kb na kafofin watsa labarun.

Abin godiya, an riga an sami kayan aikin WordPress wanda ya haɗa da Socialite, wanda ake kira WPSocialite. Yau da daddare na zare duk lambar da na kebanta don loda maballin kuma na aiwatar da WPSocialite. Na sami damar tsara CSS ɗin kuma in gyara maɓallan da nake so. Ina jiran wasu karin maballin da za a kara a gaba - kamar Buffer ko Reddit… amma wannan ya dace a yanzu!

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.