-
Notifications
You must be signed in to change notification settings - Fork 335
feat: Support KV Namespace Configuration #334
Conversation
beff971
to
ddb663c
Compare
rebased onto master. no merge conflicts |
ddb663c
to
34b3e60
Compare
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.
LGTM. Added a few nit comments, but you can ignore if you don't agree.
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.
Just some small stuff; a few suggestions. Looks great overall!
src/settings/project/mod.rs
Outdated
match &self.kv_namespaces { | ||
Some(kv) => kv.clone(), | ||
None => Vec::new(), | ||
} |
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.
this can be written
self.kv_namespaces.cloned().unwrap_or_else(Vec::new)
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.
i hope you meant .clone()
bc .cloned()
gave me many complaints.
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.
no, i meant cloned: https://doc.rust-lang.org/std/option/enum.Option.html#method.cloned
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.
f027158
to
f4a8386
Compare
@ashleymichal can you add some details about what this PR is, so that I can document it in the CHANGELOG when it's merged? |
@@ -143,6 +143,17 @@ There are two types of configuration that `wrangler` uses: global user and per p | |||
This key is optional if you are using a workers.dev subdomain and is only required for `publish --release`. | |||
- `webpack_config`: This is the path to the webpack configuration file for your worker. This is optional and | |||
defaults to `webpack.config.js` | |||
- `[[kv-namespaces]]`: These specify any [Workers KV](https://workers.cloudflare.com/docs/reference/storage/) namespaces you want to access from |
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.
we should explicitly call out that users are expected to make their namespace in the UI
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.
added commit for this, also points to docs showing API call.
* use serde renames instead of silencing clippy warning in Binding * derive PartialEq for KvNamespace rather than impl'ing manually * pass &Path instead of PathBuf to get_project_config * unwrap_or_else kv_namespaces instead of matching
2a1156b
to
e68a6aa
Compare
Builds on #329 (merge that first)
Closes #273 #92