Repository navigation
fix(compiler): walk third party modules #12453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+463
−239
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a sentence: Do not import components/directives from here directly as we want to test that ngc still compiles them.