mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
[build-utils] Deprecate EdgeFunction#name property (#11010)
The `name` property of the `EdgeFunction` class is no longer necessary on the infra side. Instead, its value is inferred based on the URL path that the function is representing. So deprecate the property on the class, and remove its usage throughout the codebase.
This commit is contained in:
@@ -540,17 +540,7 @@ module.exports = config;`;
|
||||
throw new Error(`Could not determine server bundle for "${route.id}"`);
|
||||
}
|
||||
|
||||
output[path] =
|
||||
func instanceof EdgeFunction
|
||||
? // `EdgeFunction` currently requires the "name" property to be set.
|
||||
// Ideally this property will be removed, at which point we can
|
||||
// return the same `edgeFunction` instance instead of creating a
|
||||
// new one for each page.
|
||||
new EdgeFunction({
|
||||
...func,
|
||||
name: path,
|
||||
})
|
||||
: func;
|
||||
output[path] = func;
|
||||
|
||||
// If this is a dynamic route then add a Vercel route
|
||||
const re = getRegExpFromPath(rePath);
|
||||
@@ -573,10 +563,7 @@ module.exports = config;`;
|
||||
);
|
||||
const func =
|
||||
edgeFunctionIndex !== -1 ? functions[edgeFunctionIndex] : functions[0];
|
||||
output['404'] =
|
||||
func instanceof EdgeFunction
|
||||
? new EdgeFunction({ ...func, name: '404' })
|
||||
: func;
|
||||
output['404'] = func;
|
||||
}
|
||||
routes.push({
|
||||
src: '/(.*)',
|
||||
@@ -767,7 +754,6 @@ async function createRenderEdgeFunction(
|
||||
const fn = new EdgeFunction({
|
||||
files,
|
||||
deploymentTarget: 'v8-worker',
|
||||
name: 'render',
|
||||
entrypoint: handler,
|
||||
regions: config.regions,
|
||||
framework: {
|
||||
|
||||
Reference in New Issue
Block a user