Skip to content

fix(@angular-devkit/build-angular): remove pure_getters #14187

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
merged 3 commits into from
Apr 24, 2019
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"typescript": "3.4.4"
},
"devDependencies": {
"@angular/compiler": "^8.0.0-beta.12",
"@angular/compiler-cli": "^8.0.0-beta.12",
"@angular/compiler": "^8.0.0-beta.14",
"@angular/compiler-cli": "^8.0.0-beta.14",
"@bazel/bazel": "0.24.1",
"@bazel/buildifier": "^0.22.0",
"@bazel/jasmine": "~0.26.0",
Expand Down
20 changes: 10 additions & 10 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@
"worker-plugin": "3.1.0"
},
"devDependencies": {
"@angular/animations": "^8.0.0-beta.12",
"@angular/animations": "^8.0.0-beta.14",
"@angular/cdk": "^7.3.4",
"@angular/common": "^8.0.0-beta.12",
"@angular/compiler": "^8.0.0-beta.12",
"@angular/compiler-cli": "^8.0.0-beta.12",
"@angular/core": "^8.0.0-beta.12",
"@angular/common": "^8.0.0-beta.14",
"@angular/compiler": "^8.0.0-beta.14",
"@angular/compiler-cli": "^8.0.0-beta.14",
"@angular/core": "^8.0.0-beta.14",
"@angular/material": "^7.3.4",
"@angular/platform-browser": "^8.0.0-beta.12",
"@angular/platform-browser-dynamic": "^8.0.0-beta.12",
"@angular/platform-server": "^8.0.0-beta.12",
"@angular/router": "^8.0.0-beta.12",
"@angular/service-worker": "^8.0.0-beta.12",
"@angular/platform-browser": "^8.0.0-beta.14",
"@angular/platform-browser-dynamic": "^8.0.0-beta.14",
"@angular/platform-server": "^8.0.0-beta.14",
"@angular/router": "^8.0.0-beta.14",
"@angular/service-worker": "^8.0.0-beta.14",
"codelyzer": "^5.0.0",
"bootstrap": "^4.0.0",
"font-awesome": "^4.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,22 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
}

if (scriptsOptimization) {
let angularGlobalDefinitions = {
ngDevMode: false,
ngI18nClosureMode: false,
};

try {
// Try to load known global definitions from @angular/compiler-cli.
// tslint:disable-next-line:no-implicit-dependencies
const GLOBAL_DEFS_FOR_TERSER = require('@angular/compiler-cli').GLOBAL_DEFS_FOR_TERSER;
if (GLOBAL_DEFS_FOR_TERSER) {
angularGlobalDefinitions = GLOBAL_DEFS_FOR_TERSER;
}
} catch {
// Do nothing, the default above will be used instead.
}

const terserOptions = {
ecma: wco.supportES2015 ? 6 : 5,
warnings: !!buildOptions.verbose,
Expand All @@ -263,25 +279,13 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
comments: false,
webkit: true,
},

// On server, we don't want to compress anything. We still set the ngDevMode = false for it
// to remove dev code, and ngI18nClosureMode to remove Closure compiler i18n code
compress: (buildOptions.platform == 'server' ? {
global_defs: {
ngDevMode: false,
ngI18nClosureMode: false,
},
} : {
pure_getters: buildOptions.buildOptimizer,
// PURE comments work best with 3 passes.
// See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
passes: buildOptions.buildOptimizer ? 3 : 1,
global_defs: {
ngDevMode: false,
ngI18nClosureMode: false,
},
}),
// We also want to avoid mangling on server.
compress: {
// PURE comments work best with 3 passes.
// See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
passes: 3,
global_defs: angularGlobalDefinitions,
},
// We want to avoid mangling on server.
...(buildOptions.platform == 'server' ? { mangle: false } : {}),
};

Expand All @@ -296,7 +300,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
}

