Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-meals-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/aws": patch
---

Basic support for PPR
1 change: 1 addition & 0 deletions packages/open-next/src/adapters/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export default class S3Cache {
rscData: Buffer.from(cacheData.rsc),
status: meta?.status,
headers: meta?.headers,
postponed: meta?.postponed,
},
} as CacheHandlerValue;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/open-next/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
const outputPath = path.join(outputDir, "assets");
fs.mkdirSync(outputPath, { recursive: true });

// Next.js outputs assets into multiple files. Copy into the same directory.

Check warning on line 448 in packages/open-next/src/build.ts

View workflow job for this annotation

GitHub Actions / validate

Refactor this function to reduce its Cognitive Complexity from 36 to the 35 allowed
// Copy over:
// - .next/BUILD_ID => _next/BUILD_ID
// - .next/static => _next/static
Expand Down Expand Up @@ -523,8 +523,12 @@
() => true,
(filepath) => {
const ext = path.extname(filepath);
const newFilePath =
let newFilePath =
ext !== "" ? filepath.replace(ext, ".cache") : `${filepath}.cache`;
// Handle prefetch cache files for partial prerendering
if (newFilePath.endsWith(".prefetch.cache")) {
newFilePath = newFilePath.replace(".prefetch.cache", ".cache");
}
switch (ext) {
case ".meta":
case ".html":
Expand Down
1 change: 1 addition & 0 deletions packages/open-next/src/cache/next-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ export type Extension = "cache" | "fetch";
export interface Meta {
status?: number;
headers?: Record<string, undefined | string | string[]>;
postponed?: string;
}
Loading