Skip to content

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented May 31, 2025

Fixes #241.

This pull request introduces support for Cloudflare Workers in the Fedify library, along with updates to documentation, dependencies, and test cases. The main changes include the addition of new classes and methods for Cloudflare Workers integration, updates to the configuration files to include necessary dependencies, and enhancements to the documentation to guide users on using the new features.

Cloudflare Workers support:

  • Added WorkersKvStore and WorkersMessageQueue classes for Cloudflare Workers, providing key–value storage and message queue functionality. These are documented in docs/manual/kv.md and docs/manual/mq.md. [1] [2] [3]
  • Introduced the Federation.processQueuedTask() method to handle queued tasks in environments like Cloudflare Workers.

Documentation updates:

  • Expanded documentation to include usage examples and notes for WorkersKvStore and WorkersMessageQueue. [1] [2]
  • Updated CHANGES.md to reflect the new features and their availability starting from version 1.6.0.

Dependency and configuration updates:

  • Added @cloudflare/workers-types and updated typescript to version 5.8.3 in docs/package.json and docs/pnpm-lock.yaml. [1] [2] [3] [4] [5]
  • Updated fedify/deno.json to include mappings for Cloudflare Workers modules.

Code enhancements:

  • Modified FederationImpl to use processQueuedTask() for inbox and outbox queue processing. [1] [2]
  • Added support for handling queue events in fedify/cfworkers/server.ts.

Test updates:

  • Updated test cases to include explicit type assertions for Request objects. [1] [2] [3] [4]

@dahlia dahlia added this to the Fedify 1.6 milestone May 31, 2025
@dahlia dahlia requested a review from Copilot May 31, 2025 02:10
@dahlia dahlia self-assigned this May 31, 2025
@dahlia dahlia added type/enhancement Improvements to existing features type/feature Requests for new features component/kv Key–value store related component/mq Message queue related runtime/cfworkers Cloudflare Workers runtime related status/in progress In progress labels May 31, 2025

This comment was marked as resolved.

@dahlia dahlia temporarily deployed to github-pages May 31, 2025 02:22 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch from 3b03b99 to ae33fee Compare May 31, 2025 02:24
@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2025

The docs for this pull request have been published:

https://6091285c.fedify.pages.dev

@dahlia dahlia temporarily deployed to github-pages May 31, 2025 02:36 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch 2 times, most recently from 161d4f5 to 9674ec2 Compare May 31, 2025 03:55
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 04:07 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch from 0aad6d7 to d6f3749 Compare May 31, 2025 06:08
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 06:19 — with Image GitHub Actions Inactive
@dahlia dahlia requested a review from Copilot May 31, 2025 09:01

This comment was marked as resolved.

@dahlia dahlia temporarily deployed to github-pages May 31, 2025 09:12 — with Image GitHub Actions Inactive
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 11:22 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch from 7ae7ab4 to 48613a8 Compare May 31, 2025 12:09
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 12:21 — with Image GitHub Actions Inactive
@dahlia dahlia marked this pull request as ready for review May 31, 2025 12:26
@dahlia dahlia force-pushed the cloudflare-workers branch from 48613a8 to c2f6d66 Compare May 31, 2025 12:34
@dahlia dahlia added status/ready for review Ready for review and removed status/in progress In progress labels May 31, 2025
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 12:45 — with Image GitHub Actions Inactive
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 15:22 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch from 1c6f829 to a020557 Compare May 31, 2025 16:08
@dahlia dahlia temporarily deployed to github-pages May 31, 2025 16:20 — with Image GitHub Actions Inactive
@dahlia dahlia force-pushed the cloudflare-workers branch from a020557 to d7cb9ef Compare May 31, 2025 17:05
@github-actions
Copy link
Contributor

The latest push to this pull request has been published to JSR and npm as a pre-release:

@dahlia dahlia temporarily deployed to github-pages May 31, 2025 17:18 — with Image GitHub Actions Inactive
@dahlia
Copy link
Member Author

dahlia commented May 31, 2025

We need to test if a new npm package works well with Hollo.

@dahlia
Copy link
Member Author

dahlia commented May 31, 2025

Okay, now I'm pretty sure that it works on every runtime we support.

@dahlia dahlia merged commit ca12a15 into fedify-dev:main May 31, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/kv Key–value store related component/mq Message queue related runtime/cfworkers Cloudflare Workers runtime related status/ready for review Ready for review type/enhancement Improvements to existing features type/feature Requests for new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@fedify/fedify/x/cfworkers module

1 participant