Skip to content

[FEATURE] Support DurableObjects #207

@mattboardman

Description

@mattboardman

Is your feature request related to a problem?

Currently the documentation suggests using another worker for RPC services and DurableObjects. link

There isn't a documented way to bring the DurableObject into the same worker of a nextjs service.

Describe the solution you'd like

Ideally we can add/import DurableObject classes to an index.ts file in the src/ directory and have those made available in the bundle's worker.js file upon build. This would reduce the need for multiple workers to host a nextjs site with access to DO's. I imagine there would also be performance and latency gains as well (but I don't know enough about the RPC protocol to make that claim for sure).

Describe alternatives you've considered

The alternative right now is to build multiple workers and delegate RPC Services and DurableObject code to those workers.

@opennextjs/cloudflare version

0.3.0

Additional context

No response

Before submitting

  • I have checked that there isn't already a similar feature request
  • This is a single feature (not multiple features in one request)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions