diff --git a/.changeset/wise-meals-enjoy.md b/.changeset/wise-meals-enjoy.md new file mode 100644 index 000000000000..786a4a5a39fc --- /dev/null +++ b/.changeset/wise-meals-enjoy.md @@ -0,0 +1,5 @@ +--- +"create-cloudflare": patch +--- + +docs: Add Smart Placement example to `wrangler.toml` of templates. diff --git a/packages/create-cloudflare/templates/analog/templates/wrangler.toml b/packages/create-cloudflare/templates/analog/templates/wrangler.toml index 57bb6bb1fada..66c7aea327f6 100644 --- a/packages/create-cloudflare/templates/analog/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/analog/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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: diff --git a/packages/create-cloudflare/templates/astro/templates/wrangler.toml b/packages/create-cloudflare/templates/astro/templates/wrangler.toml index a85989eb4394..a03a506b7081 100644 --- a/packages/create-cloudflare/templates/astro/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/astro/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/common/js/wrangler.toml b/packages/create-cloudflare/templates/common/js/wrangler.toml index 8bd4d0ba1758..fabfabe7cdd6 100644 --- a/packages/create-cloudflare/templates/common/js/wrangler.toml +++ b/packages/create-cloudflare/templates/common/js/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.js" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/common/ts/wrangler.toml b/packages/create-cloudflare/templates/common/ts/wrangler.toml index b5a35826d0e6..8d570a896fe7 100644 --- a/packages/create-cloudflare/templates/common/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/common/ts/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/hello-world-durable-object/js/wrangler.toml b/packages/create-cloudflare/templates/hello-world-durable-object/js/wrangler.toml index 48117bd21ffb..d59165f983ff 100644 --- a/packages/create-cloudflare/templates/hello-world-durable-object/js/wrangler.toml +++ b/packages/create-cloudflare/templates/hello-world-durable-object/js/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/hello-world-durable-object/ts/wrangler.toml b/packages/create-cloudflare/templates/hello-world-durable-object/ts/wrangler.toml index 2591cbe997d7..3e46d32e5612 100644 --- a/packages/create-cloudflare/templates/hello-world-durable-object/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/hello-world-durable-object/ts/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/hello-world-python/py/wrangler.toml b/packages/create-cloudflare/templates/hello-world-python/py/wrangler.toml index cc2ddbfcb6d0..3dd3e8ffd8a5 100644 --- a/packages/create-cloudflare/templates/hello-world-python/py/wrangler.toml +++ b/packages/create-cloudflare/templates/hello-world-python/py/wrangler.toml @@ -4,6 +4,13 @@ main = "src/entry.py" compatibility_flags = ["python_workers"] compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/hello-world/js/wrangler.toml b/packages/create-cloudflare/templates/hello-world/js/wrangler.toml index bd11707a12ba..38643b7f2e9d 100644 --- a/packages/create-cloudflare/templates/hello-world/js/wrangler.toml +++ b/packages/create-cloudflare/templates/hello-world/js/wrangler.toml @@ -4,6 +4,13 @@ main = "src/index.js" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/hello-world/ts/wrangler.toml b/packages/create-cloudflare/templates/hello-world/ts/wrangler.toml index bc07a94b8edc..a6b6c354f3f7 100644 --- a/packages/create-cloudflare/templates/hello-world/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/hello-world/ts/wrangler.toml @@ -4,6 +4,13 @@ main = "src/index.ts" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/hono/templates/wrangler.toml b/packages/create-cloudflare/templates/hono/templates/wrangler.toml index b5a35826d0e6..8d570a896fe7 100644 --- a/packages/create-cloudflare/templates/hono/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/hono/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/next/wrangler.toml b/packages/create-cloudflare/templates/next/wrangler.toml index 816fcbace77a..ba50a9ccd891 100644 --- a/packages/create-cloudflare/templates/next/wrangler.toml +++ b/packages/create-cloudflare/templates/next/wrangler.toml @@ -4,6 +4,13 @@ compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/nuxt/templates/wrangler.toml b/packages/create-cloudflare/templates/nuxt/templates/wrangler.toml index a85989eb4394..a03a506b7081 100644 --- a/packages/create-cloudflare/templates/nuxt/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/nuxt/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/openapi/ts/wrangler.toml b/packages/create-cloudflare/templates/openapi/ts/wrangler.toml index b5a35826d0e6..8d570a896fe7 100644 --- a/packages/create-cloudflare/templates/openapi/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/openapi/ts/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/queues/js/wrangler.toml b/packages/create-cloudflare/templates/queues/js/wrangler.toml index 708265e84a04..ab028dbf52a9 100644 --- a/packages/create-cloudflare/templates/queues/js/wrangler.toml +++ b/packages/create-cloudflare/templates/queues/js/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.js" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/queues/ts/wrangler.toml b/packages/create-cloudflare/templates/queues/ts/wrangler.toml index a47c0eec141d..9255e837d62c 100644 --- a/packages/create-cloudflare/templates/queues/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/queues/ts/wrangler.toml @@ -3,6 +3,13 @@ name = "" main = "src/index.ts" compatibility_date = "" +# 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 diff --git a/packages/create-cloudflare/templates/qwik/templates/wrangler.toml b/packages/create-cloudflare/templates/qwik/templates/wrangler.toml index a85989eb4394..a03a506b7081 100644 --- a/packages/create-cloudflare/templates/qwik/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/qwik/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/remix/templates/wrangler.toml b/packages/create-cloudflare/templates/remix/templates/wrangler.toml index 3505faf2e384..b9d3a0857c58 100644 --- a/packages/create-cloudflare/templates/remix/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/remix/templates/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/scheduled/js/wrangler.toml b/packages/create-cloudflare/templates/scheduled/js/wrangler.toml index 3cd13677b91a..bd01a5082d29 100644 --- a/packages/create-cloudflare/templates/scheduled/js/wrangler.toml +++ b/packages/create-cloudflare/templates/scheduled/js/wrangler.toml @@ -9,6 +9,13 @@ compatibility_date = "" [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 diff --git a/packages/create-cloudflare/templates/scheduled/ts/wrangler.toml b/packages/create-cloudflare/templates/scheduled/ts/wrangler.toml index b24cff556313..c875484bffc6 100644 --- a/packages/create-cloudflare/templates/scheduled/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/scheduled/ts/wrangler.toml @@ -9,6 +9,13 @@ compatibility_date = "" [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 diff --git a/packages/create-cloudflare/templates/solid/templates/wrangler.toml b/packages/create-cloudflare/templates/solid/templates/wrangler.toml index b1be3c60ed41..f59e21bb24a5 100644 --- a/packages/create-cloudflare/templates/solid/templates/wrangler.toml +++ b/packages/create-cloudflare/templates/solid/templates/wrangler.toml @@ -4,6 +4,13 @@ compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/svelte/js/wrangler.toml b/packages/create-cloudflare/templates/svelte/js/wrangler.toml index 969a266f24f7..cfddde978c0a 100644 --- a/packages/create-cloudflare/templates/svelte/js/wrangler.toml +++ b/packages/create-cloudflare/templates/svelte/js/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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 diff --git a/packages/create-cloudflare/templates/svelte/ts/wrangler.toml b/packages/create-cloudflare/templates/svelte/ts/wrangler.toml index 969a266f24f7..cfddde978c0a 100644 --- a/packages/create-cloudflare/templates/svelte/ts/wrangler.toml +++ b/packages/create-cloudflare/templates/svelte/ts/wrangler.toml @@ -3,6 +3,13 @@ name = "" compatibility_date = "" 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