question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mechanism for loading new extensions in <amp-live-list>

See original GitHub issue

Problem

amp-live-list supports adding new content to an already loaded document, via polling for updates to the origin or cache.

New content can potentially include custom elements which were not in the original document. This presents a problem because amp-live-list does not specify a mechanism for loading new script tags into the document head, only for modifying content in the document body. The server side filtering rules even specify that the new content can strip out the head section in the response for efficiency. This filtering is implemented by the AMP cache.

The current recommended workaround is that documents using <amp-live-list> include the superset of all possible custom elements which may be loaded in the future. This solution is unfortunately likely to result in pages loading far more javascript than is necessary.

Proposal

<amp-live-list> documents should always specify the set of custom elements required for loading the current document content (and ideally no others) just like any other AMP document. In the server side filtered case, documents should include a small <head> section containing the custom elements used by the filtered content. For example:

<!doctype html>
<html ⚡>
<head>
  <script async custom-element="amp-twitter" src="https://cdn.ampproject.org/v0/amp-twitter-0.1.js"></script>
</head>
<body>
  <amp-live-list id="live-list-1" data-max-items-per-page="10">
    <div items>
      <amp-twitter id="item-3"
           data-update-time="1462955848173"
           data-sort-time="1462955848173"></amp-twitter>
    </div>
  </amp-live-list>
</body>
</html>

The amp-live-list custom-element javascript will need to extract the script tags from the head section and load any new custom-elements which haven’t yet been loaded before rendering the content.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
erwinmombaycommented, Oct 24, 2017

@aghassemi @camelburrito i already have the code for this here https://github.com/ampproject/amphtml/pull/9302/files

just need to add tests which I’ll do after doing release today

0reactions
ericlindley-gcommented, Dec 21, 2017

Closing this, as I think it’s launched, but @erwinmombay , let me know if there are any bits that aren’t done yet

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bandwidth Extension for Transimpedance Amplifiers
The transimpedance amplifier (TIA) which converts the photodiode current into a voltage requires high gain, wide bandwidth, low noise and low input impedance ......
Read more >
(PDF) Design of a New Compliant Mechanical Amplifier
In this paper, a new topology that is a symmetric five bar profile for displacement amplification is proposed, and a compliant mechanical ...
Read more >
Waveform Engineered Sequential Load Modulated Balanced ...
Abstract—This article presents a novel waveform engineered sequential load modulated balanced amplifier (W-SLMBA) that uses a continuous Class-F−1 control ...
Read more >
A Reactance Compensated Three-Device Doherty Power ...
This paper proposes a new broadband Doherty power amplifier topology with extended back-off range. A shunted short line or open line working as...
Read more >
Advanced Load Modulated Power Amplifier Architectures
Chapter 4 presents a new variant on the RF-input LMBA architecture, the Doherty-like load modulated balanced amplifier (D-LMBA). This architecture uses a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found