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.

Simplify AMP/Bento Class Hierarchies

See original GitHub issue

Objectives

  1. Simplify the class hierarchies of AMP 1.0 and Bento Components
  2. Ensure proper layering of AMP/Bento s.t. the Bento side is devoid of AMP concepts

Current

  • AMP Hierarchy: AmpFitText.js > FitTextBaseElement > PreactBaseElement > AMP.BaseElement
  • Bento Hierarchy: FitTextBaseElement > PreactBaseElement > CeBaseElement

Proposed State

changes

  • We can remove CeBaseElement from Bento by extracting the CustomElement function and also moving all of the HTMLElement CE Mappings into PreactBaseElement.
  • We can extract all of the AMP-specific logic from PreactBaseElement into AMPPreactBaseElement.

new hierarchies

  • AMP Hierarchy: AmpFitText > AMPPreactBaseElement > setSuperClass(PreactBaseElement, AMP.BaseElement)
  • Bento Hierarchy: BentoFitText > PreactBaseElement

cc @alanorozco @kvchari @jridgewell

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
samouricommented, Dec 16, 2021

@kvchari: makes sense to me! Ridiculous number of layers on the AMP side of things, but I don’t see a way to avoid it. So it goes.

0reactions
samouricommented, Feb 8, 2022

Closing as the hierarchy has been solved. Remaining clarity improvements are being tracked by https://github.com/ampproject/amphtml/issues/37538

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lesson 6: Class Hierarchies - Studio Code.org
Lesson 6: Class Hierarchies. 45 minutes. Overview. How can I create hierarchies of classes to simplify program code? Students learned about inheritance ...
Read more >
[2112.01187] Computing Class Hierarchies from Classifiers
In this paper, we propose a novel algorithm for automatically acquiring a class hierarchy from a classifier which is often a large neural ......
Read more >
Simplifying complex class hierarchy - python - Stack Overflow
I.e., I can move some code to a different object but it needs to refer back to the big complex hierarchy to get...
Read more >
Simpler Kotlin class hierarchies using class delegation
This class can be mapped to a hierarchy, a different class can be chosen based on the value of the type field (it...
Read more >
Recovery of Class Hierarchies and Composition ...
Abstract. We present a reverse-engineering tool, called Lego, which recovers class hierarchies and composition relationships from stripped binaries.
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