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

Update twitter.mdx #158

Merged
merged 3 commits into from
Oct 27, 2024
Merged

Update twitter.mdx #158

merged 3 commits into from
Oct 27, 2024

Conversation

lin-stephanie
Copy link
Contributor

Maybe we should remove async to keep it consistent with the example at https://astro-embed.netlify.app/examples/tweet-with-js/, just like the Astro Docs - Script processing suggest.

Copy link

changeset-bot bot commented Oct 26, 2024

⚠️ No Changeset found

Latest commit: 1346c76

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@delucis
Copy link
Owner

delucis commented Oct 27, 2024

Thanks for the PR @lin-stephanie! In this case though async is important (we should probably add it to our examples 😁). As the Astro Docs section you linked says:

The async attribute is valuable for normal scripts because it prevents them from blocking rendering.

In this case the Twitter code is a “normal” (i.e. non-type="module" script), so it’s still advisable to include the async attribute.

Would you want to change this PR to add that attribute where needed?

@lin-stephanie
Copy link
Contributor Author

Thank you for the clarification! I now understand that widgets.js is a classic script, not a module. I’ve updated the examples to include the async. Is this change okay?

This comment was marked as duplicate.

Copy link

netlify bot commented Oct 27, 2024

Deploy Preview for astro-embed ready!

Name Link
🔨 Latest commit 1346c76
🔍 Latest deploy log https://app.netlify.com/sites/astro-embed/deploys/671e8f6ebf140500087fb72a
😎 Deploy Preview https://deploy-preview-158--astro-embed.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.

Copy link
Owner

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Looks great — thank you!

I also updated those two pages to include the async attribute on the actual <script> tags as well, not only in the code example. That way I could test they worked as expected and they do 🎉

@delucis delucis merged commit 36f2176 into delucis:main Oct 27, 2024
5 checks passed
@lin-stephanie lin-stephanie deleted the patch-1 branch October 28, 2024 02:52
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.

2 participants