-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add setFiles()
method
#28
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
Conversation
✅ Deploy Preview for blobs-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Looks good generally, left some notes.
package.json
Outdated
@@ -63,6 +63,7 @@ | |||
"node": "^14.16.0 || >=16.0.0" | |||
}, | |||
"dependencies": { | |||
"esbuild": "0.18.17" | |||
"esbuild": "0.18.17", |
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.
should esbuild
be listed as a prod dependency?
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.
Definitely not! Moved to devDependencies
in 43b40b6.
src/main.ts
Outdated
const payload = JSON.stringify(data) | ||
const headers = { | ||
...Blobs.getTTLHeaders(ttl), | ||
...Blobs.getExpirationeaders(expiration), |
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.
...Blobs.getExpirationeaders(expiration), | |
...Blobs.getExpirationHeaders(expiration), |
this typo is also in a bunch of other places
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.
Oof! Fixed in 06e362f.
@@ -63,6 +63,7 @@ | |||
"node": "^14.16.0 || >=16.0.0" | |||
}, | |||
"dependencies": { | |||
"esbuild": "0.18.17" | |||
"esbuild": "0.18.17", | |||
"p-map": "^6.0.0" |
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.
Have you tested this with Edge Functions?
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.
Not yet, but I know that introducing a npm module will change the game. My plan is to stop publishing a Deno module from this repo and instead load the Node.js module into the bootstrap layer using https://esm.sh. We're vendoring the module anyway, so it shouldn't matter whether we vendor it from Netlify or an external source.
Which problem is this pull request solving?
Adds a
setFiles()
method, which lets consumers write multiple keys from files concurrently, with a configurable concurrency level.It also renames the
ttl
toexpiration
, because I feel it's clearer and more accurate.I've also done a pretty large refactoring of the test suite, adding a
MockFetch
utility that simplifies the tests, and adding tests for the edge flow.For this reason, I recommend reviewing the commits separately.