-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): walk third party modules (#12453)
- Loading branch information
Showing
24 changed files
with
463 additions
and
239 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
modules/@angular/compiler-cli/integrationtest/src/comp_using_3rdp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'use-third-party', | ||
template: '<third-party-comp [thirdParty]="title"></third-party-comp>' + | ||
'<another-third-party-comp></another-third-party-comp>', | ||
}) | ||
export class ComponentUsingThirdParty { | ||
title: string = 'from 3rd party'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
modules/@angular/compiler-cli/integrationtest/third_party_src/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This folder emulates consuming precompiled modules and components. | ||
It is compiled separately from the other sources under `src` | ||
to only generate `*.js` / `*.d.ts` / `*.metadata.json` files, | ||
but no `*.ngfactory.ts` files. | ||
|
||
** WARNING ** | ||
Do not import components/directives from here directly as we want to test that ngc still compiles | ||
them when they are not imported. |
16 changes: 16 additions & 0 deletions
16
modules/@angular/compiler-cli/integrationtest/third_party_src/comp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'third-party-comp', | ||
template: '<div>3rdP-component</div>', | ||
}) | ||
export class ThirdPartyComponent { | ||
} |
17 changes: 17 additions & 0 deletions
17
modules/@angular/compiler-cli/integrationtest/third_party_src/directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Directive, Input} from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[thirdParty]', | ||
host: {'[title]': 'thirdParty'}, | ||
}) | ||
export class ThirdPartyDirective { | ||
@Input() thirdParty: string; | ||
} |
28 changes: 28 additions & 0 deletions
28
modules/@angular/compiler-cli/integrationtest/third_party_src/module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {NgModule} from '@angular/core'; | ||
|
||
import {ThirdPartyComponent} from './comp'; | ||
import {ThirdPartyDirective} from './directive'; | ||
import {AnotherThirdPartyModule} from './other_module'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ThirdPartyComponent, | ||
ThirdPartyDirective, | ||
], | ||
exports: [ | ||
AnotherThirdPartyModule, | ||
ThirdPartyComponent, | ||
ThirdPartyDirective, | ||
], | ||
imports: [AnotherThirdPartyModule] | ||
}) | ||
export class ThirdpartyModule { | ||
} |
16 changes: 16 additions & 0 deletions
16
modules/@angular/compiler-cli/integrationtest/third_party_src/other_comp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'another-third-party-comp', | ||
template: '<div i18n>other-3rdP-component</div>', | ||
}) | ||
export class AnotherThirdpartyComponent { | ||
} |
17 changes: 17 additions & 0 deletions
17
modules/@angular/compiler-cli/integrationtest/third_party_src/other_module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {NgModule} from '@angular/core'; | ||
import {AnotherThirdpartyComponent} from './other_comp'; | ||
|
||
@NgModule({ | ||
declarations: [AnotherThirdpartyComponent], | ||
exports: [AnotherThirdpartyComponent], | ||
}) | ||
export class AnotherThirdPartyModule { | ||
} |
20 changes: 20 additions & 0 deletions
20
modules/@angular/compiler-cli/integrationtest/third_party_src/tsconfig-build.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"angularCompilerOptions": { | ||
// For TypeScript 1.8, we have to lay out generated files | ||
// in the same source directory with your code. | ||
"genDir": ".", | ||
"debug": true | ||
}, | ||
|
||
"compilerOptions": { | ||
"target": "es5", | ||
"experimentalDecorators": true, | ||
"noImplicitAny": true, | ||
"moduleResolution": "node", | ||
"rootDir": "", | ||
"declaration": true, | ||
"lib": ["es6", "dom"], | ||
"baseUrl": ".", | ||
"outDir": "../node_modules/third_party" | ||
} | ||
} |
Oops, something went wrong.