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

docs: customize image component #505

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

stephancill
Copy link
Contributor

Change Summary

  • Adds instructions for customizing the image component used in the frame rendering component.
  • Fixes syntax errors in render guides

Merge Checklist

  • PR has a Changeset
  • PR includes documentation if necessary
  • PR updates the boilerplates if necessary

Copy link

vercel bot commented Oct 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frames-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 3:33pm
framesjs-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 3:33pm
framesjs-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 3:33pm

Copy link
Contributor

@davidfurlong davidfurlong left a comment

Choose a reason for hiding this comment

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

this doesn't sanitize redirect uris & also doesn't incorporate the data uri changes into the default Image component in the lib (which it probably should)

docs/snippets/guides/apps/react-image-optimization.tsx Outdated Show resolved Hide resolved
docs/snippets/guides/apps/react-image-optimization.tsx Outdated Show resolved Hide resolved
onError={props.onImageLoadEnd}
alt="Frame image"
sizes="100vw"
height={0}
Copy link
Contributor

Choose a reason for hiding this comment

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

would add a todo implement comment with a quick example in comments of using the props to get the dimensions of the frame

Copy link
Contributor

Choose a reason for hiding this comment

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

@stephancill think you missed this

@@ -101,3 +101,11 @@ pnpm dev
### Done! 🎉

::::

## Using Next.js Image Optimization for image proxying
Copy link
Contributor

Choose a reason for hiding this comment

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

we should also include this in https://framesjs.org/guides/apps/display-frames-in-react-native

and also include a list of security properties here to check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

React native doesn't have a built-in image proxy - what should we suggest?

Copy link
Contributor

@davidfurlong davidfurlong Oct 8, 2024

Choose a reason for hiding this comment

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

would just make a comment that it's a suggestion for privacy reasons. People can always use a next.js image proxy for this and just handle it via a next.js endpoint like /proxy?img=[src]

let sanitizedSrc = props.src;

// Don't allow data URLs that are not images -- we don't want to allow arbitrary data to be loaded
if (props.src.startsWith("data:") && !props.src.startsWith("data:image")) {
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 include this in the default Image implementation @stephancill ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

opened a separate PR #506

@davidfurlong davidfurlong merged commit aec6a6d into dev Oct 8, 2024
6 checks passed
@davidfurlong davidfurlong deleted the docs/customize-image-component branch October 8, 2024 16:00
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