Skip to content

Commit

Permalink
🚀 chore(package.json): update styled-components to version 6.0.4 and …
Browse files Browse the repository at this point in the history
…prettier to version 2.8.8 for compatibility and bug fixes

🐛 fix(route.ts): import revalidateTag from next/cache to fix missing revalidateTag function
🔥 refactor(page.tsx): remove unused import of PostHeader component
🔧 chore(page.tsx): update createClient options to include tags and cache options based on environment variables for better caching and revalidation strategy
🔧 chore(Map.tsx): remove console.log statement
  • Loading branch information
Rafael Paz committed Jul 15, 2023
1 parent c12d421 commit 358e087
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"recompose": "^0.30.0",
"sass": "^1.62.1",
"sharp": "^0.32.1",
"styled-components": "^6.0.0-rc.1",
"styled-components": "^6.0.4",
"tailwind-merge": "^1.13.2",
"use-count-up": "^3.0.1",
"yet-another-react-lightbox": "^3.11.3",
Expand Down Expand Up @@ -88,7 +88,7 @@
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-react": "^7.32.2",
"postcss": "^8.4.23",
"prettier": "^3.0.0",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.4.1",
"pretty-quick": "^3.1.3",
"prismic-ts-codegen": "^0.1.15",
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/revalidate/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { revalidatePath } from "next/cache";
import { revalidatePath, revalidateTag } from "next/cache";
import { NextRequest, NextResponse } from "next/server";
import { createClient } from "@/prismicio";
import * as z from "zod";
Expand Down Expand Up @@ -33,6 +33,7 @@ export async function POST(req: NextRequest) {
revalidatePath(doc.url?.includes("blog") ? "/blog/[postId]" : "/");
})
);
revalidateTag("prismic");

return NextResponse.json(
{ revalidated: true, now: Date.now() },
Expand Down
8 changes: 6 additions & 2 deletions src/app/blog/[postId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createClient } from "@/prismicio";
import Post from "@/src/components/Post/Post";
import PostHeader from "@/src/components/Post/PostHeader";
import { useImageStore } from "@/src/lib/stores";
import addImagesPlaceholders from "@/src/lib/utils/addImagesPlaceholders";

Expand All @@ -11,7 +10,12 @@ interface PostPageProps {
}

export async function generateStaticParams() {
const client = createClient();
const client = createClient({
fetchOptions:
process.env.NODE_ENV === "production"
? { next: { tags: ["prismic"] }, cache: "force-cache" }
: { next: { revalidate: 5 } },
});
const posts = await client.getAllByType("post");

return posts.map((post) => ({
Expand Down
1 change: 1 addition & 0 deletions src/components/Shared/Contact/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const MapWithAMakredInfoWindow = compose<MapProps, MapProps>(
lat: map_lat,
lng: map_lng
};
console.log('@@@ ~ coordinates:', coordinates);
return (
// @ts-ignore
<GoogleMap defaultZoom={16} defaultCenter={coordinates}>
Expand Down
47 changes: 31 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,18 @@
resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413"
integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==

"@emotion/is-prop-valid@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc"
integrity sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==
dependencies:
"@emotion/memoize" "^0.8.1"

"@emotion/memoize@^0.8.1":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.1.tgz#c1ddb040429c6d21d38cc945fe75c818cfb68e17"
integrity sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==

"@emotion/unitless@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.1.tgz#182b5a4704ef8ad91bde93f7a860a88fd92c79a3"
Expand Down Expand Up @@ -2482,6 +2494,11 @@
"@types/react" "*"
csstype "^3.0.2"

"@types/stylis@^4.0.2":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@types/stylis/-/stylis-4.2.0.tgz#199a3f473f0c3a6f6e4e1b17cdbc967f274bdc6b"
integrity sha512-n4sx2bqL0mW1tvDf/loQ+aMX7GQD3lc3fkCMC55VFNDu/vBOabO+LTIeXKM14xK0ppk5TUGcWRjiSpIlUpghKw==

"@types/unist@*", "@types/unist@^2.0.0":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
Expand Down Expand Up @@ -3746,7 +3763,7 @@ csstype@^2.5.2:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.21.tgz#2efb85b7cc55c80017c66a5ad7cbd931fda3a90e"
integrity sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==

csstype@^3.0.2:
csstype@^3.0.2, csstype@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b"
integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==
Expand Down Expand Up @@ -7712,16 +7729,11 @@ prettier-plugin-tailwindcss@^0.4.1:
resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.4.1.tgz#f7ed664199540978b2cbd037bac3a337d6689e86"
integrity sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==

prettier@^2.7.1, prettier@^2.8.4:
prettier@^2.7.1, prettier@^2.8.4, prettier@^2.8.8:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

prettier@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae"
integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==

pretty-quick@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e"
Expand Down Expand Up @@ -9043,10 +9055,10 @@ [email protected]:
dependencies:
inline-style-parser "0.1.1"

styled-components@^6.0.0-rc.1:
version "6.0.0-rc.2-4007"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-6.0.0-rc.2-4007.tgz#eda157dfaa98281d01f8f2ce727525a1830dfdde"
integrity sha512-MfdCEa1s5Qogv0XRkS1u4udh5mLRQR1jceyScjvg0uafQdICHnH81pi22EXRbG6Eqx+Cs3TCtwgOxIt7PTQBCQ==
styled-components@^6.0.4:
version "6.0.4"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-6.0.4.tgz#55bb3a1197daf8075ae8b345b57eb03f2570d51e"
integrity sha512-lRJt4vg8hKJhlVG+VKz8QEqPCXKyTryZZ59odyK0UC0HHV3u/mshWTfSay8NpkN0Xijw1iN9r0Leld3dcCcp/w==
dependencies:
"@babel/cli" "^7.21.0"
"@babel/core" "^7.21.0"
Expand All @@ -9058,11 +9070,14 @@ styled-components@^6.0.0-rc.1:
"@babel/preset-react" "^7.18.6"
"@babel/preset-typescript" "^7.21.0"
"@babel/traverse" "^7.21.2"
"@emotion/is-prop-valid" "^1.2.1"
"@emotion/unitless" "^0.8.0"
"@types/stylis" "^4.0.2"
css-to-react-native "^3.2.0"
csstype "^3.1.2"
postcss "^8.4.23"
shallowequal "^1.1.0"
stylis "^4.2.0"
stylis "^4.3.0"
tslib "^2.5.0"

[email protected]:
Expand All @@ -9072,10 +9087,10 @@ [email protected]:
dependencies:
client-only "0.0.1"

stylis@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51"
integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==
stylis@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.0.tgz#abe305a669fc3d8777e10eefcfc73ad861c5588c"
integrity sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==

sucrase@^3.32.0:
version "3.32.0"
Expand Down

0 comments on commit 358e087

Please sign in to comment.