Skip to content

feat: image rendering worker - #296

Merged
stephancill merged 7 commits into
devfrom
feat/image-rendering-worker
Apr 9, 2024
Merged

feat: image rendering worker#296
stephancill merged 7 commits into
devfrom
feat/image-rendering-worker

Conversation

@stephancill

@stephancill stephancill commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

Change Summary

Adds image rendering worker middleware which allows images to be rendered asynchronously and resolves image data URI size limitation issues.

Todo

  • Tests
  • Refactor image worker endpoint into frames.js
  • Authenticated payloads to prevent abuse by third parties

Merge Checklist

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

@vercel

vercel Bot commented Apr 5, 2024

Copy link
Copy Markdown

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 Apr 9, 2024 2:16pm
framesjs-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:16pm

Comment thread docs/pages/middleware/images-worker.mdx Outdated
export const frames = createFrames({
// ...
middleware: [ // [!code focus]
ImagesWorker.imagesWorker({ // [!code focus]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this part correct? Where does ImagesWorker come from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

typo, fixed

@@ -0,0 +1 @@
export * from "./imagesWorker";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why this file doesn't contain the contents of the exported file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what do you mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -0,0 +1 @@
export * from "./createImagesWorker";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here, this file could contain the code of createImagesWorker.tsx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh okay i see what you mean. will update

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@stephancill
stephancill merged commit 427d1cd into dev Apr 9, 2024
@stephancill
stephancill deleted the feat/image-rendering-worker branch April 9, 2024 14:22
stephancill added a commit that referenced this pull request Apr 12, 2024
* chore: move starters to templates (#300)

* chore: move utils starter completely to templates

* fix: utils starter is esm module, fix config

* fix: use also FARCASTER_DEVELOPER_FID env variable in debugger bin

* chore: remove unused command

* chore: move starter to templates

* chore: changeset

* chore: update docs

* chore: changeset

* fix: typo

* chore: add readme

* feat: image rendering worker (#296)

* feat: images worker middleware

* feat: signatures, createImagesWorker

* fix: types

* fix: docs typo

* fix: docs dead links

* fix: docs typo

* fix: index exports

* fix: escape user provided HTML attribute values (#306)

* fix: next.js generateMetadata example code (#305)

---------

Co-authored-by: Michal Kvasničák <michal.kvasnicak@gmail.com>
Co-authored-by: Jereld Lim <jereldlimjy@hotmail.com>
stephancill added a commit that referenced this pull request Apr 15, 2024
* chore: move starters to templates (#300)

* chore: move utils starter completely to templates

* fix: utils starter is esm module, fix config

* fix: use also FARCASTER_DEVELOPER_FID env variable in debugger bin

* chore: remove unused command

* chore: move starter to templates

* chore: changeset

* chore: update docs

* chore: changeset

* fix: typo

* chore: add readme

* feat: image rendering worker (#296)

* feat: images worker middleware

* feat: signatures, createImagesWorker

* fix: types

* fix: docs typo

* fix: docs dead links

* fix: docs typo

* fix: index exports

* fix: escape user provided HTML attribute values (#306)

* fix: next.js generateMetadata example code (#305)

* fix: cloudflare worker template start command (#308)

* fix: lock next version, move react do production dependencies (#309)

* feat: add frames.js:version meta tag to frame response (#302)

* feat: add frames.js:version meta tag to frame response

* chore: update snapshots

* fix: add og:image to required properties, matching spec

* fix: type checking

* fix: rebuild frames.js after version bump

* feat: add a test to check parsing of html escaped characters in getFrame

* fix: publish-packages script

---------

Co-authored-by: Michal Kvasničák <michal.kvasnicak@gmail.com>
Co-authored-by: Jereld Lim <jereldlimjy@hotmail.com>
stephancill added a commit that referenced this pull request Apr 16, 2024
* feat: images worker middleware

* feat: signatures, createImagesWorker

* fix: types

* fix: docs typo

* fix: docs dead links

* fix: docs typo

* fix: index exports
stephancill added a commit that referenced this pull request Apr 16, 2024
* feat: images worker middleware

* feat: signatures, createImagesWorker

* fix: types

* fix: docs typo

* fix: docs dead links

* fix: docs typo

* fix: index exports
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