Skip to content

Conversation

@swarad07
Copy link

No description provided.

@netlify
Copy link

netlify bot commented Jan 15, 2025

Deploy Preview for axelerant-engg-handbook ready!

Name Link
🔨 Latest commit f839326
🔍 Latest deploy log https://app.netlify.com/sites/axelerant-engg-handbook/deploys/678744b346a4f9000835d88d
😎 Deploy Preview https://deploy-preview-233--axelerant-engg-handbook.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.

@swarad07 swarad07 changed the title Create html-loading-attribute ADR ADR - html-loading-attribute improved defaults Jan 15, 2025
Copy link
Member

@hussainweb hussainweb left a comment

Choose a reason for hiding this comment

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

@swarad07, please see my comments. @Kalaiselvan88, you might want to review this.

@@ -0,0 +1,32 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

@swarad07, the file is missing an extension. It doesn't get listed at all.

@@ -0,0 +1,32 @@
---
title: "Loading attribute in img and iframe HTML tags"
date: "2025-15-01"
Copy link
Member

Choose a reason for hiding this comment

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

The date is in the wrong format.

title: "Loading attribute in img and iframe HTML tags"
date: "2025-15-01"
decision: "Loading attribute should be added on all img and iframe tags and set to lazy"
status: "accepted"
Copy link
Member

Choose a reason for hiding this comment

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

Are you intentionally setting this to "accepted". Do we need to discuss this or is this something so obvious we don't need to discuss?

decision: "Loading attribute should be added on all img and iframe tags and set to lazy"
status: "accepted"
categories:
- HTML
Copy link
Member

Choose a reason for hiding this comment

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

Is HTML a good name for this category? Perhaps we can club all web technologies in one.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to above

## Decision

- We shall ensure every <img> and <iframe> tag has the `loading` attribute and it is set to `lazy`
- The `loading` attribute has a default value set to `eager` which loads the image immediately irrespective of whether they are in the viewport.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not load all the images on page load and opposite to lazy load? Should this value be rather lazy instead as per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#loading

Copy link
Contributor

Choose a reason for hiding this comment

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

I think above is conveyed in 1st point however having this line here is kind of confusing as if we are deciding to set the value to eager. Maybe this line can be in context rather?

- Improved page loading performance due to lazy loading of images.
- Reduced data usage.
- **Negative:**
- Changes to <img> and <iframe> component templates needed in the CMS, JS framework, and UX library kits whenever a new project is bootstrapped.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a caveat that we change codes that are within our control like custom code only considering this -ve?

- Reduced data usage.
- **Negative:**
- Changes to <img> and <iframe> component templates needed in the CMS, JS framework, and UX library kits whenever a new project is bootstrapped.
- It might not play well if JS libraries are used to handle image lazy loading for a smoother / animated UX, like skeletons.
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel it would be better to explain what is the negative consequences we expect and explain "play well" part

@Kalaiselvan88
Copy link
Contributor

Kalaiselvan88 commented Jan 20, 2025

@swarad07, please see my comments. @Kalaiselvan88, you might want to review this.

Added my comments as well in addition to existing ones. Also it would be good to refer https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#images_and_iframes for reference as well

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants