Skip to content
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

feat: create all components outside an Angular zone #241

Merged
merged 3 commits into from
Jul 14, 2024
Merged

Conversation

ddubrava
Copy link
Owner

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Build or CI related changes
  • Documentation content changes

Which library does this PR affect?

  • angular-yandex-maps-v2
  • angular-yandex-maps-v3

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).

  • In v2 YaApiLoaderService is implicitly outside a zone
  • In v3 YApiLoaderService is in a zone, all components are also created in a zone

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?

  • Yes
  • No

@ddubrava ddubrava self-assigned this Jul 14, 2024
Copy link

codecov bot commented Jul 14, 2024

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 ⚠️
.../angular-yandex-maps-v2/src/lib/utils/zone/zone.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            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 Coverage Δ
angular-yandex-maps-v2 98.34% <94.73%> (-0.14%) ⬇️
angular-yandex-maps-v3 96.15% <60.00%> (-1.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddubrava ddubrava merged commit 9d298a1 into main Jul 14, 2024
3 of 5 checks passed
@ddubrava ddubrava deleted the ng-zone-fixes branch July 14, 2024 20:43
@ddubrava
Copy link
Owner Author

ddubrava commented Jul 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant