ddubrava / angular-yandex-maps

🗺️ Yandex.Maps Angular components that implement the Yandex.Maps JavaScript API
https://ddubrava.github.io/angular8-yandex-maps/#/
MIT License
57 stars 7 forks source link

feat: create all components outside an Angular zone #241

Closed ddubrava closed 1 month ago

ddubrava commented 1 month ago

What kind of change does this PR introduce?

Which library does this PR affect?

What is the current behavior?

All third-party components must be outside an Angular zone because there is no reason to run them inside. The libraries mutate the DOM on their own, and they do not need ticks (change detections).

So we need to add exitZone explicitly to the services.

What is the new behavior?

All components are created outside an Angular zone.

Does this PR introduce a breaking change?

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 79.41176% with 7 lines in your changes missing coverage. Please review.

Project coverage is 97.50%. Comparing base (7aedbcf) to head (0a24d3f).

Files Patch % Lines
.../angular-yandex-maps-v3/src/lib/utils/zone/zone.ts 45.45% 6 Missing :warning:
.../angular-yandex-maps-v2/src/lib/utils/zone/zone.ts 90.90% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #241 +/- ## ========================================== - Coverage 98.11% 97.50% -0.62% ========================================== Files 32 34 +2 Lines 1060 1080 +20 Branches 95 95 ========================================== + Hits 1040 1053 +13 - Misses 14 21 +7 Partials 6 6 ``` | [Flag](https://app.codecov.io/gh/ddubrava/angular-yandex-maps/pull/241/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniil+Dubrava) | Coverage Δ | | |---|---|---| | [angular-yandex-maps-v2](https://app.codecov.io/gh/ddubrava/angular-yandex-maps/pull/241/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniil+Dubrava) | `98.34% <94.73%> (-0.14%)` | :arrow_down: | | [angular-yandex-maps-v3](https://app.codecov.io/gh/ddubrava/angular-yandex-maps/pull/241/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniil+Dubrava) | `96.15% <60.00%> (-1.37%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniil+Dubrava#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ddubrava commented 1 month ago

ngOnChanges -> setLocation -> still causes a lot of ticks. It seems that we need somehow to disconnect the library code from zones. runOutside doesn't help in some cases