-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: various social image improvements #270
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
9ed1fe6
to
63efa31
Compare
63efa31
to
9298900
Compare
9298900
to
c7cc550
Compare
c7cc550
to
a14efbb
Compare
a14efbb
to
52e69e2
Compare
52e69e2
to
a63d9c3
Compare
a63d9c3
to
db2b453
Compare
db2b453
to
3b0c758
Compare
@@ -66,7 +66,7 @@ const Node = ({ data, icon, type }: { data: IData; icon: React.ReactNode; type: | |||
<div style={customNodeStyles} tw="flex-col"> | |||
<div | |||
tw={`flex w-full flex-col items-center justify-center px-2 ${ | |||
splitLabel[1] && splitLabel[1].length > 0 && "mt-[2px]" | |||
splitLabel[1] && splitLabel[1].length > 0 ? "mt-[2px]" : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused warnings in the logic because of an unknown tailwind utility called undefined
const shortLink = await redis.get<string>(getShortLinkPersistenceKey(params.id)); | ||
return NextResponse.redirect(shortLink || "/", { | ||
headers: { | ||
"Cache-Control": "public, max-age=3600, stale-while-revalidate=3600, stale-if-error=3600", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can actually cause issues without the correct Vary
response header. Hence caching is removed for this code path.
@@ -55,13 +54,14 @@ export async function POST(request: NextRequest): Promise<NextResponse> { | |||
); | |||
} | |||
|
|||
const uuid = crypto.randomUUID(); | |||
await redis.set(getShortLinkPersistenceKey(uuid), longURL); | |||
const id = crypto.createHash("sha1").update(longURL).digest("hex"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that there are fewer short link permutations for the same data.
# Why - There are some things I noticed after the review that we should clean up. - The ability to generate the image server-side is incredible. Folks can actually use this to link to the image from within documentation systems! # What - Expose the feature more prominently in the share dialog - Clean up the URL paths to make this easier to discover - Some cleanup
3b0c758
to
92c80c0
Compare
|
Why
What
Screenshots