From c3c74ca356414c4af504163eede4dd45b8c04aa9 Mon Sep 17 00:00:00 2001
From: conico974
Date: Mon, 5 May 2025 10:07:07 +0200
Subject: [PATCH] sync aws #849
---
examples/e2e/experimental/e2e/playwright.config.ts | 3 +--
examples/e2e/experimental/e2e/use-cache.test.ts | 13 +++++++------
.../e2e/experimental/src/app/use-cache/ssr/page.tsx | 5 ++++-
examples/e2e/experimental/src/components/cached.tsx | 11 ++++++++++-
4 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/examples/e2e/experimental/e2e/playwright.config.ts b/examples/e2e/experimental/e2e/playwright.config.ts
index 23ffcbba..b27f8b9c 100644
--- a/examples/e2e/experimental/e2e/playwright.config.ts
+++ b/examples/e2e/experimental/e2e/playwright.config.ts
@@ -1,4 +1,3 @@
import { configurePlaywright } from "../../../common/config-e2e";
-// We need to disable parallel execution for the experimental app, otherwise it breaks the SSR test
-export default configurePlaywright("experimental", { parallel: false });
+export default configurePlaywright("experimental");
diff --git a/examples/e2e/experimental/e2e/use-cache.test.ts b/examples/e2e/experimental/e2e/use-cache.test.ts
index bb72ffc3..0728419a 100644
--- a/examples/e2e/experimental/e2e/use-cache.test.ts
+++ b/examples/e2e/experimental/e2e/use-cache.test.ts
@@ -3,7 +3,7 @@ import { expect, test } from "@playwright/test";
test.describe("Composable Cache", () => {
test("cached component should work in ssr", async ({ page }) => {
await page.goto("/use-cache/ssr");
- let fullyCachedElt = page.getByTestId("fullyCached");
+ let fullyCachedElt = page.getByTestId("fully-cached");
let isrElt = page.getByTestId("isr");
await expect(fullyCachedElt).toBeVisible();
await expect(isrElt).toBeVisible();
@@ -12,9 +12,10 @@ test.describe("Composable Cache", () => {
const initialIsrText = await isrElt.textContent();
let isrText = initialIsrText;
+
do {
await page.reload();
- fullyCachedElt = page.getByTestId("fullyCached");
+ fullyCachedElt = page.getByTestId("fully-cached");
isrElt = page.getByTestId("isr");
await expect(fullyCachedElt).toBeVisible();
await expect(isrElt).toBeVisible();
@@ -27,7 +28,7 @@ test.describe("Composable Cache", () => {
test("revalidateTag should work for fullyCached component", async ({ page, request }) => {
await page.goto("/use-cache/ssr");
- const fullyCachedElt = page.getByTestId("fullyCached");
+ const fullyCachedElt = page.getByTestId("fully-cached-with-tag");
await expect(fullyCachedElt).toBeVisible();
const initialFullyCachedText = await fullyCachedElt.textContent();
@@ -45,7 +46,7 @@ test.describe("Composable Cache", () => {
test("cached component should work in isr", async ({ page }) => {
await page.goto("/use-cache/isr");
- let fullyCachedElt = page.getByTestId("fullyCached");
+ let fullyCachedElt = page.getByTestId("fully-cached");
let isrElt = page.getByTestId("isr");
await expect(fullyCachedElt).toBeVisible();
@@ -61,7 +62,7 @@ test.describe("Composable Cache", () => {
while (isrText === initialIsrText) {
await page.reload();
isrElt = page.getByTestId("isr");
- fullyCachedElt = page.getByTestId("fullyCached");
+ fullyCachedElt = page.getByTestId("fully-cached");
await expect(isrElt).toBeVisible();
isrText = await isrElt.textContent();
await expect(fullyCachedElt).toBeVisible();
@@ -72,7 +73,7 @@ test.describe("Composable Cache", () => {
do {
await page.reload();
- fullyCachedElt = page.getByTestId("fullyCached");
+ fullyCachedElt = page.getByTestId("fully-cached");
isrElt = page.getByTestId("isr");
await expect(fullyCachedElt).toBeVisible();
await expect(isrElt).toBeVisible();
diff --git a/examples/e2e/experimental/src/app/use-cache/ssr/page.tsx b/examples/e2e/experimental/src/app/use-cache/ssr/page.tsx
index 41a413d1..f610aeed 100644
--- a/examples/e2e/experimental/src/app/use-cache/ssr/page.tsx
+++ b/examples/e2e/experimental/src/app/use-cache/ssr/page.tsx
@@ -1,4 +1,4 @@
-import { FullyCachedComponent, ISRComponent } from "@/components/cached";
+import { FullyCachedComponent, FullyCachedComponentWithTag, ISRComponent } from "@/components/cached";
import { headers } from "next/headers";
import { Suspense } from "react";
@@ -12,6 +12,9 @@ export default async function Page() {
Loading...
}>
+ Loading...}>
+
+
Loading...}>
diff --git a/examples/e2e/experimental/src/components/cached.tsx b/examples/e2e/experimental/src/components/cached.tsx
index 7abaa010..4e822859 100644
--- a/examples/e2e/experimental/src/components/cached.tsx
+++ b/examples/e2e/experimental/src/components/cached.tsx
@@ -1,11 +1,20 @@
import { unstable_cacheLife, unstable_cacheTag } from "next/cache";
export async function FullyCachedComponent() {
+ "use cache";
+ return (
+
+ );
+}
+
+export async function FullyCachedComponentWithTag() {
"use cache";
unstable_cacheTag("fullyTagged");
return (
-
{Date.now()}
+
{Date.now()}
);
}