Skip to content

Commit 700c36b

Browse files
authored
fix: remove references to fully rolled out netlify_build_frameworks_api feature flag (#6053)
1 parent 5f8b128 commit 700c36b

File tree

6 files changed

+18
-38
lines changed

6 files changed

+18
-38
lines changed

packages/build/src/core/feature_flags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
1919
buildbot_zisi_esbuild_parser: false,
2020
netlify_build_reduced_output: false,
2121
netlify_build_updated_plugin_compatibility: false,
22-
netlify_build_frameworks_api: false,
2322
netlify_build_plugin_system_log: false,
2423
}

packages/build/src/plugins_core/edge_functions/index.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,19 @@ const coreStep = async function ({
5555
const frameworksAPISrcPath = resolve(buildDir, packagePath || '', FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT)
5656
const generatedFunctionPaths = [internalSrcPath]
5757

58-
if (featureFlags.netlify_build_frameworks_api) {
59-
if (await pathExists(frameworksAPISrcPath)) {
60-
generatedFunctionPaths.push(frameworksAPISrcPath)
61-
}
58+
if (await pathExists(frameworksAPISrcPath)) {
59+
generatedFunctionPaths.push(frameworksAPISrcPath)
60+
}
6261

63-
const frameworkImportMap = resolve(
64-
buildDir,
65-
packagePath || '',
66-
FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT,
67-
FRAMEWORKS_API_EDGE_FUNCTIONS_IMPORT_MAP,
68-
)
62+
const frameworkImportMap = resolve(
63+
buildDir,
64+
packagePath || '',
65+
FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT,
66+
FRAMEWORKS_API_EDGE_FUNCTIONS_IMPORT_MAP,
67+
)
6968

70-
if (await pathExists(frameworkImportMap)) {
71-
importMapPaths.push(frameworkImportMap)
72-
}
69+
if (await pathExists(frameworkImportMap)) {
70+
importMapPaths.push(frameworkImportMap)
7371
}
7472

7573
const sourcePaths = [...generatedFunctionPaths, srcPath].filter(Boolean) as string[]
@@ -158,7 +156,6 @@ const getMetrics = (manifest): Metric[] => {
158156
const hasEdgeFunctionsDirectories = async function ({
159157
buildDir,
160158
constants: { INTERNAL_EDGE_FUNCTIONS_SRC, EDGE_FUNCTIONS_SRC },
161-
featureFlags,
162159
packagePath,
163160
}): Promise<boolean> {
164161
const hasFunctionsSrc = EDGE_FUNCTIONS_SRC !== undefined && EDGE_FUNCTIONS_SRC !== ''
@@ -173,13 +170,9 @@ const hasEdgeFunctionsDirectories = async function ({
173170
return true
174171
}
175172

176-
if (featureFlags.netlify_build_frameworks_api) {
177-
const frameworkFunctionsSrc = resolve(buildDir, packagePath || '', FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT)
178-
179-
return await pathExists(frameworkFunctionsSrc)
180-
}
173+
const frameworkFunctionsSrc = resolve(buildDir, packagePath || '', FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT)
181174

182-
return false
175+
return await pathExists(frameworkFunctionsSrc)
183176
}
184177

185178
const logFunctions = async ({

packages/build/src/plugins_core/functions/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ const coreStep = async function ({
202202
const hasFunctionsDirectories = async function ({
203203
buildDir,
204204
constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC },
205-
featureFlags,
206205
packagePath,
207206
}) {
208207
const hasFunctionsSrc = FUNCTIONS_SRC !== undefined && FUNCTIONS_SRC !== ''
@@ -217,13 +216,9 @@ const hasFunctionsDirectories = async function ({
217216
return true
218217
}
219218

220-
if (featureFlags.netlify_build_frameworks_api) {
221-
const frameworkFunctionsSrc = resolve(buildDir, packagePath || '', FRAMEWORKS_API_FUNCTIONS_ENDPOINT)
222-
223-
return await pathExists(frameworkFunctionsSrc)
224-
}
219+
const frameworkFunctionsSrc = resolve(buildDir, packagePath || '', FRAMEWORKS_API_FUNCTIONS_ENDPOINT)
225220

226-
return false
221+
return await pathExists(frameworkFunctionsSrc)
227222
}
228223

229224
export const bundleFunctions = {

packages/build/src/plugins_core/functions/utils.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ export const getUserAndInternalFunctions = ({
3131
const paths = [
3232
functionsSrcExists ? functionsSrc : undefined,
3333
internalFunctionsSrcExists ? internalFunctionsSrc : undefined,
34+
frameworkFunctionsSrcExists ? frameworkFunctionsSrc : undefined,
3435
]
3536

36-
if (featureFlags.netlify_build_frameworks_api && frameworkFunctionsSrcExists) {
37-
paths.push(frameworkFunctionsSrc)
38-
}
39-
4037
return Promise.all(paths.map((path) => path && getRelativeFunctionMainFiles({ featureFlags, functionsSrc: path })))
4138
}
4239

packages/build/tests/edge_functions/tests.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ if (semver.gte(nodeVersion, '16.7.0')) {
221221
const output = await new Fixture('./fixtures/functions_user_framework')
222222
.withFlags({
223223
debug: false,
224-
featureFlags: { netlify_build_frameworks_api: true },
225224
mode: 'buildbot',
226225
})
227226
.runWithBuild()
@@ -245,7 +244,6 @@ if (semver.gte(nodeVersion, '16.7.0')) {
245244
const output = await new Fixture('./fixtures/functions_user_internal_framework')
246245
.withFlags({
247246
debug: false,
248-
featureFlags: { netlify_build_frameworks_api: true },
249247
mode: 'buildbot',
250248
})
251249
.runWithBuild()

packages/build/tests/functions/tests.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ test('Functions: cleanup is only triggered when there are internal functions', a
125125
if (semver.gte(nodeVersion, '16.7.0')) {
126126
test('Functions: loads functions generated with the Frameworks API', async (t) => {
127127
const fixture = await new Fixture('./fixtures/functions_user_and_frameworks')
128-
.withFlags({ debug: false, featureFlags: { netlify_build_frameworks_api: true } })
128+
.withFlags({ debug: false })
129129
.withCopyRoot()
130130

131131
const output = await fixture.runWithBuild()
@@ -140,7 +140,7 @@ if (semver.gte(nodeVersion, '16.7.0')) {
140140

141141
test('Functions: loads functions from the `.netlify/functions-internal` directory and the Frameworks API', async (t) => {
142142
const fixture = await new Fixture('./fixtures/functions_user_internal_and_frameworks')
143-
.withFlags({ debug: false, featureFlags: { netlify_build_frameworks_api: true } })
143+
.withFlags({ debug: false })
144144
.withCopyRoot()
145145

146146
const output = await fixture.runWithBuild()
@@ -175,7 +175,6 @@ if (semver.gte(nodeVersion, '16.9.0')) {
175175
const app1 = await fixture
176176
.withFlags({
177177
cwd: fixture.repositoryRoot,
178-
featureFlags: { netlify_build_frameworks_api: true },
179178
packagePath: 'apps/app-1',
180179
})
181180
.runWithBuildAndIntrospect()
@@ -185,7 +184,6 @@ if (semver.gte(nodeVersion, '16.9.0')) {
185184
const app2 = await fixture
186185
.withFlags({
187186
cwd: fixture.repositoryRoot,
188-
featureFlags: { netlify_build_frameworks_api: true },
189187
packagePath: 'apps/app-2',
190188
})
191189
.runWithBuildAndIntrospect()

0 commit comments

Comments
 (0)