summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexander Niebuhr <alexander@nbhr.io> 2024-03-22 09:00:45 +0100
committerGravatar GitHub <noreply@github.com> 2024-03-22 09:00:45 +0100
commita2d19b990d3f9dcdd1c81539958def4f131635c5 (patch)
treeb321d54527dc70eb8ae2bbc8624ab08d78f643aa
parent95f88e5014e085d6567e81c0c67509afc082ad2a (diff)
downloadastro-a2d19b990d3f9dcdd1c81539958def4f131635c5.tar.gz
astro-a2d19b990d3f9dcdd1c81539958def4f131635c5.tar.zst
astro-a2d19b990d3f9dcdd1c81539958def4f131635c5.zip
chore(cloudflare): add deprecated tags (#192)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
-rw-r--r--packages/integrations/cloudflare/src/index.ts26
1 files changed, 16 insertions, 10 deletions
diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts
index 511b85452..d27a46f78 100644
--- a/packages/integrations/cloudflare/src/index.ts
+++ b/packages/integrations/cloudflare/src/index.ts
@@ -21,25 +21,31 @@ import { wasmModuleLoader } from './utils/wasm-module-loader.js';
export type { AdvancedRuntime } from './entrypoints/server.advanced.js';
export type { DirectoryRuntime } from './entrypoints/server.directory.js';
export type Options = {
+ /**
+ * @deprecated Removed in v10. The 'directory' mode was discontinued because it redundantly bundles code, slowing down your site. Prefer using Astro API Endpoints over `/functions`. The new default mode is 'advanced'.
+ */
mode?: 'directory' | 'advanced';
+ /**
+ * @deprecated Removed in v10. This setting is obsolete as Cloudflare handles all functions in a single execution context, negating the need for multiple functions per project.
+ */
functionPerRoute?: boolean;
imageService?: 'passthrough' | 'cloudflare' | 'compile';
- /** Configure automatic `routes.json` generation */
routes?: {
- /** Strategy for generating `include` and `exclude` patterns
- * - `auto`: Will use the strategy that generates the least amount of entries.
- * - `include`: For each page or endpoint in your application that is not prerendered, an entry in the `include` array will be generated. For each page that is prerendered and whoose path is matched by an `include` entry, an entry in the `exclude` array will be generated.
- * - `exclude`: One `"/*"` entry in the `include` array will be generated. For each page that is prerendered, an entry in the `exclude` array will be generated.
- * */
+ /**
+ * @deprecated Removed in v10. You will have two options going forward, using auto generated `_route.json` file or provide your own one in `public/_routes.json`. The previous method caused confusion and inconsistencies.
+ */
strategy?: 'auto' | 'include' | 'exclude';
- /** Additional `include` patterns */
+ /**
+ * @deprecated Removed in v10. Use `routes.extend.include` instead.
+ */
include?: string[];
- /** Additional `exclude` patterns */
+ /**
+ * @deprecated Removed in v10. Use `routes.extend.exclude` instead.
+ */
exclude?: string[];
};
/**
- * { mode: 'off' }: current behaviour (wrangler is needed)
- * { mode: 'local', ... }: adds cf request object, locals bindings, env vars/secrets which are defined by the user to `astro.dev` with `Astro.locals.runtime` / `context.locals.runtime`
+ * @deprecated Removed in v10. Configure bindings in `wrangler.toml`. Leveraging Cloudflare's API simplifies setup and ensures full compatibility with Wrangler configurations. Use `platformProxy` instead.
*/
runtime?:
| { mode: 'off' }