Skip to content

@module-federation/bridge-react - react-router optionality #4191

@crutch12

Description

@crutch12

Clear and concise description of the problem

I don't use react-router

Even if react-router-dom and react-router are marked as optional, these peerDeps are required for base @module-federation/bridge-react usage.

createRemoteAppComponent uses createLazyRemoteComponent, which uses withRouterData, which imports react-router-dom, so react-router-dom sneaks into js bundle

Also current implementation rewrites exportName and basename props, thus I'm not able to pass them (ironic, but I already provide my own basename prop)

Suggested solution

Provide analog for createLazyRemoteComponent and createRemoteAppComponent which wouldn't require react-router import

Example:

import { createRemoteAppComponent } from '@module-federation/bridge-react/base' // "react-router free", just render()

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions