Skip to content

Commit 0040d09

Browse files
committed
fix(core): disabble tsickle pass when producing APF packages
As of TypeScript 3.9, the tsc emit is not compatible with Closure Compiler due to microsoft/TypeScript#32011 There is some hope that this will be fixed a solution like the one proposed in microsoft/TypeScript#38374 but currently it's unclear if / when that will happen. Since the Closure support has been somewhat already broken, and the tsickle pass has been a source of headaches for some time for Angular packages, we are removing it for now while we are rethinking our strategy to make thAngular closure compatible outside of Google. This change has no affect on our Closure compatibility within Google which work well because all the code is compiled from sources and passed through tsickle. This change only disables the tsickle pass but doesn't remove it. A follow up PR should either remove all the traces of tscikle or reenable the fixed version. BREAKING CHANGE: Angular npm packages no longer contain jsdoc comments to support optimization by Closure Compiler The support for Closure compiler in Angular packages has been broken for quite some time. As of TS3.9 Closure is unusable with the JavaScript emit. Please follow microsoft/TypeScript#38374 for further developments. If you used Closure compiler with Angular in the past, you will likely be better off consuming Angular packages built from sources directly rather than consuming the vesion we publish on npm which is primarily optimized for Webpack/Rollup + Terser build pipeline.
1 parent 267f844 commit 0040d09

File tree

6 files changed

+153
-208
lines changed

6 files changed

+153
-208
lines changed

goldens/size-tracking/aio-payloads.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"master": {
2222
"uncompressed": {
2323
"runtime-es2015": 3097,
24-
"main-es2015": 430367,
24+
"main-es2015": 429710,
2525
"polyfills-es2015": 52195
2626
}
2727
}

goldens/size-tracking/integration-payloads.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
"master": {
2222
"uncompressed": {
2323
"runtime-es2015": 1485,
24-
"main-es2015": 149436,
25-
"polyfills-es2015": 36657
24+
"main-es2015": 148510,
25+
"polyfills-es2015": 36963
2626
}
2727
}
2828
},
2929
"cli-hello-world-ivy-i18n": {
3030
"master": {
3131
"uncompressed": {
3232
"runtime-es2015": 1485,
33-
"main-es2015": 138866,
34-
"polyfills-es2015": 37334
33+
"main-es2015": 138196,
34+
"polyfills-es2015": 37640
3535
}
3636
}
3737
},

packages/bazel/src/ngc-wrapped/index.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,13 @@ export function compile({
192192
}
193193

194194
if (!bazelOpts.es5Mode) {
195-
compilerOpts.annotateForClosureCompiler = true;
196-
compilerOpts.annotationsAs = 'static fields';
195+
if (bazelOpts.workspaceName === 'google3') {
196+
compilerOpts.annotateForClosureCompiler = true;
197+
compilerOpts.annotationsAs = 'static fields';
198+
} else {
199+
compilerOpts.annotateForClosureCompiler = false;
200+
compilerOpts.annotationsAs = 'decorators';
201+
}
197202
}
198203

199204
// Detect from compilerOpts whether the entrypoint is being invoked in Ivy mode.

0 commit comments

Comments
 (0)