Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to blobs v8 #2595

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2",
mrstork marked this conversation as resolved.
Show resolved Hide resolved
"@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
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flag has been fully rolled out


// 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({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a nice type to use for this 👍

...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',
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context is now the default, us-east-2 is the old default

}
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
Loading