Skip to content

Add Warning in Docs about Lazy Loading and LCP#128

Merged
eportis-cloudinary merged 2 commits into
cloudinary-community:mainfrom
sccalabr:issue-9
Oct 10, 2025
Merged

Add Warning in Docs about Lazy Loading and LCP#128
eportis-cloudinary merged 2 commits into
cloudinary-community:mainfrom
sccalabr:issue-9

Conversation

@sccalabr
Copy link
Copy Markdown

@sccalabr sccalabr commented Oct 2, 2025

Description

Add Warning in Docs about Lazy Loading and LCP

Issue Ticket Number

Fixes #9

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Fix or improve the documentation
  • This change requires a documentation update

Checklist

  • I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
  • I have created an issue ticket for this PR
  • I have checked to ensure there aren't other open Pull Requests for the same update/change?
  • I have performed a self-review of my own code
  • I have run tests locally to ensure they all pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes needed to the documentation

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 2, 2025

@totesforlife is attempting to deploy a commit to the Cloudinary DevX Team on Vercel.

A member of the Team first needs to authorize it.

@sccalabr
Copy link
Copy Markdown
Author

sccalabr commented Oct 7, 2025

@eportis-cloudinary anything you want changed?

Copy link
Copy Markdown
Contributor

@eportis-cloudinary eportis-cloudinary left a comment

Choose a reason for hiding this comment

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

@sccalabr - thank you so much for taking the time to write this thoughtful guide and link to it from the appropriate places in the docs - this is great!

My biggest comment is that I don't think we should document fetchpriority and loading as props, because (as you mention) they are simply passed to the img element. Starting to document everything you could do with props that are "only" img attributes seems like a slippery slope, that I don't want to start going down. Their behavior is already well-documented elsewhere (like MDN).

So, I'm asking you to remove that section and table from the configuration page, and to remove a couple of other things that seemed "extra". Other than that, just minor niggles. The guide is really well written and the examples are great.

[Learn more about quality](https://cloudinary.com/documentation/transformation_reference#q_quality) on the Cloudinary docs. No newline at end of file
[Learn more about quality](https://cloudinary.com/documentation/transformation_reference#q_quality) on the Cloudinary docs.

## Performance & Loading
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See my note about removing this section and table. I don't think we should add documentation for "props" that are just being passed through to the img as attributes, without doing anything at the component level.


The basic props required to use CldImage include:

:::tip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding loading and fetchpriority to the list of props feels like a slippery slope that would end with adding all of the img attributes to these docs.

This tip is important and well placed, but can you link to the LCP and performance guide page, and remove the additions to the prop table?

width="<Width>"
height="<Height>"
alt="<Description>"
fetchpriority="high" <!-- This hurts performance! -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can't put an HTML comment inside an HTML element, unfortunately. Can you remove this and all instances of that in the examples?

```
</CodeBlock>

### 4. Use Cloudinary Optimizations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because we add f_auto and q_auto to URLs by default, I don't think we need this example, and it could actually confuse people who think they need to add the format and quality props, separately. Can you remove this section?

- [Measure LCP in JavaScript - web.dev](https://web.dev/articles/lcp#measure-lcp-in-javascript)
- [Core Web Vitals - web.dev](https://web.dev/articles/vitals)

## Comparison with Next.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know the comparison with NextJS is what led Colby to file the issue, but I think many folks will be coming to the Astro library (and docs) without NextJS experience. That makes this section superfluous for them. Can you remove it?

@eportis-cloudinary
Copy link
Copy Markdown
Contributor

I have some additional tweaks I'd like to make but will merge this and edit from there.

@sccalabr are you also @totesforlife? Should I credit both @sccalabr and @totesforlife for this PR?

Thanks again for the contribution!

@eportis-cloudinary eportis-cloudinary merged commit 9b6f9f4 into cloudinary-community:main Oct 10, 2025
1 check failed
@sccalabr
Copy link
Copy Markdown
Author

@eportis-cloudinary is the hacktoberfest form sent out at the end of the month

@devpatocld
Copy link
Copy Markdown

@sccalabr Can you please provide your email so I can send you the swag form? Thank you

@eportis-cloudinary
Copy link
Copy Markdown
Contributor

@allcontributors please add @sccalabr for docs

@allcontributors
Copy link
Copy Markdown
Contributor

@eportis-cloudinary

I've put up a pull request to add @sccalabr! 🎉

@devpatocld
Copy link
Copy Markdown

@sccalabr Thank you for your contribution to Hacktoberfest! As a token of our thanks, we at Cloudinary have emailed you with instructions on how to claim your bespoke 2025 swag pack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Warning in Docs about Lazy Loading and LCP

4 participants