Skip to content

ModuleFederationPluginV2 causes extremely slow app startup on Android mid-range devices #1325Β #1329

@hndc9x

Description

@hndc9x

Describe the bug

Description

We are experiencing severe performance issues when using ModuleFederationPluginV2 in a React Native application with Re.Pack. The app startup time increases dramatically, especially on mid-range Android devices.

Environment

  • Re.Pack version: 5.x (latest)
  • React Native: 0.79+
  • React: 19.x
  • @module-federation/runtime: latest
  • Platform: Android (iOS is less affected)
  • Bundler: Rspack
  • Device: Mid-range Android devices (e.g., Samsung A series, Xiaomi Redmi)

Problems Encountered

1. 🐒 Slow App Startup with ModuleFederationPluginV2

When using ModuleFederationPluginV2 with a large number of shared dependencies (15-30+ packages), the app startup time increases by 5-15+ seconds on mid-range Android devices.

Current config example:

new Repack.plugins.ModuleFederationPluginV2({
  name: "loyalty",
  dts: false,
  remotes: STANDALONE
    ? {
        InvoicePayment: `InvoicePayment@http://localhost:9000/${platform}/mf-manifest.json`,
        HelpCenter: `HelpCenter@http://localhost:9001/${platform}/mf-manifest.json`,
        TrackingOrder: `TrackingOrder@http://localhost:9002/${platform}/mf-manifest.json`,
        MWGShop: `MWGShop@http://localhost:9003/${platform}/mf-manifest.json`,
        UtilityServices: `UtilityServices@http://localhost:9004/${platform}/mf-manifest.json`,
        DMX: `DMX@http://localhost:9003/${platform}/mf-manifest.json`,
        PaymentGateway: `PaymentGateway@http://localhost:8000/${platform}/mf-manifest.json`,
      }
    : {
        InvoicePayment: `[email protected]`,
        HelpCenter: `[email protected]`,
        TrackingOrder: `[email protected]`,
        MWGShop: `[email protected]`,
        UtilityServices: `[email protected]`,
        DMX: `[email protected]`,
        PaymentGateway: `[email protected]`,
      },
  shared: {
    ...getSharedDependencies({ eager: true, bundle: false }),
    "react-native-webrtc": { singleton: true, eager: true },
  },
})

### System Info

```shell
npx react-native info

Re.Pack Version

5.2.1

Reproduction

url

Steps to reproduce

Steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:newNew issue, not reviewed by the team yet.type:bugA bug report.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions