Skip to content

Commit 407da47

Browse files
taty2010nickytonline
authored andcommitted
chore: prettier
1 parent 2fe2c83 commit 407da47

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

packages/runtime/src/helpers/functions.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,8 @@ export const getSSRLambdas = async (publish: string, constants): Promise<SSRLamb
407407
// '/Users/tatyananovell/Documents/next-runtime/demos/default/.next/server/app/blog/sarah.rsc',
408408
// ]
409409
// moving the ssrDeps to the Blob store so we can access them in templates/getHandler
410-
setBlobFiles( constants, ssrDependencies )
410+
setBlobFiles(constants, ssrDependencies)
411411

412-
413412
return [
414413
{
415414
functionName: HANDLER_FUNCTION_NAME,

packages/runtime/src/templates/blobHandler.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Buffer } from 'node:buffer'
22
import { env } from 'node:process'
33

4-
54
import { Blobs } from '@netlify/blobs'
65
import { Handler, HandlerContext } from '@netlify/functions'
76

@@ -15,13 +14,13 @@ export const setBlobFiles = async ({ NETLIFY_API_HOST, NETLIFY_API_TOKEN, SITE_I
1514
siteID: SITE_ID,
1615
})
1716

18-
const files = filePaths.map((filePath) => ({ key: filePath, path: filePath }))
17+
const files = filePaths.map((filePath) => ({ key: filePath, path: filePath }))
1918

20-
// setFile reads the file path and stores the content within the blob,
21-
// we set the key with the same file path so we can retrieve the file contents later using the path
22-
await blobs.setFiles(files)
19+
// setFile reads the file path and stores the content within the blob,
20+
// we set the key with the same file path so we can retrieve the file contents later using the path
21+
await blobs.setFiles(files)
2322

24-
console.log("SSR Files are now in the blob", { blobs })
23+
console.log('SSR Files are now in the blob', { blobs })
2524
}
2625

2726
export const getBlobFile: Handler = async ({ headers, path }, context: HandlerContext) => {
@@ -35,7 +34,7 @@ export const getBlobFile: Handler = async ({ headers, path }, context: HandlerCo
3534
},
3635
context: `deploy:${headers['x-nf-deploy-id']}`,
3736
siteID: headers['x-nf-site-id'],
38-
})
37+
})
3938

4039
const value = await blobs.get(path)
4140

packages/runtime/src/templates/getHandler.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mod
119119
}
120120

121121
return async function handler(event: HandlerEvent, context: HandlerContext) {
122-
123122
event.path = normalizePath(event)
124123
// We are checking if path is ODB and cache miss to pull in the blobbed pre-rendered content
125-
if( mode === 'odb' && event.headers['x-nf-builder-cache'] === 'miss' ){
124+
if (mode === 'odb' && event.headers['x-nf-builder-cache'] === 'miss') {
126125
console.log('odb builder cache miss, get from Blob')
127126
return getBlobFile(event, context)
128127
}

0 commit comments

Comments
 (0)