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 dynamic images as image size too large #619

Closed
wants to merge 15 commits into from
Closed

Conversation

mikewuu
Copy link
Contributor

@mikewuu mikewuu commented Apr 8, 2024

closes #616

This is a POC. We'll use Next.js' _next/image directly to get a dynamic image size.

Before

CleanShot 2024-04-08 at 14 37 47@2x

  • not sure why in dev the image sizes are pretty small

After

CleanShot 2024-04-08 at 14 38 04@2x

  • images replaced by webp as expected

Live storybook

https://react.seam.co/?path=/docs/components-devicetable--docs

I replaced the src attribute, and it's quite a big difference.

CleanShot 2024-04-08 at 14 41 33@2x

Copy link
Collaborator

@razor-x razor-x left a comment

Choose a reason for hiding this comment

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

Note this is a test branch to verify the solution. The optimized URLs will be returned from the API with no update needed to this project. Blocking to avoid accidental merge.

Currently, the images do not load with this change: https://react-ka4irjlds.seam.vc/examples/basic/

@mikewuu mikewuu marked this pull request as draft April 30, 2024 01:20
@mikewuu mikewuu marked this pull request as ready for review May 1, 2024 09:11
vercel.json Outdated
@@ -84,7 +84,7 @@
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; connect-src 'self' https://connect.getseam.com; img-src 'self' https://connect.getseam.com; font-src 'self' https://fonts.gstatic.com; style-src 'self' https://fonts.googleapis.com"
"value": "default-src 'self'; connect-src 'self' https://connect.getseam.com; img-src 'self' https://connect.getseam.com https://console.seam.co; font-src 'self' https://fonts.gstatic.com; style-src 'self' https://fonts.googleapis.com"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is going to be an issue. If we suddenly change image hosts we will break consumers using CSP.

This reverts commit db95a1b.
This reverts commit 6508e72.
This reverts commit 0149fd3.
This reverts commit 7b81aaa.
@mikewuu mikewuu marked this pull request as draft May 2, 2024 08:58
@mikewuu
Copy link
Contributor Author

mikewuu commented May 12, 2024

closing as handled via https://github.com/seamapi/seam-connect/pull/6866

@mikewuu mikewuu closed this May 12, 2024
@razor-x razor-x deleted the dynamic-images branch June 12, 2024 00:02
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.

Reduce size of images in Seam Components
3 participants