ampproject / ampproject/amphtml

Intent-to-Remove: loader allowlist

Open
#33,543 6 comments 1 reaction 1 assignee Claimed by @alanorozco View on GitHub
INTENT TO REMOVE Stale WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

We show loading indicators only for a select group of elements:

https://github.com/ampproject/amphtml/blob/246b09c4f8c80a621289d3b9dcb67436af94a291/src/layout.js#L96-L118

This list gets shipped as part of [`v0.js`](https://cdn.ampproject.org/v0.js). Introducing a new component with a loader **will then increase the size of `v0.js`** roughly by the size of its name, e.g. `'AMP-TIKTOK': !0`.

## This proposes removing the allowlist by tagname

- At one point, loaders were changed so that they would [only show up after 600ms of loading time](https://github.com/ampproject/amphtml/blob/212f4fe289e351f22090b10c5eb7508375c97a2e/extensions/amp-loader/0.1/amp-loader.js#L31-L33). **Loaders appear less frequently than when the list was introduced.**

- The list is not widely known among contributors, so it's likely very out of date, and would further increase the size of v0.js if updated. **Switching to a simpler ruleset would prevent v0.js from growing further**, and would ensure that components get the same treatment when new.

### Replacement rule

Loaders will now be rendered any time a component's layout is **not** `container` **nor** `nodisplay`.

🔵 **includes**:

- `amp-img`
- `amp-video`
- `amp-iframe`
- `amp-list`
- (and more, see validation rules)

⛔️ **excludes**:

- `amp-story`
- `amp-sidebar`
- `amp-accordion`
- `amp-fit-text`
- (and more, see validation rules)

---

cc @ampproject/wg-components
cc @ampproject/wg-performance

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.