Skip to content

Commit 165067e

Browse files
authored
fix(edge-bundler): update bootstrap API call for v2.15.0+ compatibility (#6682)
1 parent 8f0799b commit 165067e

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/edge-bundler/node/formats/javascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const getLocalEntryPoint = (
7878
}
7979
`
8080
})
81-
const bootCall = `boot(functions, metadata);`
81+
const bootCall = `boot(() => Promise.resolve(functions));`
8282

8383
return [bootImport, declaration, ...imports, bootCall].join('\n\n')
8484
}

packages/edge-bundler/node/stage_2.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ test('`getLocalEntryPoint` returns a valid stage 2 file for local development',
1414
// This is a fake bootstrap that we'll create just for the purpose of logging
1515
// the functions and the metadata that are sent to the `boot` function.
1616
const printer = `
17-
export const boot = async (functions, metadata) => {
17+
export const boot = async (functionsLoader) => {
18+
const functions = await functionsLoader()
19+
const metadata = { functions: {} }
20+
21+
// Generate metadata for each function (simulating what the real bootstrap would have)
22+
for (const name in functions) {
23+
metadata.functions[name] = { url: new URL('./' + name + '.mjs', import.meta.url).href }
24+
}
25+
1826
const responses = {}
1927
2028
for (const name in functions) {

packages/edge-bundler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"test": "test/node"
4343
},
4444
"devDependencies": {
45-
"@netlify/edge-functions-bootstrap": "^2.14.0",
45+
"@netlify/edge-functions-bootstrap": "^2.17.1",
4646
"@types/node": "^18.19.111",
4747
"@types/semver": "^7.3.9",
4848
"@types/uuid": "^10.0.0",

0 commit comments

Comments
 (0)