Skip to content

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

Merged
merged 9 commits into from
Jul 31, 2023
Merged

feat: add setFiles() method #28

merged 9 commits into from
Jul 31, 2023

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Jul 30, 2023

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 to expiration, 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.

@eduardoboucas eduardoboucas requested a review from a team as a code owner July 30, 2023 11:02
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 30, 2023
@netlify
Copy link

netlify bot commented Jul 30, 2023

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 06e362f
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/64c7c3e66b6838000802d0b1
😎 Deploy Preview https://deploy-preview-28--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@eduardoboucas eduardoboucas requested review from ascorbic and Skn0tt July 31, 2023 14:11
Skn0tt
Skn0tt previously approved these changes Jul 31, 2023
Copy link
Contributor

@Skn0tt Skn0tt left a 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",
Copy link
Contributor

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?

Copy link
Member Author

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),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
...Blobs.getExpirationeaders(expiration),
...Blobs.getExpirationHeaders(expiration),

this typo is also in a bunch of other places

Copy link
Member Author

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"
Copy link
Contributor

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?

Copy link
Member Author

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.

@eduardoboucas eduardoboucas requested a review from Skn0tt July 31, 2023 14:27
@eduardoboucas eduardoboucas merged commit fd769de into main Jul 31, 2023
@eduardoboucas eduardoboucas deleted the feat/set-files branch October 24, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants