Skip to content

feat: add frames.js:version meta tag to frame response - #302

Merged
stephancill merged 7 commits into
devfrom
feat/framesjs-version-metatag
Apr 15, 2024
Merged

feat: add frames.js:version meta tag to frame response#302
stephancill merged 7 commits into
devfrom
feat/framesjs-version-metatag

Conversation

@stephancill

@stephancill stephancill commented Apr 9, 2024

Copy link
Copy Markdown
Contributor

Change Summary

  • Adds a framesjs:version meta tag with the version in package.json to getFrameFlattened
  • Refactors getFrameHtmlHead to use getFrameFlattened

Todo:

  • Update snapshots in tests
  • Find a way to handle bumping version

Merge Checklist

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

@vercel

vercel Bot commented Apr 9, 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 15, 2024 7:54am
framesjs-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 7:54am

: {};

const metadata: FrameFlattened = {
[`og:image`]: frame.ogImage || frame.image,

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.

this might interfere with the generateMetadata's openGraph fields... #302

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.

Nope, there is no problem with that.

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.

Do you know how it behaves when other["og:image"] and openGraph["images"] is specified?

https://nextjs.org/docs/app/api-reference/functions/generate-metadata#opengraph

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.

I didn't try how it works if you use both, but it works when you supply og:image to other as well. I believe that when you do that it will overwrite the value in openGraph but I haven't tried.

In my opinion openGraph is there just to make it more convenient for developers and add some type hints.

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.

I think it should be really easy to try it locally with both and see how it works.

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.

yeah will do

Comment thread packages/frames.js/src/getFrameFlattened.ts
Comment thread package.json Outdated
@stephancill
stephancill merged commit 5317d0c into dev Apr 15, 2024
@stephancill
stephancill deleted the feat/framesjs-version-metatag branch April 15, 2024 11:51
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: 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
stephancill added a commit that referenced this pull request Apr 16, 2024
* 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
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