the previous Go-based opengraph rendering made it difficult to handle dynamic content and was cumbersome to update when redesigning images. this moves rendering to a typescript/satori service on cloudflare workers, making design changes easier while offloading image processing from the main application.
+5
appview/config/config.go
+3
appview/issues/issues.go
+35
-229
appview/issues/opengraph.go
+5
appview/ogcard/.gitignore
-640
appview/ogcard/card.go
+117
appview/ogcard/client.go
+28
appview/ogcard/package.json
appview/ogcard/src/__tests__/assets/avatar.jpg
This is a binary file and will not be displayed.
+87
appview/ogcard/src/__tests__/fixtures.ts
+135
appview/ogcard/src/__tests__/render.test.ts
+54
appview/ogcard/src/components/cards/issue.tsx
+162
appview/ogcard/src/components/cards/pull-request.tsx
+61
appview/ogcard/src/components/cards/repository.tsx
+50
appview/ogcard/src/icons/lucide.tsx
+92
appview/ogcard/src/index.tsx
+35
appview/ogcard/src/lib/fonts.ts
+72
appview/ogcard/src/lib/render.ts
+67
appview/ogcard/src/validation.ts
+19
appview/ogcard/tsconfig.json
+17
appview/ogcard/wrangler.jsonc
+52
-268
appview/pulls/opengraph.go
+3
appview/pulls/pulls.go
+36
-327
appview/repo/opengraph.go
+3
appview/repo/repo.go
+20
-17
avatar/src/index.js
History
5 rounds
20 comments
expand 5 comments
i definitely see 42 changed files with +2214/-1481 on here! (you may be viewing an earlier round perhaps?)!
commit message is perfect, i do have some minor code change comments, but i am happy to handle that outside of this PR.
ah yes you're right, i didn't realize i was still on an earlier round! great, lmk if you need anything else :)
Not really related to this PR, but somehow Bun's lockfile is not collapsed by default. Maybe a bug in go-enry?
yup it is a known issue in enry!
23 commits
expand
collapse
replace local go-based card rendering with calls to an external
ogcard worker (cloudflare workers). this offloads image processing
and simplifies the main application code.
changes:
- remove local ogcard rendering code from appview/ogcard/card.go
- add ogcard client package for external worker communication
- update issues opengraph handler to use new client
- add format parameter support to avatar service (webp/jpeg/png)
- add OgcardConfig for worker host configuration
Replace local Go image rendering with HTTP calls to the remote TypeScript ogcard service. Add OgcardConfig for service URL configuration and extend the client to support repository, issue, and pull request card rendering.
knip helps find unused files, dependencies and exports in ts/js
projects. https://knip.dev/
expand 0 comments
5 commits
expand
collapse
replace local go-based card rendering with calls to an external
ogcard worker (cloudflare workers). this offloads image processing
and simplifies the main application code.
changes:
- remove local ogcard rendering code from appview/ogcard/card.go
- add ogcard client package for external worker communication
- update issues opengraph handler to use new client
- add format parameter support to avatar service (webp/jpeg/png)
- add OgcardConfig for worker host configuration
Replace local Go image rendering with HTTP calls to the remote TypeScript ogcard service. Add OgcardConfig for service URL configuration and extend the client to support repository, issue, and pull request card rendering.
expand 11 comments
appview/ogcard/src/index.tsx:85
I think that if we 500 out, we should not show the stack to the public, just as a security measure
appview/ogcard/wrangler.jsonc:6 is this subbed out at runtime?
appview/ogcard/.gitignore:2 bun huh? :P I think it would be nice to commit the lockfile in fact
appview/ogcard/src/components/shared/constants.ts:20-26 is this going to be used somewhere?
appview/ogcard/src/components/shared/language-circles.tsx:9 Another unused constant, or maybe ctrl+f on this PR page doesn't catch the full picture
appview/ogcard/src/components/shared/footer-stats.tsx:19 would be cool if we did conditional rendering here for the 0 reactions case so that people don't get sad that their repo has 0 reactions advertised so blatantly heh
appview/repo/opengraph.go:83 we don't have an updatedAt on git repos, do we...
appview/repo/opengraph.go:92 doesn't this just render the actual timestamp itself?
appview/ogcard/src/lib/render.ts:17 I'm not super familiar with cf workers but fetching inside a worker doesn't seem super nice. could we inline it? I also noticed that package.json has this at ^0.25.0 which would make a mismatch pretty quickly
appview/ogcard/src/lib/fonts.ts:19-21 more inlining opportunities
my only comment: can we squash the to 1 (and rebase on latest master perhaps)?
would be ripe if you could update the new commit to adhere to the commit guidelines, it would also need DCO.
don't pay attention to #3... it was uh... nothing feel free to take a look at the latest squashed commit, let me know your thoughts!
3 commits
expand
collapse
replace local go-based card rendering with calls to an external
ogcard worker (cloudflare workers). this offloads image processing
and simplifies the main application code.
changes:
- remove local ogcard rendering code from appview/ogcard/card.go
- add ogcard client package for external worker communication
- update issues opengraph handler to use new client
- add format parameter support to avatar service (webp/jpeg/png)
- add OgcardConfig for worker host configuration
Replace local Go image rendering with HTTP calls to the remote TypeScript ogcard service. Add OgcardConfig for service URL configuration and extend the client to support repository, issue, and pull request card rendering.
expand 2 comments
appview/ogcard/src/components/shared/logo.tsx:1
nit: this has been customized already, yes? :P
good catch 😸
3 commits
expand
collapse
replace local go-based card rendering with calls to an external
ogcard worker (cloudflare workers). this offloads image processing
and simplifies the main application code.
changes:
- remove local ogcard rendering code from appview/ogcard/card.go
- add ogcard client package for external worker communication
- update issues opengraph handler to use new client
- add format parameter support to avatar service (webp/jpeg/png)
- add OgcardConfig for worker host configuration
Replace local Go image rendering with HTTP calls to the remote TypeScript ogcard service. Add OgcardConfig for service URL configuration and extend the client to support repository, issue, and pull request card rendering.
for some reason the amount of files changed here (36) is lower than the amount of files changed on my fork (42).. any ideas?
0927d254it seems like this pr doesn't have the exact same content as my commit?