diff --git a/.circleci/config.yml b/.circleci/config.yml index 21874d88ea..9fe924affa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -347,6 +347,10 @@ jobs: steps: - custom_attach_workspace - init_environment + # Compile dependencies to ivy + # Running `ngcc` here (instead of implicitly via `ng build`) allows us to take advantage of + # the parallel, async mode speed-up (~20-25s on CI). + - run: yarn --cwd aio ivy-ngcc --properties es2015 # Build aio - run: yarn --cwd aio build --progress=false # Lint the code @@ -376,7 +380,7 @@ jobs: test_aio_local: parameters: - ivy: + viewengine: type: boolean default: false # Needed because the AIO tests and the PWA score test depend on Chrome being available. @@ -385,7 +389,7 @@ jobs: - custom_attach_workspace - init_environment # Build aio (with local Angular packages) - - run: yarn --cwd aio build-local<<# parameters.ivy >>-with-ivy<>-ci + - run: yarn --cwd aio build-local<<# parameters.viewengine >>-with-viewengine<>-ci # Run unit tests - run: yarn --cwd aio test --progress=false --watch=false # Run e2e tests @@ -393,7 +397,7 @@ jobs: # Run PWA-score tests - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE # Check the bundle sizes. - - run: yarn --cwd aio payload-size aio-local<<# parameters.ivy >>-ivy<> + - run: yarn --cwd aio payload-size aio-local<<# parameters.viewengine >>-viewengine<> test_aio_tools: executor: default-executor @@ -776,8 +780,8 @@ workflows: requires: - build-npm-packages - test_aio_local: - name: test_aio_local_ivy - ivy: true + name: test_aio_local_viewengine + viewengine: true requires: - build-npm-packages - test_aio_tools: @@ -816,7 +820,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_aio_local_viewengine - test_docs_examples - test_docs_examples_ivy # Get the artifacts to publish from the build-packages-dist job diff --git a/aio/README.md b/aio/README.md index e4690504ff..b7e13678ca 100644 --- a/aio/README.md +++ b/aio/README.md @@ -18,8 +18,8 @@ Here are the most important tasks you might need to use: * `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc). * `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`. -* `yarn build-local-with-ivy` - same as `build-local`, but in addition also turns on `ivy` mode in aio. - (Note: To turn on `ivy` mode in examples, see `yarn boilerplate:add` below.) +* `yarn build-local-with-viewengine` - same as `build-local`, but in addition also turns on `ViewEngine` mode in aio. + (Note: Docs examples run in `ViewEngine` mode by default. To turn on `ivy` mode in examples, see `yarn boilerplate:add` below.) * `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary. * `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console. diff --git a/aio/package.json b/aio/package.json index e5a46cbb3c..033ff4efb7 100644 --- a/aio/package.json +++ b/aio/package.json @@ -19,10 +19,10 @@ "build-local": "yarn ~~build", "prebuild-local-ci": "yarn setup-local --no-build-packages", "build-local-ci": "yarn ~~build --progress=false", - "prebuild-local-with-ivy": "yarn setup-local && node scripts/switch-to-ivy", - "build-local-with-ivy": "yarn ~~build", - "prebuild-local-with-ivy-ci": "yarn setup-local --no-build-packages && node scripts/switch-to-ivy", - "build-local-with-ivy-ci": "yarn ~~build --progress=false", + "prebuild-local-with-viewengine": "node scripts/switch-to-viewengine && yarn setup-local", + "build-local-with-viewengine": "yarn ~~build", + "prebuild-local-with-viewengine-ci": "node scripts/switch-to-viewengine && yarn setup-local --no-build-packages", + "build-local-with-viewengine-ci": "yarn ~~build --progress=false", "extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js 0a36071b8", "lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint", "test": "yarn check-env && ng test", diff --git a/aio/scripts/_payload-limits.json b/aio/scripts/_payload-limits.json index 75c209258d..a90ca143f9 100755 --- a/aio/scripts/_payload-limits.json +++ b/aio/scripts/_payload-limits.json @@ -2,28 +2,16 @@ "aio": { "master": { "uncompressed": { - "runtime-es5": 3091, - "runtime-es2015": 3097, - "main-es5": 480426, - "main-es2015": 434851, + "runtime-es5": 2981, + "runtime-es2015": 2987, + "main-es5": 540068, + "main-es2015": 494141, "polyfills-es5": 142239, "polyfills-es2015": 52503 } } }, "aio-local": { - "master": { - "uncompressed": { - "runtime-es5": 3091, - "runtime-es2015": 3097, - "main-es5": 481663, - "main-es2015": 436411, - "polyfills-es5": 142239, - "polyfills-es2015": 52503 - } - } - }, - "aio-local-ivy": { "master": { "uncompressed": { "runtime-es5": 2981, @@ -34,5 +22,17 @@ "polyfills-es2015": 52503 } } + }, + "aio-local-viewengine": { + "master": { + "uncompressed": { + "runtime-es5": 3091, + "runtime-es2015": 3097, + "main-es5": 481663, + "main-es2015": 436411, + "polyfills-es5": 142239, + "polyfills-es2015": 52503 + } + } } } diff --git a/aio/scripts/switch-to-ivy.js b/aio/scripts/switch-to-viewengine.js similarity index 73% rename from aio/scripts/switch-to-ivy.js rename to aio/scripts/switch-to-viewengine.js index feba4f47cd..c79ea4587d 100644 --- a/aio/scripts/switch-to-ivy.js +++ b/aio/scripts/switch-to-viewengine.js @@ -4,16 +4,13 @@ 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: { - enableIvy: true, + enableIvy: false, }, }; @@ -26,7 +23,7 @@ function _main() { const ngConfig = parse(readFileSync(NG_JSON, 'utf8')); const tsConfigPath = join(ROOT_DIR, ngConfig.projects.site.architect.build.options.tsConfig); - // Enable Ivy in TS config. + // Enable ViewIngine/Disable Ivy in TS config. console.log(`\nModifying \`${tsConfigPath}\`...`); const oldTsConfigStr = readFileSync(tsConfigPath, 'utf8'); const oldTsConfigObj = parse(oldTsConfigStr); @@ -35,13 +32,8 @@ function _main() { console.log(`\nNew config: ${newTsConfigStr}`); writeFileSync(tsConfigPath, newTsConfigStr); - // Run ngcc. - const ngccArgs = '--loglevel debug --properties es2015'; - 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 ' + + console.log('\nReady to build with ViewEngine!'); + console.log('(To switch back to Ivy (with packages from npm), undo the changes in ' + `\`${tsConfigPath}\` and run \`yarn aio-use-npm && yarn example-use-npm\`.)`); } diff --git a/aio/tests/e2e/src/app.e2e-spec.ts b/aio/tests/e2e/src/app.e2e-spec.ts index db162c5660..4f81ed1b62 100644 --- a/aio/tests/e2e/src/app.e2e-spec.ts +++ b/aio/tests/e2e/src/app.e2e-spec.ts @@ -239,9 +239,7 @@ describe('site App', function() { /* tslint:disable:max-line-length */ expect(page.ghLinks.get(0).getAttribute('href')) .toMatch(/https:\/\/github\.com\/angular\/angular\/edit\/master\/aio\/content\/guide\/http\.md\?message=docs%3A%20describe%20your%20change\.\.\./); - // TODO(gkalpak): This test often times out with Ivy (because loading `guide/http` takes a lot of time). - // Remove the timeout once the performance issues have been fixed. - }, 60000); + }); it('should not be present on top level pages', () => { page.navigateTo('features'); diff --git a/aio/tsconfig.json b/aio/tsconfig.json index ae075f4560..a27d504e54 100644 --- a/aio/tsconfig.json +++ b/aio/tsconfig.json @@ -33,7 +33,4 @@ "scripts", "tools" ], - "angularCompilerOptions": { - "enableIvy": false, - }, }