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

[example] More expansive device detection and not load hidden imaged #38

Merged
merged 3 commits into from Dec 1, 2018

Conversation

alloy
Copy link
Collaborator

@alloy alloy commented Nov 30, 2018

A little bit of this, a little bit of that.

Probably easiest to review per commit.

dont-load-hidden-images

}}
/>
</span>
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All of this is to automatically size the container according to the actual aspect ratio. In cases the width and height are fixed this shouldn’t be necessary.

aspectRatio={1.261044176706827}
src="https://d32dm0rphc51dk.cloudfront.net/JAo7pAN1p63YwolybeZgOg/small.jpg"
style={{ width: "100px" }}
/>
Copy link
Member

Choose a reason for hiding this comment

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

How does this translate to Reaction and other consumers? What will be required on the app side of things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the most extreme version imaginable, I don’t believe we have any place on Artsy where the size of the image isn’t constrained along at least one axis. The important part is using background-image to display the image, as only when CSS is in control will the display value have any effect on whether or not the image will be downloaded.

Copy link
Member

@damassi damassi Nov 30, 2018

Choose a reason for hiding this comment

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

I guess what I'm wondering is is there's anything we have to change in our codebase -- modify all images to use a background image rather than img src or swap all call-sites to use a new component?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Gotcha. Yeah I think we’d have an Image component, that abstracts whatever we need away, and then do a img -> Image pass.

@alloy alloy changed the title [example] More expansive device detection and not load hidden imaged [FEATURE example] More expansive device detection and not load hidden imaged Dec 1, 2018
@alloy alloy changed the title [FEATURE example] More expansive device detection and not load hidden imaged [example] More expansive device detection and not load hidden imaged Dec 1, 2018
@alloy
Copy link
Collaborator Author

alloy commented Dec 1, 2018

I'm going to merge this so I can start work to detect devices in Reaction. The discussion about the image loading should still continue, though!

@alloy alloy merged commit 31f6506 into master Dec 1, 2018
@alloy alloy deleted the more-expansive-device-detection-for-example branch December 1, 2018 09:23
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.

None yet

3 participants