Skip to content

Disable the tsickle pass from ng_package/APF/ngc-wrapped#37221

Closed
IgorMinar wants to merge 1 commit intoangular:masterfrom
IgorMinar:build/apf-no-tsickle
Closed

Disable the tsickle pass from ng_package/APF/ngc-wrapped#37221
IgorMinar wants to merge 1 commit intoangular:masterfrom
IgorMinar:build/apf-no-tsickle

Conversation

@IgorMinar
Copy link
Copy Markdown
Contributor

@IgorMinar IgorMinar commented May 20, 2020

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 by 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 rethink our strategy to make Angular Closure compatible outside of Google.

This change has no effect 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 re-enable the fixed version.

BREAKING CHANGE: Angular npm packages no longer contain jsdoc comments to support Closure Compiler's advanced optimizations

The support for Closure compiler in Angular packages has been experimental and broken for quite some time.

As of TS3.9 Closure is unusable with the JavaScript emit. Please follow microsoft/TypeScript#38374 for more information and updates.

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 version we publish on npm which is primarily optimized for Webpack/Rollup + Terser build pipeline.

As a temporary workaround you might consider using your current build pipeline with Closure flag
--compilation_level=SIMPLE. This flag will ensure that your build pipeline produces buildable and runnable artifacts, at the cost of increased payload size due to advanced optimizations being disabled.

If you were affected by this change, please help us understand your needs by leaving a comment on #37234.

@pullapprove pullapprove Bot requested a review from kyliau May 20, 2020 15:06
@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from c7627d0 to 62e84a5 Compare May 20, 2020 15:13
@mary-poppins
Copy link
Copy Markdown

You can preview 62e84a5 at https://pr37221-62e84a5.ngbuilds.io/.

@googlebot
Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@pullapprove pullapprove Bot requested review from kara and petebacondarwin May 20, 2020 15:42
@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from 6962b4d to afbf3d2 Compare May 20, 2020 15:42
@mary-poppins
Copy link
Copy Markdown

You can preview afbf3d2 at https://pr37221-afbf3d2.ngbuilds.io/.

@mary-poppins
Copy link
Copy Markdown

You can preview 9958227 at https://pr37221-9958227.ngbuilds.io/.

@devversion
Copy link
Copy Markdown
Member

devversion commented May 20, 2020

Just sharing as it seems relevant: For the ng_module output that is built with View Engine, the tsickle decorator processing had the positive side-effect of making code compatible on the server when the Angular build optimizer is not used. Disabling tsickle breaks in those cases.

We ran into something similar in the components repo when tsickle had been disabled in the compiler CLI: 29761ea.

Clearly this is not a common case since build-optimizer is used by default in CLI apps, and AFAIK the output from famework packages is not affected, but components repo would be affected. We can either make the switch away from tsickle now too, or keep tsickle enabled there. To be clear: I'm not advocating for keeping tsickle enabled, I'm just sharing an related issue that came up in the past.

I thought it would be worth mentioning here. I think it's reasonable moving forward with this as there is a straightforward solution for affected apps (i.e. using build optimizer or providing global mocks), but it might be breaking in some cases. More context on the general issue: #30586

@googlebot
Copy link
Copy Markdown

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from c3d3aa5 to 5a8de37 Compare May 20, 2020 20:09
@googlebot
Copy link
Copy Markdown

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@IgorMinar
Copy link
Copy Markdown
Contributor Author

@devversion thanks for the comment. I agree that we should try to decouple the two. My main objective here is not to use tsickle in the npm package output.

Do you believe that the change as currently proposed will become a blocker for the components repo?

@mary-poppins
Copy link
Copy Markdown

You can preview 5a8de37 at https://pr37221-5a8de37.ngbuilds.io/.

@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from 5a8de37 to 96c150b Compare May 20, 2020 20:34
@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@IgorMinar IgorMinar added state: WIP target: major This PR is targeted for the next major release labels May 20, 2020
@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch 3 times, most recently from d65f30c to 3f7c5c4 Compare May 21, 2020 01:12
@mary-poppins
Copy link
Copy Markdown

You can preview 3f7c5c4 at https://pr37221-3f7c5c4.ngbuilds.io/.

@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from 3f7c5c4 to 08bec1b Compare May 21, 2020 01:40
@mary-poppins
Copy link
Copy Markdown

You can preview 08bec1b at https://pr37221-08bec1b.ngbuilds.io/.

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 by 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 rethink our
strategy to make Angular Closure compatible outside of Google.

This change has no effect 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
re-enable the fixed version.

