Skip to content

Commit

Permalink
C3: Add Smart Placement examle to wrangler.toml templates (#5684)
Browse files Browse the repository at this point in the history
  • Loading branch information
jculvey authored Apr 23, 2024
1 parent a7e36d5 commit c81fa65
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-meals-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": patch
---

docs: Add Smart Placement example to `wrangler.toml` of templates.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = "./dist/analog/public"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Note: Use secrets to store sensitive data.
# Docs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = "./dist"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/common/js/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.js"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/common/ts/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ main = "src/entry.py"
compatibility_flags = ["python_workers"]
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ main = "src/index.js"
compatibility_date = "<TBD>"
compatibility_flags = ["nodejs_compat"]

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ main = "src/index.ts"
compatibility_date = "<TBD>"
compatibility_flags = ["nodejs_compat"]

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/next/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ compatibility_date = "<TBD>"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = "./dist"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/openapi/ts/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/queues/js/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.js"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/queues/ts/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
main = "src/index.ts"
compatibility_date = "<TBD>"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = "./dist"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = "./build/client"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ compatibility_date = "<TBD>"
[triggers]
crons = ["* * * * *"] # * * * * * = run every minute

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ compatibility_date = "<TBD>"
[triggers]
crons = ["* * * * *"] # * * * * * = run every minute

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ compatibility_date = "<TBD>"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = "./dist"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Note: Use secrets to store sensitive data.
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/svelte/js/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = ".svelte-kit/cloudflare"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down
7 changes: 7 additions & 0 deletions packages/create-cloudflare/templates/svelte/ts/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "<TBD>"
compatibility_date = "<TBD>"
pages_build_output_dir = ".svelte-kit/cloudflare"

# Automatically place your workloads in an optimal location to minimize latency.
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure
# rather than the end user may result in better performance.
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement
# [placement]
# mode = "smart"

# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Docs:
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables
Expand Down

0 comments on commit c81fa65

Please sign in to comment.