core icon indicating copy to clipboard operation
core copied to clipboard

Support Ivy partial compilation

Open a1russell opened this issue 3 years ago • 3 comments

It would be great if ui-router/core would be updated to support Ivy partial compilation as described in this Angular blog post.

In the codebase I work on, ui-router/core is the only dependency that generates this message during build: @uirouter/core [module/esm5] (https://github.com/ui-router/core.git)

To us, this isn't just a warning, as we do not use npm, and we encounter this bug: https://github.com/angular/angular-cli/issues/16980

Please also update @uirouter/angularjs since that package still has a very specific dependency on core.

Thank you so much.

a1russell avatar Mar 28 '22 21:03 a1russell

I'm also struggling with this issue. Can you please update when it is going to be updated to support Ivy partial compilation?

rina-maslova avatar May 25 '22 12:05 rina-maslova

+1

MortenKJ avatar Aug 22 '22 08:08 MortenKJ

+1

YanerTavuz avatar Sep 13 '22 15:09 YanerTavuz

@christopherthielen @ranihorev @wawyed this repo seems almost like it's not being maintained anymore/abandoned.

Could I please kindly have:

  • a rough ETA on whether this is going to be addressed, as Ivy has been out for a long time now and this is the only library I have that is still not using Ivy
  • if not an ETA, an assurance/expectation that if I create a PR to fix this, it will be merged?

I'm willing to submit a PR to resolve the problem, but we don't want people to start relying on our fixed fork. Your answer will help me decide if the fork needs to be public/private.

Thanks

jpike88 avatar Nov 04 '22 05:11 jpike88

@jpike88 I'm happy to review and merge the PR if you create one :)

wawyed avatar Nov 10 '22 16:11 wawyed

@jpike88 do you know how Angular Compiler determines what exactly should be compiled with ngcc and what is not? ui-router/core seems not have anything special for angular. It's framework-agnostic. But angular is still trying to compile it anyway. I don't really want to dig into angular compiler sources to understand what causes this package to be compiled, maybe you can point me in the right direction?

timofei-iatsenko avatar Feb 27 '23 16:02 timofei-iatsenko

It is because of this file: https://github.com/ui-router/core/blob/306f2b3cfb78b8a81fa47bc40511e83c0ac39161/src/index.metadata.json

That is a View Engine manifest file that ngcc detects. It should be removed to stop ngcc from processing the package, or alternatively this package could add an ngcc.config.js file next to package.json:

module.exports = {
  entryPoints: {
    '.': {
      ignore: true
    },
  }
};

For projects that want to configure this manually, until @uirouter/core is updated, it's also possible to include ngcc.config.json in your own project with the following contents:

module.exports = {
  packages: {
    '@uirouter/core': {
        entryPoints: {
          '.': {
            ignore: true
          },
        }
    }
  }
};

JoostK avatar Mar 10 '23 23:03 JoostK

@JoostK Thanks for the explanation. Do you think there is any risk to removing index.metadata.json?

TBH I have no memory of adding that file 5 years ago, heh.

christopherthielen avatar Mar 11 '23 00:03 christopherthielen

I have no clue, to be honest. View Engine is only potentially relevant for Angular 12 and older, with Ivy having become the default in v9 even. All supported Angular versions are now always Ivy, so removing that file will not have any effect for recent versions.

JoostK avatar Mar 11 '23 00:03 JoostK

released in version 6.1.0

christopherthielen avatar Mar 11 '23 01:03 christopherthielen