Skip to content

Conversation

@gkalpak
Copy link
Member

@gkalpak gkalpak commented May 20, 2020

This is a backport of #36161 to the patch branch (9.1.x) with the extra change to payload sizes for 9.1.x: 7db450e452b75133cec9c0ff76b41687e37efd6e The payload size change is no longer necessary, so I removed it to make this identical to #36161.

Thus the changes have been approved, except for the payload size updates.

This PR increases the main bundle by ~190B. See the original PR for details. It happens to push the ViewEngine payload size over the limit (actual increase: 430865B --> 431055B, while the limit is currently at 430383B).

@mary-poppins
Copy link

You can preview 8b01c66 at https://pr37231-8b01c66.ngbuilds.io/.

@gkalpak gkalpak changed the title [TEST] Test PR #36161 against patch [patch] fix(elements): fire custom element output events during component initialization May 21, 2020
@ngbot ngbot bot modified the milestone: needsTriage May 21, 2020
@mary-poppins
Copy link

You can preview e701ce8 at https://pr37231-e701ce8.ngbuilds.io/.

@gkalpak gkalpak added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels May 21, 2020
@gkalpak gkalpak marked this pull request as ready for review May 21, 2020 15:17
@pullapprove pullapprove bot requested review from IgorMinar and andrewseguin May 21, 2020 15:17
@mary-poppins
Copy link

You can preview 7db450e at https://pr37231-7db450e.ngbuilds.io/.

@gkalpak gkalpak changed the title [patch] fix(elements): fire custom element output events during component initialization [9.1.x] fix(elements): fire custom element output events during component initialization May 22, 2020
@gkalpak gkalpak added target: lts This PR is targeting a version currently in long-term support and removed PR target: patch-only labels May 22, 2020
@gkalpak
Copy link
Member Author

gkalpak commented May 22, 2020

@ caretaker: This needs to go into 9.1.x.

@gkalpak gkalpak added the action: presubmit The PR is in need of a google3 presubmit label Jun 5, 2020
gkalpak added 2 commits June 5, 2020 20:16
…y` type-casts

This commit removes some unnecessary non-null assertions (`!`) and
`as any` type-casts from the `elements` package.
…tialization

Previously, event listeners for component output events attached on an
Angular custom element before inserting it into the DOM (i.e. before
instantiating the underlying component) didn't fire for events emitted
during initialization lifecycle hooks, such as `ngAfterContentInit`,
`ngAfterViewInit`, `ngOnChanges` (initial call) and `ngOnInit`.
The reason was that that `NgElementImpl` [subscribed to events][1]
_after_ calling [ngElementStrategy#connect()][2], which is where the
[initial change detection][3] takes place (running the initialization
lifecycle hooks).

This commit fixes this by:
1. Ensuring `ComponentNgElementStrategy#events` is defined and available
   for subscribing to, even before instantiating the component.
2. Ensuring `NgElementImpl` subscribes to `NgElementStrategy#events`
   before calling `NgElementStrategy#connect()` (which initializes the
   component instance).

Jira issue: [FW-2010](https://angular-team.atlassian.net/browse/FW-2010)

[1]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L167-L170
[2]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L164
[3]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts#L158

Fixes angular#36141
@mary-poppins
Copy link

You can preview 6dac2d1 at https://pr37231-6dac2d1.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 454e073 at https://pr37231-454e073.ngbuilds.io/.

@gkalpak gkalpak removed the request for review from IgorMinar June 5, 2020 19:28
@IgorMinar IgorMinar removed the action: presubmit The PR is in need of a google3 presubmit label Jun 5, 2020
@IgorMinar
Copy link
Contributor

I removed the presubmit label - we don't need presubmit for non-master PRs.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

LGTM. thanks!

@IgorMinar IgorMinar removed the request for review from andrewseguin June 5, 2020 19:31
@pullapprove pullapprove bot requested a review from andrewseguin June 5, 2020 19:31
@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 5, 2020
@IgorMinar
Copy link
Contributor

merge-assitance: This PR doesn't need g3 presubmit. Can you please check with dev-infra why the PR status is pending? This is a bug that likely needs to be filed. thanks

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

Reviewed-for: global-approvers

@gkalpak gkalpak removed the request for review from andrewseguin June 5, 2020 19:34
@gkalpak
Copy link
Member Author

gkalpak commented Jun 5, 2020

The legacy-unit-tests-saucelabs job failures could be fixed by charry-picking 044a199 to 9.1.x.

EDIT: I added 044a199 to the PR to verify that it fixes the issue.

…ngular#37399)

Disabling Android 10 browser unit tests on Saucelabs due to errors.

After remediation from Saucelabs to correct the discovered failures, this change can be reverted to renable the tests on Android 10.

Example of failures seen:

```
02 06 2020 14:03:05.048:INFO [SaucelabsLauncher]: Chrome 10.0 (Android) session at https://saucelabs.com/tests/54f5fb181db644a3b4779187c2309000

02 06 2020 14:03:06.869:INFO [Chrome Mobile 74.0.3729 (Android 0.0.0)]: Disconnected browser returned on socket E-bi0p0NKtghk-HcAAAO with id 85563367.

Chrome Mobile 74.0.3729 (Android 0.0.0) ERROR: Error: XHR error loading http://angular-ci.local:9876/base/node_modules/rxjs/internal/operators/zip.js

	Error loading http://angular-ci.local:9876/base/node_modules/rxjs/internal/operators/zip.js as "../internal/operators/zip" from http://angular-ci.local:9876/base/node_modules/rxjs/operators/index.js

Error: XHR error loading http://angular-ci.local:9876/base/node_modules/rxjs/internal/operators/zip.js

    at error (http://angular-ci.local:9876/base/node_modules/systemjs/dist/system.src.js?1c6a6c12fec50a8db7aeebe8e06e2b70135c0615:1028:16)

    at XMLHttpRequest.xhr.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (http://angular-ci.local:9876/base/node_modules/systemjs/dist/system.src.js?1c6a6c12fec50a8db7aeebe8e06e2b70135c0615:1036:13)

    at XMLHttpRequest.wrapFn (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:809:43)

    at ZoneDelegate.invokeTask (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:432:35)

    at Zone.runTask (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:201:55)

    at ZoneTask.invokeTask [as invoke] (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:514:38)

    at invokeTask (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:1722:18)

    at XMLHttpRequest.globalZoneAwareCallback (http://angular-ci.local:9876/base/dist/bin/packages/zone.js/npm_package/dist/zone.js?942d01da94828e1c75e8527fa8d06f363d6379ce:1748:21)
```

PR Close angular#37399
@googlebot

This comment has been minimized.

@googlebot googlebot added cla: no and removed cla: yes labels Jun 5, 2020
@mary-poppins
Copy link

You can preview f0f319b at https://pr37231-f0f319b.ngbuilds.io/.

@googlebot
Copy link

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.

@atscott atscott merged commit f0f319b into angular:9.1.x Jun 5, 2020
@gkalpak gkalpak deleted the temp-pr36161 branch June 5, 2020 22:49
@gkalpak
Copy link
Member Author

gkalpak commented Jun 5, 2020

Regarding #37231 (comment), it is indeed a bug, tracked in angular/github-robot#51.

@angular-automatic-lock-bot
Copy link

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 Jul 6, 2020
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 area: elements Issues related to Angular Elements cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: lts This PR is targeting a version currently in long-term support type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants