-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disable internal
emitDecoratorMetadata
t the moment, we are always setting `emitDecoratorMetadata`, this causes a problem in ES2015 when using `forwardRef`. With #1401 `emitDecoratorMetadata` is no longer needed unless using `tsickle`. `createEmitCallback` has been updated for this reason and also their is a PR for compiler-cli to do the same angular/angular#32880
- Loading branch information
1 parent
db5ad68
commit d0bf507
Showing
9 changed files
with
124 additions
and
37 deletions.
There are no files selected for viewing
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,15 @@ | ||
Sample library: Core folder layout | ||
================================== | ||
|
||
Folder layout from [Angulare core packages](https://github.com/angular/angular/blob/master/packages/core/public_api.ts): | ||
|
||
``` | ||
|- package.json | ||
|- public_api.ts | ||
|- src | ||
|- module.ts | ||
|- foo | ||
|- foo.ts | ||
|- bar | ||
|- bar.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,6 @@ | ||
{ | ||
"$schema": "../../../src/ng-package.schema.json", | ||
"lib": { | ||
"entryFile": "public_api.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,20 @@ | ||
{ | ||
"name": "@sample/ctor-decorator", | ||
"description": "A sample library with folder layout from Angular ctor-decorator packages", | ||
"version": "1.0.0-pre.0", | ||
"private": true, | ||
"repository": "https://github.com/ng-packagr/ng-packagr.git", | ||
"sideEffects": true, | ||
"peerDependencies": { | ||
"@angular/common": "^4.1.3", | ||
"@angular/core": "^4.1.3", | ||
"@angular/router": "^4.1.3", | ||
"@angular/http": "^4.1.3", | ||
"rxjs": "^5.0.1", | ||
"zone.js": "^0.8.4" | ||
}, | ||
"scripts": { | ||
"test": | ||
"../../../node_modules/.bin/cross-env TS_NODE_PROJECT=../../../integration/tsconfig.specs.json ../../../node_modules/.bin/mocha --compilers ts:ts-node/register specs/**/*.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,2 @@ | ||
export * from './src/angular.component'; | ||
export * from './src/angular.module'; |
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,27 @@ | ||
import { expect } from 'chai'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
describe(`@sample/ctor-decorator`, () => { | ||
describe(`fesm2015/ctor-decorator.js`, () => { | ||
let BUNDLE; | ||
|
||
before(() => { | ||
BUNDLE = fs.readFileSync(path.resolve(__dirname, '../dist/fesm2015/sample-ctor-decorator.js'), 'utf-8'); | ||
}); | ||
|
||
it('should exist', () => { | ||
expect(BUNDLE).to.be.ok; | ||
}); | ||
|
||
it('should contain ctorParameters and __decorate', () => { | ||
expect(BUNDLE).to.contain('type: ChangeDetectorRef'); | ||
expect(BUNDLE).to.contain('__decorate'); | ||
expect(BUNDLE).to.contain('ctorParameters'); | ||
}); | ||
|
||
it('should not contain any __metadata', () => { | ||
expect(BUNDLE).not.to.contain('__metadata'); | ||
}); | ||
}); | ||
}); |
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,9 @@ | ||
import { Component, ChangeDetectorRef } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ng-component', | ||
template: '<h1>Angular!</h1>', | ||
}) | ||
export class AngularComponent { | ||
constructor(cdr: ChangeDetectorRef) {} | ||
} |
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,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { AngularComponent } from './angular.component'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
declarations: [AngularComponent], | ||
exports: [AngularComponent], | ||
}) | ||
export class AngularModule {} |
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