Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement to customElements.whenDefined() javascript example #36218

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

sidewayss
Copy link
Contributor

@sidewayss sidewayss commented Oct 6, 2024

The current example doesn't filter the list and creates more Promises than it needs to. new Set() seems like the best way to filter down to unique names.

btw - I noticed that Prettier broke my 80 character line const tags..., but not my 76 character line const promises.... Is the limit 79? I have a soft, personal limit of 80, partly as a tribute to the old Teletype printers. Is that the reason for the Prettier limit here? If so, 80 would be a better limit than 79 :-)

EDIT - now I see that it's the trailing comma added by Prettier that pushes it to 81 chars wide. I'm still not used to those trailing commas. My ESLint doesn't like them either...

@sidewayss sidewayss requested a review from a team as a code owner October 6, 2024 16:07
@sidewayss sidewayss requested review from wbamberg and removed request for a team October 6, 2024 16:07
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Oct 6, 2024
Copy link
Contributor

github-actions bot commented Oct 6, 2024

Preview URLs

(comment last updated: 2024-10-06 16:17:20)

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and yes Prettier is hard to tame. Luckily it doesn't depend on how you originally wrote your code at all, so you can rest assured that there's little you can do to make it print differently unless you change variable names.

@Josh-Cena Josh-Cena merged commit 0edb4db into mdn:main Oct 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants