Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

stash changes

Steven Tey93798c83056d
diff --git a/app/ui/home/testimonials-mobile.tsx b/app/ui/home/testimonials-mobile.tsx
index 68c66933ae..82a1570bc7 100644
--- a/app/ui/home/testimonials-mobile.tsx
+++ b/app/ui/home/testimonials-mobile.tsx
@@ -1,6 +1,6 @@
"use client";
-import Tweet from "#/ui/tweet";
+import { Tweet } from "react-tweet";
import { useRef, useState } from "react";
export default function TestimonialsMobile({ tweets }: { tweets: any[] }) {
@@ -11,7 +11,7 @@ export default function TestimonialsMobile({ tweets }: { tweets: any[] }) {
<div className="flex flex-col justify-center space-y-4 pt-8 sm:hidden">
<div ref={ref} className="space-y-6">
{tweets.slice(0, expanded ? undefined : 4).map((tweet, idx) => (
- <Tweet key={idx} metadata={JSON.stringify(tweet)} noTilt />
+ <Tweet key={idx} id={tweet} />
))}
</div>
{!expanded && (
diff --git a/app/ui/home/testimonials.tsx b/app/ui/home/testimonials.tsx
index 76eb15b991..3c47f308c8 100644
--- a/app/ui/home/testimonials.tsx
+++ b/app/ui/home/testimonials.tsx
@@ -1,10 +1,27 @@
import { unstable_cache } from "next/cache";
import prisma from "#/lib/prisma";
import { nFormatter } from "#/lib/utils";
-import getTweets, { homepageTweets } from "#/lib/twitter";
import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
-import Tweet from "#/ui/tweet";
import TestimonialsMobile from "./testimonials-mobile";
+import Tweet from "#/ui/tweet";
+import { getTweet } from "react-tweet/api";
+
+const tweets = [
+ "1574639172605816832",
+ "1631671657617059842",
+ "1573744854655533069",
+ "1644155001034657792",
+
+ "1586745532386578433",
+ "1582956754425421825",
+ "1657473320957227010",
+ "1646599529796456469",
+
+ "1632125000386854912",
+ "1581017931043196928",
+ "1643814463131332609",
+ "1636708209057746945",
+];
export default async function Testimonials() {
const userCount = await unstable_cache(
@@ -16,7 +33,8 @@ export default async function Testimonials() {
revalidate: 300,
},
)();
- const tweets = await getTweets(homepageTweets);
+
+ const tweetsData = await Promise.all(tweets.map((id) => getTweet(id)));
return (
<MaxWidthWrapper className="pt-20">
@@ -33,18 +51,18 @@ export default async function Testimonials() {
</div>
<TestimonialsMobile tweets={tweets} />
<div className="hidden space-y-6 py-8 sm:block sm:columns-2 sm:gap-6 xl:columns-3">
- {tweets.filter(Boolean).map((tweet, idx) => (
+ {tweetsData.filter(Boolean).map((tweet, idx) => (
<Tweet
key={idx}
- metadata={JSON.stringify(tweet)}
- className={
- // this is a bit hacky but it allows us to have a 3-column mosaic layout on desktop
- // it basically says "if the card is NOT in the middle column, push it down by 4rem
- idx < Math.floor(tweets.length / 3) ||
- idx >= Math.floor(tweets.length / 3) * 2
- ? "relative lg:top-16"
- : ""
- }
+ data={tweet || null}
+ // className={
+ // // this is a bit hacky but it allows us to have a 3-column mosaic layout on desktop
+ // // it basically says "if the card is NOT in the middle column, push it down by 4rem
+ // idx < Math.floor(tweets.length / 3) ||
+ // idx >= Math.floor(tweets.length / 3) * 2
+ // ? "relative lg:top-16"
+ // : ""
+ // }
/>
))}
</div>
diff --git a/app/ui/tweet.tsx b/app/ui/tweet.tsx
index 40ebcf44b3..5b49fc120b 100644
--- a/app/ui/tweet.tsx
+++ b/app/ui/tweet.tsx
@@ -4,34 +4,18 @@ import BlurImage from "#/ui/blur-image";
import { nFormatter, truncate } from "#/lib/utils";
import { Heart, Message, Repeat, Twitter } from "@/components/shared/icons";
import Tilt from "react-parallax-tilt";
-
-function getRemainingTime(ISOString: Date) {
- const currentTime = new Date();
- const endTime = new Date(ISOString);
- const diff = endTime.getTime() - currentTime.getTime();
- if (diff > 36e5 * 24) {
- const days = Math.floor(diff / (36e5 * 24));
- const hours = Math.floor((diff - days * 36e5 * 24) / 36e5);
- return `${days} day${days > 1 ? "s" : ""} ${hours} hours`;
- } else if (diff > 36e5) {
- return `${Math.floor(diff / 36e5)} hours`;
- } else if (diff > 60e3) {
- return `${Math.floor(diff / 60e3)} minutes`;
- } else {
- return "Less than a minute";
- }
-}
+import { Tweet } from "react-tweet/api";
export default function Tweet({
- metadata,
+ data,
className,
noTilt,
}: {
- metadata: any;
+ data: Tweet | null;
className?: string;
noTilt?: boolean;
}) {
- if (!metadata || metadata === "null") {
+ if (!data) {
return (
<div
className={`${className} prose flex h-[20rem] break-inside-avoid items-center rounded-lg border border-gray-300 bg-white/20 bg-clip-padding p-6 pb-4 text-center text-sm backdrop-blur-lg backdrop-filter`}
@@ -47,24 +31,21 @@ export default function Tweet({
);
}
- const parsedMetadata = JSON.parse(metadata.replace(/\n/g, "\\n"));
-
- const id = parsedMetadata.id;
- const text = parsedMetadata.text;
- const author = parsedMetadata.author;
- const media = parsedMetadata.media;
- const video = parsedMetadata.video;
- const polls = parsedMetadata.polls;
- const url_meta = parsedMetadata.url_meta;
- const created_at = parsedMetadata.created_at;
- const public_metrics = parsedMetadata.public_metrics;
- const referenced_tweets = parsedMetadata.referenced_tweets;
+ const {
+ id_str: id,
+ text,
+ user: author,
+ photos: media,
+ favorite_count,
+ conversation_count,
+ created_at,
+ } = data;
- const authorUrl = `https://twitter.com/${author.username}`;
+ const authorUrl = `https://twitter.com/${author.screen_name}`;
const likeUrl = `https://twitter.com/intent/like?tweet_id=${id}`;
const retweetUrl = `https://twitter.com/intent/retweet?tweet_id=${id}`;
const replyUrl = `https://twitter.com/intent/tweet?in_reply_to=${id}`;
- const tweetUrl = `https://twitter.com/${author.username}/status/${id}`;
+ const tweetUrl = `https://twitter.com/${author.screen_name}/status/${id}`;
const createdAt = new Date(created_at);
const formattedText = text
@@ -97,12 +78,6 @@ export default function Tweet({
)}" target="_blank">${match}</a>`;
});
- const quoteTweet =
- referenced_tweets && referenced_tweets.find((t) => t.type === "quoted");
-
- const repliedTo =
- referenced_tweets && referenced_tweets.find((t) => t.type === "replied_to");
-
const TweetBody = (
<div
className={`${
@@ -115,10 +90,10 @@ export default function Tweet({
<div className="flex items-center space-x-2">
<a href={authorUrl} target="_blank" rel="noreferrer">
<BlurImage
- alt={author.username}
+ alt={author.screen_name}
height={48}
width={48}
- src={author.profile_image_url}
+ src={author.profile_image_url_https}
className="h-10 w-10 overflow-hidden rounded-full border border-transparent transition-all ease-in-out hover:scale-105 hover:border-gray-200 hover:shadow-md"
/>
</a>
@@ -149,7 +124,7 @@ export default function Tweet({
rel="noreferrer"
className="text-sm text-gray-500 transition-all duration-75 hover:text-gray-900"
>
- @{truncate(author.username, 16)}
+ @{truncate(author.screen_name, 16)}
</a>
<p>·</p>
<a
@@ -171,18 +146,6 @@ export default function Tweet({
<Twitter className="h-5 w-5 text-[#3BA9EE] transition-all ease-in-out hover:scale-105" />
</a>
</div>
- {repliedTo && repliedTo.username && (
- <div className="mt-5 text-base text-gray-500">
- Replying to{" "}
- <a
- className="text-[#1da1f2] no-underline"
- href={`https://twitter.com/${repliedTo.author.username}`}
- target="_blank"
- >
- @{repliedTo.author.username}
- </a>
- </div>
- )}
<div
className="mb-2 mt-4 truncate whitespace-pre-wrap text-[15px] text-gray-700"
dangerouslySetInnerHTML={{ __html: formattedText }}
@@ -190,7 +153,7 @@ export default function Tweet({
</div>
{/* Images, Preview images, videos, polls, etc. */}
- <div className="-mb-2 mt-3">
+ <div className="my-3">
{media && media.length ? (
<div
className={
@@ -200,139 +163,19 @@ export default function Tweet({
}
>
{media.map((m) => (
- <a key={m.media_key} href={tweetUrl} target="_blank">
- {m.type == "video" || m.type == "animated_gif" ? (
- video ? (
- <video
- className="rounded-lg border border-gray-200 drop-shadow-sm"
- loop
- width="2048px"
- height="2048px"
- autoPlay
- muted
- playsInline
- >
- <source src={video.url} type="video/mp4" />
- Your browser does not support the video tag.
- </video>
- ) : (
- <BlurImage
- key={m.media_key}
- alt={text}
- width={2048}
- height={m.height * (2048 / m.width)}
- src={m.preview_image_url}
- className="rounded-lg border border-gray-200 drop-shadow-sm"
- />
- )
- ) : (
- <BlurImage
- key={m.media_key}
- alt={text}
- width={2048}
- height={m.height * (2048 / m.width)}
- src={m.url}
- className="rounded-lg border border-gray-200 drop-shadow-sm"
- />
- )}
+ <a key={m.url} href={tweetUrl} target="_blank">
+ <BlurImage
+ key={m.url}
+ alt={text}
+ width={2048}
+ height={m.height * (2048 / m.width)}
+ src={m.url}
+ className="rounded-lg border border-gray-200 drop-shadow-sm"
+ />
</a>
))}
</div>
) : null}
- {url_meta?.images ? (
- <a href={url_meta.unwound_url} target="_blank" rel="noreferrer">
- <div className="overflow-hidden rounded-lg border border-gray-200 drop-shadow-sm">
- <BlurImage
- key={url_meta.unwound_url}
- alt={url_meta.title}
- width={2048}
- height={1000}
- src={url_meta.images[0].url}
- className="h-40 object-cover"
- />
- <div className="w-full bg-white p-3">
- <p className="line-clamp-1 text-sm font-semibold">
- {url_meta.title}
- </p>
- <p className="line-clamp-2 text-sm text-gray-500">
- {url_meta.description}
- </p>
- </div>
- </div>
- </a>
- ) : null}
- {polls && (
- <div className="mt-5">
- {polls.map((poll) => {
- poll.total_votes = poll.options.reduce(
- (sum, option) => sum + option.votes,
- 0,
- );
- return poll.voting_status == "open" ? (
- <div key={poll.end_datetime}>
- {poll.options.map((option) => (
- <a
- key={option.label}
- href={tweetUrl}
- target="_blank"
- className="no-underline"
- >
- <div className="my-2 rounded-3xl border border-[#1da1f2] text-center font-bold text-[#1da1f2] transition-all duration-150 ease-in-out hover:bg-[#1da1f2] hover:bg-opacity-10">
- {option.label}
- </div>
- </a>
- ))}
- <div className="mt-4 text-base text-gray-500">
- {poll.total_votes} votes ·{" "}
- {getRemainingTime(poll.end_datetime)} left
- </div>
- </div>
- ) : (
- <div key={poll.end_datetime}>
- {poll.options.map((option) => (
- <div
- key={option.label}
- className={`
- ${
- option.position == 1 ? "font-bold" : ""
- } relative my-2 flex cursor-pointer justify-between whitespace-nowrap px-3 text-black
- `}
- >
- <p className="z-10 my-0">{option.label}</p>
- <p className="z-10 my-0">{`${(
- (option.votes / poll.total_votes) *
- 100
- )
- .toFixed(1)
- .replace(".0", "")}%`}</p>
- <div
- className={`
- ${
- option.position == 1
- ? "bg-[#1da1f2] font-bold"
- : "bg-gray-300"
- }
- absolute left-0 top-0 h-full w-full rounded-md
- `}
- style={{
- width: `${Math.round(
- (option.votes / poll.total_votes) * 100,
- )}%`,
- }}
- />
- </div>
- ))}
- <div className="mt-4 text-base text-gray-500">
- {poll.total_votes} votes · Final results
- </div>
- </div>
- );
- })}
- </div>
- )}
- {quoteTweet && quoteTweet.author && (
- <Tweet metadata={JSON.stringify(quoteTweet)} />
- )}
</div>
<div className="flex justify-center space-x-8 text-sm text-gray-500">
@@ -343,7 +186,7 @@ export default function Tweet({
rel="noreferrer"
>
<Heart className="h-4 w-4 group-hover:fill-red-600" />
- <p>{nFormatter(public_metrics.like_count)}</p>
+ <p>{nFormatter(favorite_count)}</p>
</a>
<a
className="flex items-center space-x-3 hover:text-green-600"
@@ -352,7 +195,7 @@ export default function Tweet({
rel="noreferrer"
>
<Repeat className="h-4 w-4" />
- <p>{nFormatter(public_metrics.retweet_count)}</p>
+ <p>{nFormatter(favorite_count)}</p>
</a>
<a
@@ -362,7 +205,7 @@ export default function Tweet({
rel="noreferrer"
>
<Message className="h-4 w-4 group-hover:fill-blue-600" />
- <p>{nFormatter(public_metrics.reply_count)}</p>
+ <p>{nFormatter(conversation_count)}</p>
</a>
</div>
</div>
diff --git a/lib/twitter/get-tweet.ts b/lib/twitter/get-tweet.ts
deleted file mode 100644
index 6612dad18c..0000000000
--- a/lib/twitter/get-tweet.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import { getTwitterMedia } from "./twitter-media";
-
-const queryParams = new URLSearchParams({
- expansions:
- "author_id,attachments.media_keys,referenced_tweets.id,referenced_tweets.id.author_id,attachments.poll_ids",
- "tweet.fields":
- "attachments,author_id,public_metrics,created_at,id,in_reply_to_user_id,referenced_tweets,text,entities",
- "user.fields": "id,name,profile_image_url,protected,url,username,verified",
- "media.fields":
- "duration_ms,height,media_key,preview_image_url,type,url,width,public_metrics",
- "poll.fields": "duration_minutes,end_datetime,id,options,voting_status",
-}).toString();
-
-export const getTweet = async (id: string) => {
- try {
- const response = await fetch(
- `https://api.twitter.com/2/tweets/${id}?${queryParams}`,
- {
- headers: {
- Authorization: `Bearer ${process.env.TWITTER_AUTH_TOKEN}`,
- },
- next: {
- revalidate: 604800, // revalidate every 1 week
- },
- },
- );
- const tweet = await response.json();
-
- if (!tweet.data)
- throw new Error(`Failed to get tweet data for tweet ID: ${id}`);
-
- const getAuthorInfo = (author_id: string) =>
- tweet.includes.users.find((user) => user.id === author_id);
-
- const getReferencedTweets = (mainTweet) =>
- mainTweet?.referenced_tweets?.map((referencedTweet) => {
- const fullReferencedTweet = tweet.includes.tweets?.find(
- (tweet) => tweet.id === referencedTweet.id,
- );
- if (!fullReferencedTweet)
- throw new Error(
- `Failed to find full tweet from referenced tweet ID: ${referencedTweet.id}`,
- );
-
- return {
- type: referencedTweet.type,
- ...fullReferencedTweet,
- };
- }) || [];
-
- // Function to distinguish between external URLs and external t.co links and internal t.co links
- // (e.g. images, videos, gifs, quote tweets) and remove/replace them accordingly
-
- if (tweet.data) tweet.data.text = getExternalUrls(tweet?.data); // removing/replacing t.co links for main tweet
- tweet?.includes?.tweets?.map((twt) => {
- // removing/replacing t.co links for referenced tweets
- twt.text = getExternalUrls(twt);
- });
-
- const media = tweet.data?.attachments?.media_keys?.map((key) =>
- tweet.includes.media?.find((media) => media.media_key === key),
- );
-
- const referenced_tweets = getReferencedTweets(tweet.data);
-
- return {
- ...tweet.data,
- author: getAuthorInfo(tweet.data?.author_id),
- media: media || [],
- polls: tweet?.includes?.polls || [],
- referenced_tweets: referenced_tweets,
- url_meta:
- media || referenced_tweets.length > 0 || !tweet.data?.entities?.urls
- ? null
- : tweet.data?.entities?.urls.at(-1), // take the last unfurled URL in the tweet (similar to Twitter's behavior)
- video:
- media &&
- media[0] &&
- (media[0].type === "video" || media[0].type === "animated_gif")
- ? await getTwitterMedia(id)
- : null,
- };
- } catch (error) {
- return null;
- }
-};
-
-function getExternalUrls(tweet) {
- const externalURLs = tweet?.entities?.urls;
-
- let mappings: {
- [I in string]: string;
- } = {};
-
- if (externalURLs)
- externalURLs.map((url) => {
- mappings[url.url] =
- !url.display_url.startsWith("pic.twitter.com") &&
- !url.display_url.startsWith("twitter.com")
- ? url.expanded_url
- : "";
- });
-
- let processedText = tweet?.text;
- Object.entries(mappings).map(([key, value]) => {
- processedText = processedText.replace(key, value);
- });
-
- return processedText;
-}
diff --git a/lib/twitter/index.ts b/lib/twitter/index.ts
deleted file mode 100644
index e0ab4d064f..0000000000
--- a/lib/twitter/index.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getTweet } from "./get-tweet";
-
-export default function getTweets(ids: string[]) {
- return Promise.all(ids.map((id) => getTweet(id)));
-}
-
-export const homepageTweets = [
- "1574639172605816832",
- "1631671657617059842",
- "1573744854655533069",
- "1644155001034657792",
-
- "1586745532386578433",
- "1582956754425421825",
- "1657473320957227010",
- "1646599529796456469",
-
- "1632125000386854912",
- "1581017931043196928",
- "1643814463131332609",
- "1636708209057746945",
-];
diff --git a/lib/twitter/twitter-media.ts b/lib/twitter/twitter-media.ts
deleted file mode 100644
index 76633e2e17..0000000000
--- a/lib/twitter/twitter-media.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-export const getTwitterMedia = async (id: string) => {
- try {
- const response = await fetch(
- `https://api.twitter.com/1.1/statuses/show.json?id=${id}&tweet_mode=extended`,
- {
- headers: {
- Authorization: `Bearer ${process.env.TWITTER_AUTH_TOKEN}`,
- },
- },
- );
- const data = await response.json();
- const videoData = data.extended_entities.media[0].video_info;
-
- // filter for only MP4 videos
- const mp4VideosOnly = videoData?.variants?.filter(
- (variant) => variant.content_type === "video/mp4",
- );
-
- // get the video with the best bitrate
- const bestVideoBitrate = mp4VideosOnly.reduce(function (prev, current) {
- return prev.bitrate > current.bitrate ? prev : current;
- });
-
- return bestVideoBitrate;
- } catch (error) {
- console.log(id, error);
- }
-};
diff --git a/package.json b/package.json
index 0ec96a2e01..dbe4f2ec0e 100644
--- a/package.json
+++ b/package.json
@@ -68,6 +68,7 @@
"react-parallax-tilt": "^1.7.70",
"react-spring": "^9.5.5",
"react-textarea-autosize": "^8.4.0",
+ "react-tweet": "^2.0.2",
"rehype-autolink-headings": "^6.1.1",
"rehype-pretty-code": "^0.9.5",
"rehype-slug": "^5.1.0",
diff --git a/yarn.lock b/yarn.lock
index caba74be99..5c1d640e59 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2015,7 +2015,7 @@
resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.44.1.tgz#376fdbed2b394c84deaa2041b8029b97e7eab3a7"
integrity sha512-DKj3U6tS+sCNsSXsoZbOl5gDrAVD3cAZ9QCiVSykLC3iJo085kkmw/3BAACRH54Bq2bN34yySuH6G1SLh2xHXA==
+"@swc/[email protected]", "@swc/helpers@^0.4.14":
version "0.4.14"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74"
integrity sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==
@@ -3766,7 +3766,7 @@ data-uri-to-buffer@^4.0.0:
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e"
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==
-date-fns@^2.29.3:
+date-fns@^2.29.3, date-fns@^2.9.0:
version "2.30.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0"
integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==
@@ -8034,6 +8034,16 @@ react-tiny-popover@^7.1.0:
resolved "https://registry.yarnpkg.com/react-tiny-popover/-/react-tiny-popover-7.2.0.tgz#e6277620efea6acea9c47efbfe5dcb473a552e99"
integrity sha512-AIliRDqTFB1+qy4GvWn+8B8JPKA13xtESWYdFkrdCeI8hEnPKufBvcF9a3dO/0SmD21mV6721xxhAnUm8TRXJw==
+react-tweet@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/react-tweet/-/react-tweet-2.0.2.tgz#dbe6da92ce78fdbc44be207263113ba7f7396775"
+ integrity sha512-cTyExNUHyWHiUZ2Uuted2/b4ePClOe6q3cyQklP5qZrpiAldnQhXzA7dYBO5pPtg09uoriG+LZxqauZ2Yd/Rqw==
+ dependencies:
+ "@swc/helpers" "^0.4.14"
+ clsx "^1.2.1"
+ date-fns "^2.9.0"
+ swr "^2.1.0"
+
react-use-measure@^2.0.4:
version "2.1.1"
resolved "https://registry.yarnpkg.com/react-use-measure/-/react-use-measure-2.1.1.tgz#5824537f4ee01c9469c45d5f7a8446177c6cc4ba"
@@ -8786,6 +8796,13 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+swr@^2.1.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.0.tgz#575c6ac1bec087847f4c86a39ccbc0043c834d6a"
+ integrity sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==
+ dependencies:
+ use-sync-external-store "^1.2.0"
+
swr@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/swr/-/swr-2.1.5.tgz#688effa719c03f6d35c66decbb0f8e79c7190399"