Skip to content

Split domain-specific BE code into its own local package #589

@acelaya

Description

@acelaya

For convenience and convention, react router bundles all your server code into one (or one per route) bundle.

That means dev and production code are not available in the exact same way, and make it difficult to have other entry points that can consume shared domain code.

For example, adding a CLI entry point to the project that can consume services, or having a custom server entry point that can check environment variables without duplicating the logic, is challenging.

I have worked around this in some ways, but I think the right solution would be to keep the bare minimum BE code inside the react-router bundles, and make it access the rest of the non-bundled domain code as if it was an external package.

Then, it would be possible to import from there in non-react-router scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions