Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Compat Matrix more comprehensive #17303

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 55 additions & 18 deletions src/content/docs/workers/static-assets/compatibility-matrix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,42 @@ import {
Tabs,
} from "~/components";

Cloudflare [Workers with static assets](/workers/static-assets/) and [Pages](/pages/) both have the ability to host front-end and full-stack applications. The following compatibility matrix shows the features are available for each product to help you when choosing which product to start with.
You can deply full-stack applications, including front-end static assets and back-end APIs and server-side rendered pages (SSR), to both Cloudflare [Workers](/workers/static-assets/) and [Pages](/pages/). The compatibility matrix below shows which features are available for each, to help you choose whether to build with Workers or Pages. Unless otherwise stated below, what works in Pages works in Workers, and what works in Workers works in Pages. Think something is missing from this list? [Open a pull request](https://github.com/cloudflare/cloudflare-docs/edit/production/src/content/docs/workers/static-assets/compatibility-matrix.mdx) or [create a GitHub issue](https://github.com/cloudflare/cloudflare-docs/issues/new).
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved

We plan to bridge the gaps between Workers and Pages and provide ways to migrate your Pages projects to Workers.

| | Asset hosting on Workers | Pages |

| | Workers | Pages |
| ----------------------------------------------------------------------------------- | ------------------------ | ----- |
| **Features** | | |
| Middleware | ❌ <sup>1</sup> | ✅ |
| [Redirects](/pages/configuration/redirects/) | ❌ <sup>2</sup> | ✅ |
| [Smart Placement](/workers/configuration/smart-placement/) | ⏳ <sup>3</sup> | ✅ |
| **Writing, Testing, and Deploying Code** | | |
| [Rollbacks](/workers/configuration/versions-and-deployments/rollbacks/) | ✅ | ✅ |
| [Gradual Deployments](/workers/configuration/versions-and-deployments/) | ✅ | ❌ |
| [Preview URLs](/workers/configuration/previews) | ✅ | ✅ |
| [Testing](/workers/testing) | ✅ | ✅ |
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved
| [Local Development](/workers/testing/local-development/) | ✅ | ✅ |
| [Remote Development (`--remote`)](/workers/wrangler/commands/) | ✅ <sup>1</sup> | ❌ |
GregBrimble marked this conversation as resolved.
Show resolved Hide resolved
| [Quick Editor in Dashboard](https://blog.cloudflare.com/improved-quick-edit) | ✅ | ❌ |
| **Static Assets** | | |
| [Early Hints](/pages/configuration/early-hints/) | ❌ | ✅ |
| [Customize HTTP headers of static assets](/pages/configuration/headers/) | 🟡 <sup>2</sup> | ✅ |
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved
| [Middleware](/pages/functions/middleware/) | 🟡 <sup>3</sup> | ✅ |
| [Redirects](/pages/configuration/redirects/) | 🟡 <sup>4</sup> | ✅ |
| [Smart Placement](/workers/configuration/smart-placement/) | ⏳ <sup>5</sup> | ✅ |
| **Observability** | | |
| [Workers Logs](/workers/observability/) | ✅ | ❌ |
| [Logpush](/workers/observability/logs/logpush/) | ✅ | ❌ |
| [Tail Workers](/workers/observability/logs/tail-workers/) | ⏳ <sup>4</sup> | ❌ |
| [Real-time logs](/workers/observability/logs/real-time-logs/) | ✅ | ✅ |
| **Bindings** | | |
| [Logpush](/workers/observability/logs/logpush/) | ✅ | ❌ |
| [Tail Workers](/workers/observability/logs/tail-workers/) | ⏳ <sup>6</sup> | ❌ |
| [Real-time logs](/workers/observability/logs/real-time-logs/) | ✅ | ✅ |
| **Runtime APIs & Compute Models** | | |
| [Node.js Compatibility Mode](/workers/runtime-apis/nodejs/) | ✅ | ✅ |
| [Durable Objects](/durable-objects/api/) | ✅ | 🟡 <sup>7</sup> |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is DO here? Would expect this to be under bindings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A DO is a singleton Worker, as fundamental a compute primitive to the platform as a Worker. We need to stop treating it just as binding but as first-class compute primitive. Can move back to bindings for now from here but it is apples vs. oranges to other bindings.

@vy-ton re: framing, I think we have habit of bucketing DO with other bindings but feels different

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 grouping DO under Runtime APIs, DO team has #17411 (comment) to create Runtime APIs section in DO docs

| [Cron Triggers](/workers/configuration/cron-triggers/) | ✅ | ❌ |
| **Bindings** | | |
| [AI](/workers-ai/get-started/workers-wrangler/#2-connect-your-worker-to-workers-ai) | ✅ | ✅ |
| [Analytics Engine](/analytics/analytics-engine) | ✅ | ✅ |
| [Assets](/workers/static-assets/binding/) | ✅ | ❌ |
GregBrimble marked this conversation as resolved.
Show resolved Hide resolved
| [Browser Rendering](/browser-rendering) | ✅ | ✅ |
| [D1](/d1/build-with-d1/d1-client-api/) | ✅ | ✅ |
| [Durable Objects](/durable-objects/api/) | ✅ | ❌ |
| [Environment Variables](/workers/configuration/environment-variables/) | ✅ | ✅ |
| [Hyperdrive](/hyperdrive/) | ✅ | ❌ |
| [KV](/kv/) | ✅ | ✅ |
Expand All @@ -51,22 +64,46 @@ We plan to bridge the gaps between Workers and Pages and provide ways to migrate
| [Secrets](/workers/configuration/secrets/) | ✅ | ✅ |
| [Service bindings](/workers/runtime-apis/bindings/service-bindings/) | ✅ | ✅ |
| [Vectorize](/vectorize/get-started/intro/#3-bind-your-worker-to-your-index) | ✅ | ✅ |
| **Builds (CI/CD)** | | |
| [Monorepos](/workers/ci-cd/builds/advanced-setups/) | ✅ | ✅ |
| [Build Watch Paths](/pages/configuration/build-watch-paths/) | ❌ | ✅ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added?

| [Deploy Hooks](/pages/configuration/deploy-hooks/) | ❌ | ✅ |
| [Build Caching](/pages/configuration/build-caching/) | ❌ | ✅ |
| [Custom Preview Branches](/pages/configuration/branch-build-controls/) | ❌ | ✅ |
| [Custom Branch Aliases](/pages/how-to/custom-branch-aliases/) | ❌ | ✅ |
| **Pages Functions** | | |
| [File-based Routing](/pages/functions/routing/) | ❌ <sup>8</sup> | ✅ |
| [Pages Plugins](/pages/functions/plugins/) | ❌ <sup>9</sup> | ✅ |


<sup>1</sup> If you need to run a Worker script ahead of serving static assets,
we currently recommend using [Service
<sup>1</sup> For more details on which bindings are supported in remote development, [refer to the docs]((/workers/testing/local-development/#supported-resource-bindings-in-different-environments)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<sup>1</sup> For more details on which bindings are supported in remote development, [refer to the docs]((/workers/testing/local-development/#supported-resource-bindings-in-different-environments)
<sup>1</sup> For more details on which bindings are supported in remote development, [refer to the docs]((/Workers/testing/local-development/#supported-resource-bindings-in-different-environments)

Issues:

  • Style Guide - (Terms-error) Use 'Workers' instead of 'workers'.

Fix Explanation:

The term 'Workers' should be capitalized as it likely refers to a specific product or feature name, which is a common convention in technical documentation. This change aligns with the style guide's requirement for proper noun capitalization. If 'Workers' is indeed a product name, this correction is necessary to maintain consistency and clarity in the documentation. If the style guide does not currently reflect this, it may need updating to ensure all instances are treated consistently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We updated our model to better handle this case. Should be updated soon.

Bill, Hyperlint dev

irvinebroque marked this conversation as resolved.
Show resolved Hide resolved

<sup>2</sup> Similar to <sup>1</sup>, to customize the HTTP headers that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<sup>2</sup> Similar to <sup>1</sup>, to customize the HTTP headers that
<sup>2</sup> Similar to <sup>3</sup>, to customize the HTTP headers that

are returned by static assets, you can use [Service
bindings](/workers/runtime-apis/bindings/service-bindings/) to connect a Worker
in front of the Worker with assets. We plan to explore additional configuration
in front of the Worker with assets.

<sup>3</sup> If you need to run a Worker before serving static assets,
you can create a separate Worker that acts as middleware, and then use [Service
bindings](/workers/runtime-apis/bindings/service-bindings/) to forward the request
to the Worker with assets. We plan to explore additional configuration
to support more complex routing in the future.

<sup>2</sup> You can handle redirects by adding code to your Worker (a
<sup>4</sup> You can handle redirects by adding code to your Worker (a
[community package](https://npmjs.com/package/redirects-in-workers) is available
for `_redirects` support), or you can use [Bulk
Redirects](/rules/url-forwarding/bulk-redirects/).

<sup>3</sup> You cannot yet enable [Smart
Placement](/workers/configuration/smart-placement/) projects with static assets.
<sup>5</sup> You cannot yet enable [Smart
Placement](/workers/configuration/smart-placement/) for Workers with static assets.
This is a temporary limitation, we are working to remove it.
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved

<sup>4</sup> You cannot yet add a [Tail
<sup>6</sup> You cannot yet add a [Tail
Worker](/workers/observability/logs/tail-workers/) to a project with assets.
This is a temporary limitation, we are working to remove it.
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved

<sup>7</sup> To [use Durable Objects with your Cloudflare Pages project](/pages/functions/bindings/#durable-objects), you must create a separate Worker with a Durable Object, and then declare a binding to it in both your Production and Preview environments. Using Durable Objects with Workers is simpler, and recommended.
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved

<sup>8</sup> Workers [supports popular frameworks](/workers/frameworks/), many of which implement file-based routing.

<sup>9</sup> Everything that is possible with Pages Functions, can also be achieved by adding code to your Worker, or using framework-specific plugins for relevant third party tools.
irvinebroque marked this conversation as resolved.
Show resolved Hide resolved
Loading