Skip to content

Commit 1943441

Browse files
committed
linting
1 parent 4b7cabe commit 1943441

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

packages/cloudflare/src/cli/build/patches/plugins/next-minimal.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ async function h(e3, t3) {
3838

3939
describe("Abort controller", () => {
4040
test("minimal", () => {
41-
expect(patchCode(appPageRuntimeProdJs,abortControllerRule )).toBe(
42-
`let p = {signal:{aborted: false}};
41+
expect(patchCode(appPageRuntimeProdJs, abortControllerRule)).toBe(
42+
`let p = {signal:{aborted: false}};
4343
async function h(e3, t3) {
4444
let { flightRouterState: r3, nextUrl: a2, prefetchKind: i2 } = t3, u2 = { [n2.hY]: "1", [n2.B]: encodeURIComponent(JSON.stringify(r3)) };
4545
i2 === o.ob.AUTO && (u2[n2._V] = "1"), a2 && (u2[n2.kO] = a2);
@@ -70,6 +70,7 @@ async function h(e3, t3) {
7070
return p.signal.aborted || console.error("Failed to fetch RSC payload for " + e3 + ". Falling back to browser navigation.", t4), { flightData: e3.toString(), canonicalUrl: void 0, couldBeIntercepted: false, prerendered: false, postponed: false, staleTime: -1 };
7171
}
7272
}
73-
`);
73+
`
74+
);
7475
});
75-
})
76+
});

packages/cloudflare/src/cli/build/patches/plugins/next-minimal.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rule:
3535
3636
fix:
3737
'let $VAR = {signal:{aborted: false}};'
38-
`
38+
`;
3939

4040
// This rule is used instead of defining `process.env.NEXT_MINIMAL` in the `esbuild config.
4141
// Do we want to entirely replace these functions to reduce the bundle size?
@@ -66,19 +66,27 @@ rule:
6666
pattern: res.statusCode = 400;
6767
fix:
6868
'true'
69-
`
69+
`;
7070

7171
export function patchNextMinimal(updater: ContentUpdater) {
72-
updater.updateContent("patch-abortController-next15.2", { filter: /app-page\.runtime\.prod\.(js)$/, contentFilter: /new AbortController/ }, async ({ contents }) => {
73-
return patchCode(contents, abortControllerRule)
74-
});
72+
updater.updateContent(
73+
"patch-abortController-next15.2",
74+
{ filter: /app-page\.runtime\.prod\.(js)$/, contentFilter: /new AbortController/ },
75+
async ({ contents }) => {
76+
return patchCode(contents, abortControllerRule);
77+
}
78+
);
7579

76-
updater.updateContent("patch-next-minimal", { filter: /next-server\.(js)$/, contentFilter: /.*/ }, async ({ contents }) => {
77-
return patchCode(contents, nextMinimalRule)
78-
});
79-
80-
return {
81-
name: "patch-abortController",
82-
setup() { },
83-
};
80+
updater.updateContent(
81+
"patch-next-minimal",
82+
{ filter: /next-server\.(js)$/, contentFilter: /.*/ },
83+
async ({ contents }) => {
84+
return patchCode(contents, nextMinimalRule);
85+
}
86+
);
87+
88+
return {
89+
name: "patch-abortController",
90+
setup() {},
91+
};
8492
}

0 commit comments

Comments
 (0)