Skip to content

Commit ae399fd

Browse files
committed
feat: persistent builders for all
1 parent f216361 commit ae399fd

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

src/constants.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const destr = require('destr')
33
const HANDLER_FUNCTION_NAME = '___netlify-handler'
44
const ODB_FUNCTION_NAME = '___netlify-odb-handler'
55
const IMAGE_FUNCTION_NAME = '_ipx'
6-
const ODB_PATH = destr(process.env.EXPERIMENTAL_PERSISTENT_BUILDERS) ? 'builders' : 'functions'
76

87
// These are paths in .next that shouldn't be publicly accessible
98
const HIDDEN_PATHS = [
@@ -23,5 +22,4 @@ module.exports = {
2322
IMAGE_FUNCTION_NAME,
2423
HANDLER_FUNCTION_NAME,
2524
ODB_FUNCTION_NAME,
26-
ODB_PATH,
2725
}

src/helpers/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const defaultFailBuild = (message, { error }) => {
77
throw new Error(`${message}\n${error && error.stack}`)
88
}
99

10-
const { HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME, HIDDEN_PATHS, ODB_PATH } = require('../constants')
10+
const { HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME, HIDDEN_PATHS } = require('../constants')
1111

12-
const ODB_FUNCTION_PATH = `/.netlify/${ODB_PATH}/${ODB_FUNCTION_NAME}`
12+
const ODB_FUNCTION_PATH = `/.netlify/builders/${ODB_FUNCTION_NAME}`
1313
const HANDLER_FUNCTION_PATH = `/.netlify/functions/${HANDLER_FUNCTION_NAME}`
1414

1515
const CATCH_ALL_REGEX = /\/\[\.{3}(.*)](.json)?$/

src/helpers/functions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { join, relative } = require('path')
22

33
const { copyFile, ensureDir, writeFile, writeJSON } = require('fs-extra')
44

5-
const { HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME, IMAGE_FUNCTION_NAME, ODB_PATH } = require('../constants')
5+
const { HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME, IMAGE_FUNCTION_NAME } = require('../constants')
66
const getHandler = require('../templates/getHandler')
77
const { getPageResolver } = require('../templates/getPageResolver')
88

@@ -78,7 +78,7 @@ exports.setupImageFunction = async ({
7878
},
7979
{
8080
from: `${basePath}/${IMAGE_FUNCTION_NAME}/*`,
81-
to: `/.netlify/${ODB_PATH}/${IMAGE_FUNCTION_NAME}`,
81+
to: `/.netlify/builders/${IMAGE_FUNCTION_NAME}`,
8282
status: 200,
8383
},
8484
)

test/__snapshots__/index.js.snap

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Array [
8181
Object {
8282
"from": "/_ipx/*",
8383
"status": 200,
84-
"to": "/.netlify/functions/_ipx",
84+
"to": "/.netlify/builders/_ipx",
8585
},
8686
Object {
8787
"force": true,
@@ -162,42 +162,42 @@ Array [
162162
Object {
163163
"from": "/getStaticProps/withFallback/:slug/*",
164164
"status": 200,
165-
"to": "/.netlify/functions/___netlify-odb-handler",
165+
"to": "/.netlify/builders/___netlify-odb-handler",
166166
},
167167
Object {
168168
"from": "/_next/data/build-id/getStaticProps/withFallback/:slug/*",
169169
"status": 200,
170-
"to": "/.netlify/functions/___netlify-odb-handler",
170+
"to": "/.netlify/builders/___netlify-odb-handler",
171171
},
172172
Object {
173173
"from": "/getStaticProps/withFallback/:id",
174174
"status": 200,
175-
"to": "/.netlify/functions/___netlify-odb-handler",
175+
"to": "/.netlify/builders/___netlify-odb-handler",
176176
},
177177
Object {
178178
"from": "/_next/data/build-id/getStaticProps/withFallback/:id.json",
179179
"status": 200,
180-
"to": "/.netlify/functions/___netlify-odb-handler",
180+
"to": "/.netlify/builders/___netlify-odb-handler",
181181
},
182182
Object {
183183
"from": "/getStaticProps/withFallbackBlocking/:id",
184184
"status": 200,
185-
"to": "/.netlify/functions/___netlify-odb-handler",
185+
"to": "/.netlify/builders/___netlify-odb-handler",
186186
},
187187
Object {
188188
"from": "/_next/data/build-id/getStaticProps/withFallbackBlocking/:id.json",
189189
"status": 200,
190-
"to": "/.netlify/functions/___netlify-odb-handler",
190+
"to": "/.netlify/builders/___netlify-odb-handler",
191191
},
192192
Object {
193193
"from": "/getStaticProps/withRevalidate/withFallback/:id",
194194
"status": 200,
195-
"to": "/.netlify/functions/___netlify-odb-handler",
195+
"to": "/.netlify/builders/___netlify-odb-handler",
196196
},
197197
Object {
198198
"from": "/_next/data/build-id/getStaticProps/withRevalidate/withFallback/:id.json",
199199
"status": 200,
200-
"to": "/.netlify/functions/___netlify-odb-handler",
200+
"to": "/.netlify/builders/___netlify-odb-handler",
201201
},
202202
Object {
203203
"from": "/*",

0 commit comments

Comments
 (0)