BREAKING CHANGE: Angular npm packages no longer contain jsdoc comments
to support Closure Compiler's advanced optimizations

The support for Closure compiler in Angular packages has been
experimental and broken for quite some
time.

As of TS3.9 Closure is unusable with the JavaScript emit. Please follow
microsoft/TypeScript#38374 for more
information and updates.

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
version we publish on npm
which is primarily optimized for Webpack/Rollup + Terser build pipeline.

As a temporary workaround you might consider using your current build
pipeline with Closure flag
`--compilation_level=SIMPLE`. This flag will ensure that your build
pipeline produces buildable and
runnable artifacts, at the cost of increased payload size due to
advanced optimizations being disabled.

If you were affected by this change, please help us understand your
needs by leaving a comment on angular#37234.
@IgorMinar IgorMinar force-pushed the build/apf-no-tsickle branch from b027ccb to eb6cf23 Compare May 21, 2020 04:10
@mary-poppins
Copy link
Copy Markdown

You can preview eb6cf23 at https://pr37221-eb6cf23.ngbuilds.io/.

Copy link
Copy Markdown
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: global-approvers

@kara kara removed request for gkalpak and josephperrott May 21, 2020 16:13
@kara kara closed this in a1001f2 May 21, 2020
IgorMinar added a commit to IgorMinar/angular that referenced this pull request May 29, 2020
In angular#37221 we disabled tsickle passes from transforming the tsc output that is used to publish all
Angular framework and components packages (@angular/*).

This change however revealed a bug in the ngc that caused __decorate and __metadata calls to still
be emitted in the JS code even though we don't depend on them.

Additionally it was these calls that caused code in @angular/material packages to fail at runtime
due to circular dependency in the emitted decorator code documeted as
microsoft/TypeScript#27519.

This change partially rolls back angular#37221 by reenabling the decorator to static fields (static
properties) downleveling.

This is just a temporary workaround while we are also fixing root cause in `ngc` - tracked as
FW-2199.

Resolves FW-2198.
Related to FW-2196
matsko pushed a commit that referenced this pull request May 29, 2020
…37317)

In #37221 we disabled tsickle passes from transforming the tsc output that is used to publish all
Angular framework and components packages (@angular/*).

This change however revealed a bug in the ngc that caused __decorate and __metadata calls to still
be emitted in the JS code even though we don't depend on them.

Additionally it was these calls that caused code in @angular/material packages to fail at runtime
due to circular dependency in the emitted decorator code documeted as
microsoft/TypeScript#27519.

This change partially rolls back #37221 by reenabling the decorator to static fields (static
properties) downleveling.

This is just a temporary workaround while we are also fixing root cause in `ngc` - tracked as
FW-2199.

Resolves FW-2198.
Related to FW-2196

PR Close #37317
matsko pushed a commit that referenced this pull request May 29, 2020
…37317)

In #37221 we disabled tsickle passes from transforming the tsc output that is used to publish all
Angular framework and components packages (@angular/*).

This change however revealed a bug in the ngc that caused __decorate and __metadata calls to still
be emitted in the JS code even though we don't depend on them.

Additionally it was these calls that caused code in @angular/material packages to fail at runtime
due to circular dependency in the emitted decorator code documeted as
microsoft/TypeScript#27519.

This change partially rolls back #37221 by reenabling the decorator to static fields (static
properties) downleveling.

This is just a temporary workaround while we are also fixing root cause in `ngc` - tracked as
FW-2199.

Resolves FW-2198.
Related to FW-2196

PR Close #37317
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jun 21, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…37221)

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 by 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 rethink our
strategy to make Angular Closure compatible outside of Google.

This change has no effect 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
re-enable the fixed version.

BREAKING CHANGE: Angular npm packages no longer contain jsdoc comments
to support Closure Compiler's advanced optimizations

The support for Closure compiler in Angular packages has been
experimental and broken for quite some
time.

As of TS3.9 Closure is unusable with the JavaScript emit. Please follow
microsoft/TypeScript#38374 for more
information and updates.

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
version we publish on npm
which is primarily optimized for Webpack/Rollup + Terser build pipeline.

As a temporary workaround you might consider using your current build
pipeline with Closure flag
`--compilation_level=SIMPLE`. This flag will ensure that your build
pipeline produces buildable and
runnable artifacts, at the cost of increased payload size due to
advanced optimizations being disabled.

If you were affected by this change, please help us understand your
needs by leaving a comment on angular#37234.

PR Close angular#37221
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker breaking changes cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants