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
8 changes: 1 addition & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,6 @@ jobs:
steps:
- *attach_workspace
- *init_environment
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
# package installer picks up the locally built packages from that location.
# *Note*: We could also adjust the packages installer, but given we won't have
# two different folders of Angular distributions in the future, it's likely not
# worth the efforts to change the AIO packages installer.
- run: mv dist/packages-dist-ivy-aot dist/packages-dist
# Build aio with Ivy (using local Angular packages)
- run: yarn --cwd aio build-with-ivy --progress=false

Expand Down Expand Up @@ -632,7 +626,7 @@ workflows:
- build-npm-packages
- test_aio_local_ivy:
requires:
- build-ivy-npm-packages
- build-npm-packages
- test_aio_tools:
requires:
- build-npm-packages
Expand Down
4 changes: 2 additions & 2 deletions aio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"build": "yarn ~~build",
"prebuild-local": "yarn setup-local",
"build-local": "yarn ~~build",
"prebuild-with-ivy": "yarn setup-local && yarn ivy-ngcc --properties module es2015",
"build-with-ivy": "node scripts/build-with-ivy",
"prebuild-with-ivy": "yarn setup-local && node scripts/switch-to-ivy",
"build-with-ivy": "yarn ~~build",
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js 664990cad",
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
"test": "yarn check-env && ng test",
Expand Down
46 changes: 0 additions & 46 deletions aio/scripts/build-with-ivy.js

This file was deleted.

49 changes: 49 additions & 0 deletions aio/scripts/switch-to-ivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/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 NG_JSON = join(ROOT_DIR, 'angular.json');
const NG_COMPILER_OPTS = {
angularCompilerOptions: {
// Related Jira issue: FW-737
allowEmptyCodegenFiles: true,
enableIvy: true,
},
};

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

// Functions - Definitions
function _main() {
// Detect path to `tsconfig.app.json`.
const ngConfig = parse(readFileSync(NG_JSON, 'utf8'));
const tsConfigPath = join(ROOT_DIR, ngConfig.projects.site.architect.build.options.tsConfig);

// Enable Ivy in TS config.
console.log(`\nModifying \`${tsConfigPath}\`...`);
const oldTsConfigStr = readFileSync(tsConfigPath, 'utf8');
const oldTsConfigObj = parse(oldTsConfigStr);
const newTsConfigObj = extend(true, oldTsConfigObj, NG_COMPILER_OPTS);
const newTsConfigStr = JSON.stringify(newTsConfigObj, null, 2);
console.log(`\nNew config: ${newTsConfigStr}`);
writeFileSync(tsConfigPath, newTsConfigStr);

// Run ngcc.
const ngccArgs = '--loglevel debug --properties es2015 module';
console.log(`\nRunning ngcc (with args: ${ngccArgs})...`);
exec(`yarn ivy-ngcc ${ngccArgs}`);

// Done.
console.log('\nReady to build with Ivy!');
console.log('(To switch back to ViewEngine (with packages from npm), undo the changes in ' +
`\`${tsConfigPath}\` and run \`yarn aio-use-npm && yarn example-use-npm\`.)`);
}
2 changes: 1 addition & 1 deletion aio/src/app/layout/doc-viewer/doc-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class DocViewerComponent implements OnDestroy {
// setting each style.
switchMap(() => raf$), tap(() => elem.style[prop] = from),
switchMap(() => raf$), tap(() => elem.style.transition = `all ${duration}ms ease-in-out`),
switchMap(() => raf$), tap(() => (elem.style as any)[prop] = to),
switchMap(() => raf$), tap(() => elem.style[prop] = to),
switchMap(() => timer(getActualDuration(elem))), switchMap(() => this.void$),
);
};
Expand Down