Repository navigation
feat(@ngtools/webpack): add NGCC as part of the workflow - #13968
Conversation
|
Blocked until the framework release the NGCC API in the next beta version. |
petebacondarwin
left a comment
There was a problem hiding this comment.
Generally looks like it should work :-)
|
@alan-agius4 could you include the reasoning for not having ngtsc be in change of running ngcc, that you mention from the sync meeting? Discussed in standup this morning and @kara and @mhevery think it's an interesting idea to run it this way |
|
@alexeagle the main reasoning that I got for not doing this was not to make ngtsc dependent on ngcc. Though maybe there is more to it @petebacondarwin & @alxhub would know more. Also this won’t be transparent for us, as ngtsc will need to return the packages that have been transformed by ngcc so that we can purge them from cache. |
|
This PR is effectively getting ngtsc to trigger ngcc. Already the CLI is providing a specially configured TypeScript Here we are adding additional customisation to this The alternative of adding some kind of flag to the
|
|
Not to disagree with the other points, but running ngcc transparently and only when needed isn't a use case that is specific to the CLI. It would in fact be the better way of running ngcc overall. |
|
Thinking about it some more I also do not understand the maintenance argument. As it stands the maintenance cost for But any usage is completely bound to the API exposed by This is to say that confining maintenance cost to |
|
Thanks for your input @filipesilva. What you say makes a lot of sense. There is definitely value in avoiding significant external configuration of ngtsc for build tools like webpack. We designed ngcc as a standalone tool in the first place to avoid having to publish multiple integrations with build tools (of which webpack is one). I think the concern is that each integration might need to configure things (like the My understanding is that the life of ngcc is only until we have moved to ivy as the default, at which point we would expect libraries to start publishing their distributables compiled for ivy directly. Despite all of this, I wonder if it might be worth publishing a wrapper around ngc/ngtsc, which basically does the customisation of the |
|
I think combining the two tools is the wrong approach, because their missions and requirements are so different.
Combining the two would require I also disagree that running ngcc-on-demand via a hook in the |
|
Need to update latest-versions.ts to beta.10 also? |
|
@alexeagle It should not be needed as ~8.0.0-beta.9 does pick up beta.10 |
This is to avoid circular imports
When add module is resolved, it will try to convert the module using the `NGCC` API. NGCC will be run hooked to the compiler during the module resolution, using the Compiler Host methods 'resolveTypeReferenceDirectives' and 'resolveModuleNames'. It will process a single entry for each module and is based on the first match from the Webpack mainFields. When Ivy is enabled we also append the '_ivy_ngcc' suffixed properties to the mainFields so that Webpack resolver will resolve ngcc processed modules first.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat(@schematics/angular): remove ivy-ngcc postinstall script from new application
refactor(@ngtools/webpack): move interfaces to separate file
This is to avoid circular imports
feat(@ngtools/webpack): add NGCC as part of the workflow …
When add module is resolved, it will try to convert the module using the
NGCCAPI.test: add e2e test for ivy opt-out
refactor(@angular-devkit/build-angular): use
@ngtools/webpackgetMainFields helper