Skip to content

Extremely low performance on production build #961

@thanh-nguyen-codeleap

Description

@thanh-nguyen-codeleap

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

After converting SPA to Native Federation, the app initial time increase to DOUBLE
SPA
Image
Native Federation
Image

I took a closer look and it seems the Native federation eager loaded every libraries, both local and published libraries.

Current setup for federation apps:
`const {
withNativeFederation,
shareAll,
} = require('@angular-architects/native-federation/config');

module.exports = withNativeFederation({
name: 'sales',

shared: {
...shareAll({
singleton: true,
strictVersion: true,
requiredVersion: 'auto',
}),
},

skip: [
'rxjs/ajax',
'rxjs/fetch',
'rxjs/testing',
'rxjs/webSocket',
'ts-jest',
],

features: {},
});
`

Expected behavior

The app loading speed is the same as SPA

Versions of Native/Module Federation, Angular, Node, Browser, and operating system

Federation: 20.1.6
Angular: 20.3.2

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about the native-federation or mfe architecture

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions