Skip to content

Build Time increased with 20.3.9 #18

Closed

Description

@ladler1

After this fix 20.3.9 the build time increased again. Also with reference to #13 it is this step which takes some time

Image****

for my application around 10 seconds. This seems to be the same times as before version 20.3.8 which was decreased maybe through the bug #17 and now after the fix it is the same but the terminal output shows more information

Activity

  1. Aukevanoost commented on Mar 25, 2026

    @Aukevanoost
    Contributor

    Right, so the rebuilding step is taking 10 seconds?

    The reason is actually pretty simple, the cached files were not being invalidated. That's why it was so fast. Whenever we invalidate a cached file, it is being rebuild by angular.

    if (opts.modifiedFiles) {
    bundleContext.cache.bundlerCache.invalidate(new Set(opts.modifiedFiles));
    }

    So the real issue is, we can't see (yet) with Angular which files are being changed. It happens somewhere deep in Angular. I've created A pull request to share the cache with Angular but right now it's not possible to share the cache, thus files are not automatically invalidated when you change a file.
    angular/angular-cli#32527

    Since we don't know which file changed, our only bet is to invalidate all "source" files. I'd like to know from you, how long does a rebuild take and how many files are being rebuild? you can go to your node_modules/@angular-architects/src/utils/angular-esbuild-adapter.js and set a console.log(opts.modifiedFiles.length) at line 94.

    I hope my PR get's implemented in Angular 22 because it will save us a lot of build time.

  2. ladler1 commented on Mar 26, 2026

    @ladler1
    ContributorAuthor

    Thanks for the explanation. Yes the rebuild takes 10 second. I have added the console logs for time and number of files:

    INFO Re-bundling all internal libraries and exposed modules..'
    Modified files: 1046
    [build] ESBuild rebuild for 'mapping-or-exposed': 10.263s

    Regarding the made observations that sound really promising from my point of view and would be essential for a good development experience.

  3. Aukevanoost commented on Apr 1, 2026

    @Aukevanoost
    Contributor

    Right, thanks! One more question for now, are you using multiple shared internal libraries? Or is this all from a single remote.

  4. ladler1 commented on Apr 2, 2026

    @ladler1
    ContributorAuthor

    the application has one shell and one remote. The shell uses two internal libraries and the remote one. In my federation.config.js I use: sharedMappings: [] to prevent the library from being shared

  5. Aukevanoost commented on Apr 6, 2026

    @Aukevanoost
    Contributor

    Closing this issue for now, keep track on our future enhancements here https://github.com/orgs/native-federation/discussions/36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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