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

fix: use proper feature detection in is-supported-example #423

Merged
merged 8 commits into from
Feb 14, 2024

Conversation

jeremiahlee
Copy link
Contributor

@jeremiahlee jeremiahlee commented Jan 11, 2024

Change wallet address to match other examples, removing the .js prefix which could be confusing.

Remove deprecated methods for detecting support of a feature in a user agent.

Remove DOM query in favor of faster temporary element creation.

Tangential issues:

  • Fixed local dev issues related to updating the spec now that Astro is used
  • Updated readme instructions to use the spec build script
  • Removed Prettier from spec build script, as it conflicts with W3C style for examples

Change wallet address to match other examples, removing the .js prefix which could be confusing.

Remove deprecated methods for detecting support of a feature in a user agent.

Remove DOM query in favor of faster temporary element creation.
Copy link

netlify bot commented Jan 11, 2024

Deploy Preview for webmonetization-preview ready!

Name Link
🔨 Latest commit f7ddc6e
🔍 Latest deploy log https://app.netlify.com/sites/webmonetization-preview/deploys/65cc215790bc60000824c100
😎 Deploy Preview https://deploy-preview-423--webmonetization-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

const link =
document.querySelector('link[rel="monetization"]') ||
document.createElement('link')
if (link.relList.supports('monetization')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This example always bugged me - 3 lines logged

@@ -117,12 +117,9 @@ <h3>
Checking if Web Monetization is supported
</h3>
<p>
There are multiple ways to check if Web Monetization is supported.
Copy link
Collaborator

Choose a reason for hiding this comment

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

iirc ?? this file is generated, so you'll want to edit the base file, and then run the respec.sh command

Copy link
Collaborator

Choose a reason for hiding this comment

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

Prettier was changing the examples to its preferences. The specification should be consistent with other W3C standards' style.

https://www.w3.org/community/webed/wiki/Web_Education_community_group_style_guide#Code_standards

https://www.w3.org/wiki/Coding_style
The previous instructions did not work after the conversion to Astro, as Astro corrupts the includes and breaks the examples.
style: disable Prettier in the respec build script
docs: update spec local dev instructions to use the build script
@huijing huijing merged commit e7ea565 into WICG:main Feb 14, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants