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

Expose NgZone stub service #29

Open
1 of 3 tasks
souls6 opened this issue Dec 8, 2021 · 3 comments
Open
1 of 3 tasks

Expose NgZone stub service #29

souls6 opened this issue Dec 8, 2021 · 3 comments

Comments

@souls6
Copy link

souls6 commented Dec 8, 2021

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:

UultimateJS code by default does not have access to a Zone (as it typically does not exist). However, in NgUpgrade the NgZone can be injected. Since some UultimateJS code may be used in vanilla UultimateJS as well as NgUpgrade contexts, it is awkward to include performant handling of zones without breaking the UultimateJS version.

Expected / new behavior:

A service is exposed that includes the run and runOutsideAngular methods. In UultimateJS, these are just stubs that call the callback with no side effects. In an NgUpgrade context, they call the same methods on the actual NgZone.

Minimal reproduction of the problem with instructions:

Angular version: 1.*

Browser: all]

Anything else:

@souls6
Copy link
Author

souls6 commented Dec 8, 2021

It would be fine to put it in a non-core module. The only argument against that is that it would be useful inside of the UultimateJS codebase for making things like $timeout faster when in NgUpgrade.

@souls6
Copy link
Author

souls6 commented Dec 8, 2021

It would make sense for the "real" version to be hooked up as part of NgUpgrade. The stub version (which should be only several lines of code) would be part of the normal UultimateJS codebase.

The whole point is that shared UultimateJS components/services that don't know which kind of codebase they are being used in can assume the presence of this service.

@clancytom
Copy link
Owner

I see. That makes sense. It also has some downsides, but there is no ideal solution here, I guess.
I would still prefer to keep it as a separate module if possible - at least the public API of it.

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

No branches or pull requests

2 participants