ampproject / ampproject/amphtml
Bento: Can component builds remove `displayName`?
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
[Relevant thread.](https://github.com/ampproject/amphtml/pull/33852#discussion_r617593755)
This property on components appears to come from using `ForwardRef`... we only rely on the value in some unit tests. Can we safely remove it from the build?
Examples:
- `b.displayName="ForwardRef("+(a.displayName||a.name)+")"` in [`amp-fit-text:1.0`](https://cdn.ampproject.org/v0/amp-fit-text-1.0.js)
- `Xb.displayName="Instagram"` in [`amp-instagram:1.0`](https://cdn.ampproject.org/v0/amp-instagram-1.0.js)
Contributor guide
Research direction
Start with the linked discussion in pull request 33852 and compare the generated amp-fit-text and amp-instagram examples. Trace the component build step that emits displayName, then inspect the unit tests that rely on it. Done means confirming whether the property can be omitted without breaking those tests or component behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100