Skip to content

Commit

Permalink
chore: upgrade to blobs v8 (#2595)
Browse files Browse the repository at this point in the history
* chore: Upgrade blobs version to latest

* chore: replace references to experimental region

* fix: feature has been fully released and flag defaults to true
  • Loading branch information
mrstork authored Sep 19, 2024
1 parent 4845302 commit 0d2fad2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
31 changes: 24 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"homepage": "https://github.com/netlify/next-runtime#readme",
"devDependencies": {
"@fastly/http-compute-js": "1.1.4",
"@netlify/blobs": "^7.4.0",
"@netlify/blobs": "^8.0.1",
"@netlify/build": "^29.54.3",
"@netlify/edge-bundler": "^12.2.3",
"@netlify/edge-functions": "^2.10.0",
Expand Down
4 changes: 0 additions & 4 deletions src/build/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ export class PluginContext {
}

get useRegionalBlobs(): boolean {
if (!(this.featureFlags || {})['next-runtime-regional-blobs']) {
return false
}

// Region-aware blobs are only available as of CLI v17.23.5 (i.e. Build v29.41.5)
const REQUIRED_BUILD_VERSION = '>=29.41.5'
return satisfies(this.buildVersion, REQUIRED_BUILD_VERSION, { includePrerelease: true })
Expand Down
10 changes: 4 additions & 6 deletions src/run/regional-blob-store.cts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { getDeployStore, Store } from '@netlify/blobs'
import { getDeployStore, GetWithMetadataOptions, Store } from '@netlify/blobs'

const fetchBeforeNextPatchedIt = globalThis.fetch

export const getRegionalBlobStore = (args: Parameters<typeof getDeployStore>[0] = {}): Store => {
const options = typeof args === 'string' ? { name: args } : args
export const getRegionalBlobStore = (args: GetWithMetadataOptions = {}): Store => {
return getDeployStore({
...options,
...args,
fetch: fetchBeforeNextPatchedIt,
experimentalRegion:
process.env.USE_REGIONAL_BLOBS?.toUpperCase() === 'TRUE' ? 'context' : undefined,
region: process.env.USE_REGIONAL_BLOBS?.toUpperCase() === 'TRUE' ? undefined : 'us-east-2',
})
}
2 changes: 0 additions & 2 deletions tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const startMockBlobStore = async (ctx: FixtureTestContext) => {
ctx.blobStore = getDeployStore({
apiURL: `http://${ctx.blobStoreHost}`,
deployID: ctx.deployID,
experimentalRegion: 'context',
siteID: ctx.siteID,
token: BLOB_TOKEN,
})
Expand All @@ -74,7 +73,6 @@ export const getBlobEntries = async (ctx: FixtureTestContext) => {
: getDeployStore({
apiURL: `http://${ctx.blobStoreHost}`,
deployID: ctx.deployID,
experimentalRegion: 'context',
siteID: ctx.siteID,
token: BLOB_TOKEN,
})
Expand Down

0 comments on commit 0d2fad2

Please sign in to comment.