More actions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
# | # | ||
#:''[[AMP]] [[components]] [[may]] [[have]] [[JavaScript]] [[under the hood]], [[but]] [[they're]] [[carefully]] [[designed]] [[to]] [[make]] [[sure]] [[they]] [[don't]] [[cause]] [[performance]] [[degradation]].'' <br> '''[[ɓangarori|Ɓangarorin]]''' AMP kan iya samun JavaScript a | #:''[[AMP]] [[components]] [[may]] [[have]] [[JavaScript]] [[under the hood]], [[but]] [[they're]] [[carefully]] [[designed]] [[to]] [[make]] [[sure]] [[they]] [[don't]] [[cause]] [[performance]] [[degradation]].'' <br> '''[[ɓangarori|Ɓangarorin]]''' AMP kan iya samun manhajar JavaScript a cikinsu, amma an tsara su ne da kula don a tabbatar da cewa ba za su jinkirtar da gudanarwar aiki ba. [https://amp.dev/about/how-amp-works/] | ||
# | # | ||
#:''[[while|While]] [[custom]] JS is '''[[allowed]]''' in <a href="../documentation/components/reference/amp-script.md"><code>amp-script</code></a>, and [[third-party]] JS is '''[[allowed]]''' in iframes, it [[cannot]] [[block]] [[rendering]]. [[for example|For example]], if third-party JS [[uses]] the <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance <code>document.write</code> API</a>, it does not block rendering the [[main]] [[page]].''<br><br>Duk da dai '''za a iya''' amfani da rubutun JS na kanka a cikin <a href="../documentation/components/reference/amp-script.md"><code>amp-script</code></a>, kuma za '''a iya amfani''' da JS ɗin waje a cikin iframes, ba zai iya toshe fitowar shafi ba. Misali, idan JS ɗin waje yayi amfani da <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance document.write API</a>, bai toshe fitowar babban shafin ba. | #:''[[while|While]] [[custom]] JS is '''[[allowed]]''' in <a href="../documentation/components/reference/amp-script.md"><code>amp-script</code></a>, and [[third-party]] JS is '''[[allowed]]''' in iframes, it [[cannot]] [[block]] [[rendering]]. [[for example|For example]], if third-party JS [[uses]] the <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance <code>document.write</code> API</a>, it does not block rendering the [[main]] [[page]].''<br><br>Duk da dai '''za a iya''' amfani da rubutun JS na kanka a cikin <a href="../documentation/components/reference/amp-script.md"><code>amp-script</code></a>, kuma za '''a iya amfani''' da JS ɗin waje a cikin iframes, ba zai iya toshe fitowar shafi ba. Misali, idan JS ɗin waje yayi amfani da <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance document.write API</a>, bai toshe fitowar babban shafin ba. | ||
Line 7: | Line 7: | ||
##''They also like to <code>document.write</code> more sync scripts.'' <> Kuma suna son amfani da <code>document.write</code> don su daɗa gina tsarin gina manhajojin da ke gudanar da tafiya a lokaci ɗaya. | ##''They also like to <code>document.write</code> more sync scripts.'' <> Kuma suna son amfani da <code>document.write</code> don su daɗa gina tsarin gina manhajojin da ke gudanar da tafiya a lokaci ɗaya. | ||
##''For example, if you have five ads on your page, and each of them cause three synchronous loads, each with a 1 second latency connection, you’re in 15 seconds of load time just for JS loading.'' <> Misali, idan kana da tallace-tallace guda biya a shafinka, kuma kowane na haifar da lodin da ke tafiya a lokaci ɗaya sau uku, kowane na ɗaukar ɗakika ɗaya kafin haɗi, ka kasance ka kai daƙiƙoƙi 15 don kawai kana lodin JS. | ##''For example, if you have five ads on your page, and each of them cause three synchronous loads, each with a 1 second latency connection, you’re in 15 seconds of load time just for JS loading.'' <> Misali, idan kana da tallace-tallace guda biya a shafinka, kuma kowane na haifar da lodin da ke tafiya a lokaci ɗaya sau uku, kowane na ɗaukar ɗakika ɗaya kafin haɗi, ka kasance ka kai daƙiƙoƙi 15 don kawai kana lodin JS. | ||
## AMP pages allow third-party JavaScript but only in sandboxed iframes. | ##''AMP pages allow third-party JavaScript but only in sandboxed iframes.'' <> Shafukan AMP kan iya samun manhajar JavaScript daga waje amma dai sai an sa a cikin sashin iframe ɗin da aka keɓe. | ||
## By restricting them to iframes, they can’t block the execution of the main page. | ##''By restricting them to iframes, they can’t block the execution of the main page.'' <> Idan an hana su fita daga sashin iframe, ba za su iya toshe gudanar da tafiyar babban shafin ba. | ||
## Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM. | ##''Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM.'' <> Ko ma idan sun jawo maimaicin ire-iren ƙidaya, guntayen iframes ɗinsu na da ƙananan DOM. |
Revision as of 19:02, 29 April 2020
-
- AMP components may have JavaScript under the hood, but they're carefully designed to make sure they don't cause performance degradation.
Ɓangarorin AMP kan iya samun manhajar JavaScript a cikinsu, amma an tsara su ne da kula don a tabbatar da cewa ba za su jinkirtar da gudanarwar aiki ba. [1]
- AMP components may have JavaScript under the hood, but they're carefully designed to make sure they don't cause performance degradation.
-
- While custom JS is allowed in <a href="../documentation/components/reference/amp-script.md">
amp-script
</a>, and third-party JS is allowed in iframes, it cannot block rendering. For example, if third-party JS uses the <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performancedocument.write
API</a>, it does not block rendering the main page.
Duk da dai za a iya amfani da rubutun JS na kanka a cikin <a href="../documentation/components/reference/amp-script.md">amp-script
</a>, kuma za a iya amfani da JS ɗin waje a cikin iframes, ba zai iya toshe fitowar shafi ba. Misali, idan JS ɗin waje yayi amfani da <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance document.write API</a>, bai toshe fitowar babban shafin ba.
- While custom JS is allowed in <a href="../documentation/components/reference/amp-script.md">
-
- Third-party JS likes to use synchronous JS loading. <> Manhajar JS ta waje na son amfani da yin lodin JS a lokaci ɗaya.
- They also like to
document.write
more sync scripts. <> Kuma suna son amfani dadocument.write
don su daɗa gina tsarin gina manhajojin da ke gudanar da tafiya a lokaci ɗaya. - For example, if you have five ads on your page, and each of them cause three synchronous loads, each with a 1 second latency connection, you’re in 15 seconds of load time just for JS loading. <> Misali, idan kana da tallace-tallace guda biya a shafinka, kuma kowane na haifar da lodin da ke tafiya a lokaci ɗaya sau uku, kowane na ɗaukar ɗakika ɗaya kafin haɗi, ka kasance ka kai daƙiƙoƙi 15 don kawai kana lodin JS.
- AMP pages allow third-party JavaScript but only in sandboxed iframes. <> Shafukan AMP kan iya samun manhajar JavaScript daga waje amma dai sai an sa a cikin sashin iframe ɗin da aka keɓe.
- By restricting them to iframes, they can’t block the execution of the main page. <> Idan an hana su fita daga sashin iframe, ba za su iya toshe gudanar da tafiyar babban shafin ba.
- Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM. <> Ko ma idan sun jawo maimaicin ire-iren ƙidaya, guntayen iframes ɗinsu na da ƙananan DOM.
Pages in category "AMP"
The following 3 pages are in this category, out of 3 total.