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

Performance: Run formio outside of ngZone #388

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Conversation

merobal
Copy link
Collaborator

@merobal merobal commented Oct 23, 2019

Angular runs inside NgZone which counts the microtasks and runs change detection when needed. However the external JavaScript libs should run outside of the zone not to give extra work to Angular.
https://angular.io/api/core/NgZone

This PR adds abilities to run formio outside of the zone and run the events back in the zone.

Breaking Changes:

  • NgZone service is required for the components.
  • The FormioLoader service is updated. The loading flag is also available as Observable, so we can use the async pipe in the template which takes care of the change detection properly.

@merobal merobal requested a review from travist October 23, 2019 11:28
@travist
Copy link
Member

travist commented Oct 23, 2019

Again great work @merobal. In your opinion, do you believe this warrants a "major" version? I would prefer to not have to increment the major version since I prefer to keep the major versions in sync with the core renderer, but let me know. My personal preference is to just increment the minor version and inform everyone of the changes that have been made.

@merobal
Copy link
Collaborator Author

merobal commented Oct 24, 2019

We also suggest to update the minor version (v4.3) and leave in beta for few weeks until everybody tests it properly.

@travist travist merged commit 865ef95 into formio:master Oct 28, 2019
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.

2 participants