if (wco.tsConfig.options.target !== undefined &&
wco.tsConfig.options.target >= ts.ScriptTarget.ES2017) {
wco.tsConfig.options.target >= ts.ScriptTarget.ES2017) {
wco.logger.warn(tags.stripIndent`
WARNING: Zone.js does not support native async/await in ES2017.
These blocks are not intercepted by zone.js and will not triggering change detection.
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_ng_packagr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"ng-packagr": "^4.0.0 || ^5.0.0"
},
"devDependencies": {
"@angular/compiler": "^8.0.0-beta.12",
"@angular/compiler-cli": "^8.0.0-beta.12",
"@angular/compiler": "^8.0.0-beta.14",
"@angular/compiler-cli": "^8.0.0-beta.14",
"@angular-devkit/core": "0.0.0",
"ng-packagr": "^5.1.0",
"tslib": "^1.9.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"webpack": "^4.0.0"
},
"devDependencies": {
"@angular/compiler": "^8.0.0-beta.12",
"@angular/compiler-cli": "^8.0.0-beta.12",
"@angular/compiler": "^8.0.0-beta.14",
"@angular/compiler-cli": "^8.0.0-beta.14",
"typescript": "3.4.4",
"webpack": "4.30.0"
}
Expand Down
80 changes: 40 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@angular/animations@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-8.0.0-beta.12.tgz#b919b204c5523e4377aff9d2661d0b7324d85874"
integrity sha512-FHr7/ijyYZ/4VNKxS7Cm6OT4OW7wzfQu15XUx//MTlIV2qeHSxCQWOQ4GjlFQRRiYdjZ261dl3a0ZJQslatPAw==
"@angular/animations@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-8.0.0-beta.14.tgz#50259f6f3c97101183216e8311b8c0875c4356c3"
integrity sha512-ihYHQXEbjzemjJxJV4p2XAWOD9H4r8HpfNekxxelgj2RyZhrMQStzL+PEKxHHlGn167HuZz5YEoW4MXGflTtsA==
dependencies:
tslib "^1.9.0"

Expand All @@ -18,17 +18,17 @@
optionalDependencies:
parse5 "^5.0.0"

"@angular/common@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-8.0.0-beta.12.tgz#dbdb5de68e1950003fb18e4288e1d5a73964ad52"
integrity sha512-SQnOj0cvV6hDwTxyhz1tXD4j6hqy8jj/xwYHiqZ+pSMMSEB1C4cf8y0ukFJzVNvWUqZCjZUmG6OY7Ta0IqJ2Yg==
"@angular/common@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-8.0.0-beta.14.tgz#a27efe0b3e38e38f0e481a2a3f8cad026823b39d"
integrity sha512-4mBGXb+VyakX+YqAAfDsYrlKmjDcyD0BjmWi1u7aTJgf5QmEvFD4QLXzHoWEsmBFnTgoFHXMtXogF04GXy3kuA==
dependencies:
tslib "^1.9.0"

"@angular/compiler-cli@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-8.0.0-beta.12.tgz#43e3beb1e5249aef03912e7e403005eb4be1ae4a"
integrity sha512-WehBHOrP2PoaXA/F9pEuy+EsC+GBKsuOSe+OPZ1LVmUrboLdtTA1Z6/MURNE7RJxP5aVSHmSz5w74cP/Ta90+A==
"@angular/compiler-cli@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-8.0.0-beta.14.tgz#61aa5947d3427afd0043fdba079a8cc616d29201"
integrity sha512-Q+B9bUDqVOT3OZdUsOFJeQWSmVKUdUoaU5ptq6UQFALCa/0skQrcL/KOFpej3fk3ZRVTkQ+vWQ1nMzv+tm8Byw==
dependencies:
canonical-path "1.0.0"
chokidar "^2.1.1"
Expand All @@ -42,17 +42,17 @@
tslib "^1.9.0"
yargs "9.0.1"

"@angular/compiler@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-8.0.0-beta.12.tgz#cf7d250585ba3965d440aa3fbc6afa71d52bdf0c"
integrity sha512-JYC521zMNGCO152UjFU1dm7xsbruDezfrQVlPdCp6aCQEoPFvX07plXSni+exN2M6Jj87Gwsf3nDCAqW4l3tlA==
"@angular/compiler@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-8.0.0-beta.14.tgz#dc01066a060ea9fbd9696a015f481279aa23c2b0"
integrity sha512-Copy2bMf8EL9WcHwz1rHeMY6CqWhOZmvGRBSVwI149awbTxc31h3+01TG2I5FlgIm+vc70PUldp7EumqFiCCDA==
dependencies:
tslib "^1.9.0"

"@angular/core@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-8.0.0-beta.12.tgz#0585726423dd1123ed878cb57fde00e1bbd42193"
integrity sha512-1V2kEi7iaDVXHPVwqN54sGjr6jEt7Hijj3UIIkAiIJA93Yc2I/c7PsupAho91wwEdya2K/K7gKnIheNS0D4CWQ==
"@angular/core@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-8.0.0-beta.14.tgz#d3e75291ac390a1a29bf037bfd292586a90aea8b"
integrity sha512-7gltt13BTUFgGHpOBUmvxr/PUcqY8n6177NpYgEJRBFLZl2FtErG+7BfYBCt23StAi+K6ZafP+IX2m1evOtX8g==
dependencies:
tslib "^1.9.0"

Expand All @@ -63,40 +63,40 @@
dependencies:
tslib "^1.7.1"

"@angular/platform-browser-dynamic@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.0.0-beta.12.tgz#f2c60bb98ca1ab81571a4e1cb7043e0fc707c497"
integrity sha512-l61v7KxFzmziu0WTFTMhKTTJSHpioYl7u8uNao4vxhQR5o65G6fiLxNOjqpNe6bKrolbKcbZ4/+N8nPN7Mw/vA==
"@angular/platform-browser-dynamic@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.0.0-beta.14.tgz#ef2463033f7383500aaa55627fbd487c5c377033"
integrity sha512-NWcOey/bzstnbVzNvBpryEAamWNAQobUkP4i3mSnKvWAyhs1GO7IPOsTwzOOPVvQBTOq0GFdYJjDoB4DIo3/ZA==
dependencies:
tslib "^1.9.0"

"@angular/platform-browser@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-8.0.0-beta.12.tgz#9896a85b8edb8dfa633fe7ea38591bc7b0ae6f43"
integrity sha512-XL9ybmllynrDiOYhbaRywOQq/NvfNOd/6Cn6jnLXMOSthkqPpYCIejsE/zm7Gq+RPrJeW7kaOg+DyXRPWLWOOQ==
"@angular/platform-browser@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-8.0.0-beta.14.tgz#9023453d850243fbc7c6452c26e100fd1d505617"
integrity sha512-nOo8wZU1PToNgb1BdKVWVmJqX4l30YWOzMCJ1S41LMImf0k+PXgKYUCQ5OzFBJNTH0x8JvANTvsBiqJyNN+QkQ==
dependencies:
tslib "^1.9.0"

"@angular/platform-server@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-8.0.0-beta.12.tgz#56ddc9a249faf3b31a275315cdb72a5122d365dd"
integrity sha512-dWqDqpC/5J7g6jLwvOCmtvL/+OYEtDyuUOaH7fz/Mp9J4lCqqwSJhM7AMFn265VMa8eixohwMoQPA1RSf0Bhtw==
"@angular/platform-server@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-8.0.0-beta.14.tgz#87cc4ce00354b1597890809303bd89b671f78bd1"
integrity sha512-VV0m8zqXrk9PzOPccirkL1TV+fVsoqnUc+y9Sfj9nTtufZvAEu2Yp4GDDXvzXncXx+/GEsx+gcpRnlvKHvsOPg==
dependencies:
domino "^2.1.2"
tslib "^1.9.0"
xhr2 "^0.1.4"

"@angular/router@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/router/-/router-8.0.0-beta.12.tgz#0a98d6e7da6ba6a3d8ccd18d2a9dac8956f72e1e"
integrity sha512-inuuYL48uPBqFMpqH8IBVzJGA+wUHr0QuLigO1GlAqVEXGXwEPUSbqmqvwv7j1RGT1phC2LC8lWR8yfcNBel7A==
"@angular/router@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/router/-/router-8.0.0-beta.14.tgz#62e4be7b085cce764e00c608eb910886767cd61e"
integrity sha512-QGIvWPd4ngxWzEwzAqEk7M54CGmmYGRxs/+V8Zohau580XL5lK6tuPvN+slO1dWe3+YuFt6U02zzs9mRGlLnYw==
dependencies:
tslib "^1.9.0"

"@angular/service-worker@^8.0.0-beta.12":
version "8.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-8.0.0-beta.12.tgz#6a5e6e6178b5160a984d231ae65eb7eef31af8cd"
integrity sha512-cvS0IplppPhwtfqiSg4NPkp0Ck+3meX8O3aX4OuVeTUKOX1mE9gCTIO7QwDFo0o325mhct2ur9Spx5FPClQVBw==
"@angular/service-worker@^8.0.0-beta.14":
version "8.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-8.0.0-beta.14.tgz#7fdac405d2f6757cbaeb2abdb35b513f69e0bdf2"
integrity sha512-dQGdpjj97bVp0AvLHI4wpbQCEeWSoPssnKf24oXaJHLM0UuWQgumlBzKU4/gWBpQ+lQoW+txELp4qoY4YH/Yig==
dependencies:
tslib "^1.9.0"

Expand Down