Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ jobs:
# Run e2e tests
- run: yarn --cwd aio e2e

test_aio_local_ivy:
<<: *job_defaults
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
# Build aio with Ivy (using local Angular packages)
- run: yarn --cwd aio build-with-ivy --progress=false

test_aio_tools:
<<: *job_defaults
steps:
Expand Down Expand Up @@ -497,6 +510,9 @@ workflows:
- test_aio_local:
requires:
- build-packages-dist
- test_aio_local_ivy:
requires:
- build-packages-dist
- test_aio_tools:
requires:
- build-packages-dist
Expand Down Expand Up @@ -526,6 +542,7 @@ workflows:
- integration_test
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local
- test_aio_local_ivy
- test_docs_examples
# Get the artifacts to publish from the build-packages-dist job
# since the publishing script expects the legacy outputs layout.
Expand Down
6 changes: 4 additions & 2 deletions aio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"build": "yarn ~~build",
"prebuild-local": "yarn setup-local",
"build-local": "yarn ~~build",
"prebuild-with-ivy": "yarn setup-local && yarn ivy-ngcc",
"build-with-ivy": "node scripts/build-with-ivy",
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js fd4e960d6",
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
"test": "yarn check-env && ng test",
Expand Down Expand Up @@ -95,8 +97,8 @@
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "7.2.0-beta.2",
"@angular-devkit/build-angular": "^0.12.1",
"@angular/cli": "7.2.1",
"@angular/compiler": "^7.0.0",
"@angular/compiler-cli": "^7.0.0",
"@angular/language-service": "^7.0.0",
Expand Down
46 changes: 46 additions & 0 deletions aio/scripts/build-with-ivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env node

// Imports
const {extend, parse} = require('cjson');
const {readFileSync, writeFileSync} = require('fs');
const {join, resolve} = require('path');
const {exec, set} = require('shelljs');

set('-e');

// Constants
const ROOT_DIR = resolve(__dirname, '..');
const TS_CONFIG_PATH = join(ROOT_DIR, 'tsconfig.json');
const NG_COMPILER_OPTS = {
angularCompilerOptions: {
// Related Jira issue: FW-737
allowEmptyCodegenFiles: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this before. This is an ok workaround for now, but we should work on removing this flag.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see angular/angular-cli#13524 (review) for more context.

enableIvy: 'ngtsc',
},
};

// Run
_main(process.argv.slice(2));

// Functions - Definitions
function _main(buildArgs) {
console.log('\nModifying `tsconfig.json`...');
const oldTsConfigStr = readFileSync(TS_CONFIG_PATH, 'utf8');
const oldTsConfigObj = parse(oldTsConfigStr);
const newTsConfigObj = extend(true, oldTsConfigObj, NG_COMPILER_OPTS);
const newTsConfigStr = JSON.stringify(newTsConfigObj, null, 2);
writeFileSync(TS_CONFIG_PATH, newTsConfigStr);
console.log(newTsConfigStr);

try {
const buildArgsStr = buildArgs.join(' ');

console.log(`\nBuilding${buildArgsStr && ` with args \`${buildArgsStr}\``}...`);
exec(`yarn ~~build ${buildArgsStr}`, {cwd: ROOT_DIR});
} finally {
console.log('\nRestoring `tsconfig.json`...');
writeFileSync(TS_CONFIG_PATH, oldTsConfigStr);
}

console.log('\nDone!');
}
2 changes: 1 addition & 1 deletion aio/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(docInserted)="onDocInserted()"
(docRendered)="onDocRendered()">
</aio-doc-viewer>
<aio-dt [on]="dtOn" [(doc)]="currentDocument"></aio-dt>
<aio-dt *ngIf="dtOn" [(doc)]="currentDocument"></aio-dt>
</main>

</mat-sidenav-container>
Expand Down
13 changes: 6 additions & 7 deletions aio/src/app/layout/doc-viewer/dt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import { DocumentContents } from 'app/documents/document.service';
@Component({
selector: 'aio-dt',
template: `
<div *ngIf="on">
<hr>
<textarea #dt [value]="text" rows="10" cols="80"></textarea>
<br/>
<button (click)="dtextSet()">Show change</button>
</div>
<div>
<hr>
<textarea #dt [value]="text" rows="10" cols="80"></textarea>
<br/>
<button (click)="dtextSet()">Show change</button>
</div>
`
})
export class DtComponent {

@Input() on = false;
@Input() doc: DocumentContents;
@Output() docChange = new EventEmitter<DocumentContents>();

Expand Down
Loading