-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Blobs context to edge functions (#6109)
* feat: simplify Blobs context * feat: add Blobs context to edge functions * chore: remove comment
- Loading branch information
1 parent
786b3c5
commit c770ba0
Showing
19 changed files
with
104 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { env } from 'process' | ||
|
||
const latestBootstrapURL = 'https://650bfd807b21ed000893e25c--edge.netlify.com/bootstrap/index-combined.ts' | ||
const latestBootstrapURL = 'https://6539213a19a93a000876a033--edge.netlify.com/bootstrap/index-combined.ts' | ||
|
||
export const getBootstrapURL = () => env.NETLIFY_EDGE_BOOTSTRAP || latestBootstrapURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/integration/__fixtures__/dev-server-with-edge-functions-and-npm-modules/netlify.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build] | ||
publish = "public" |
22 changes: 22 additions & 0 deletions
22
...fixtures__/dev-server-with-edge-functions-and-npm-modules/netlify/edge-functions/blobs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { getStore } from '@netlify/blobs' | ||
|
||
export default async () => { | ||
const store = getStore('my-store') | ||
const metadata = { | ||
name: 'Netlify', | ||
features: { | ||
blobs: true, | ||
functions: true, | ||
}, | ||
} | ||
|
||
await store.set('my-key', 'hello world', { metadata }) | ||
|
||
const entry = await store.getWithMetadata('my-key') | ||
|
||
return Response.json(entry) | ||
} | ||
|
||
export const config = { | ||
path: '/blobs', | ||
} |
20 changes: 20 additions & 0 deletions
20
...integration/__fixtures__/dev-server-with-edge-functions-and-npm-modules/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
tests/integration/__fixtures__/dev-server-with-edge-functions-and-npm-modules/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"@netlify/blobs": "^4.0.0" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...gration/__fixtures__/dev-server-with-edge-functions-and-npm-modules/public/ordertest.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
origin |
12 changes: 0 additions & 12 deletions
12
...ion/__fixtures__/dev-server-with-edge-functions/netlify/edge-functions/with-npm-module.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...on/__fixtures__/dev-server-with-edge-functions/node_modules/@netlify/fake-module/index.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
..._fixtures__/dev-server-with-edge-functions/node_modules/@netlify/fake-module/package.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c770ba0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Benchmark results
c770ba0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Benchmark results