refactor(ivy): make all directives public by default (#25291)

To match the View Engine behavior.

We should make this configurable so that the node injector is tree shaken when
directives do not need to be published.

PR Close #25291
This commit is contained in:
Victor Berchet
2018-08-03 12:20:27 -07:00
committed by Kara Erickson
parent 26a15cc534
commit 1e7ca22078
10 changed files with 119 additions and 35 deletions

View File

@ -158,6 +158,8 @@ export class Identifiers {
static InheritDefinitionFeature:
o.ExternalReference = {name: 'ɵInheritDefinitionFeature', moduleName: CORE};
static PublicFeature: o.ExternalReference = {name: 'ɵPublicFeature', moduleName: CORE};
static listener: o.ExternalReference = {name: 'ɵL', moduleName: CORE};
// Reserve slots for pure functions

View File

@ -67,6 +67,9 @@ function baseDirectiveFields(
// e.g. `features: [NgOnChangesFeature]`
const features: o.Expression[] = [];
// TODO: add `PublicFeature` so that directives get registered to the DI - make this configurable
features.push(o.importExpr(R3.PublicFeature));
if (meta.usesInheritance) {
features.push(o.importExpr(R3.InheritDefinitionFeature));
}