Skip to content

Commit

Permalink
feat: implement config.define (#1297)
Browse files Browse the repository at this point in the history
This implements `config.define`. This lets the user define a map of keys to strings that will be substituted in the worker's source. This is particularly useful when combined with environments. A common usecase is for values that are sent along with metrics events; environment name, public keys, version numbers, etc. It's also sometimes a runaround for module env vars, which otherwise have to be threaded through request function stacks.
  • Loading branch information
threepointone authored Jun 28, 2022
1 parent e5a6aca commit 40036e2
Show file tree
Hide file tree
Showing 11 changed files with 432 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .changeset/swift-bobcats-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

feat: implement `config.define`

This implements `config.define`. This lets the user define a map of keys to strings that will be substituted in the worker's source. This is particularly useful when combined with environments. A common usecase is for values that are sent along with metrics events; environment name, public keys, version numbers, etc. It's also sometimes a workaround for the usability of module env vars, which otherwise have to be threaded through request function stacks.
Loading

0 comments on commit 40036e2

Please sign in to comment.