Comments (8)
Realistically, however, it will take years for all popular libraries and existing apps to migrate, that’s why I proposed this temporary solution
That’s certainly a concern. To that, we’ll just have to see. We have to go through the exercise of moving the entire components repository off of the NgZone interface and we’ll see how that goes.
At this point in the process, faking the emits is making an assumption about what libraries are expecting from that API. What we do might not satisfy that use-case at all. For example, SSR relies on zone stability to know when to serialize the page. The fake event emits are nowhere close to satisfying this requirement. For other use-cases, afterNextRender might be a drop-in replacement. The library author does need to make a choice here. Waiting for support would be the same for any breaking change released in a major version.
As a side note, your “hack” in the other issue isn’t exactly required to accomplish your goal. BootstrapApplication gets NgZone from providers so you can just provide your NgZone implementation after provideZonelessChangeDetection and it would override like any other provider.
from angular.
NoopNgZone is exactly that: a no-op. There won’t be any updates to its implementation to be more than that.
from angular.
Maybe create one more NgZone implementation with a different name but what would let apps work in a zoneless mode?
from angular.
Maybe create one more NgZone implementation with a different name but what would let apps work in a zoneless mode?
As mentioned in #54125 (comment), this is a consideration as a temporary compatibility solution (but rather unlikely to happen, in all honesty). Bringing the NgZone interface forward into the Zoneless world is not a good fit.
There’s no way to make the zone-based events have the same meaning without zones (and the differences do matter). Further, the best-effort fake emits would effectively mirror what would be available to libraries with other APIs (afterNextRender). We would want to move the community in this direction instead so they have the same behavior in Zone and Zoneless applications.
from angular.
That all makes perfect sense, I understand your plan.
Realistically, however, it will take years for all popular libraries and existing apps to migrate, that’s why I proposed this temporary solution. A solution that could work for a few years is useful enough to maintain, I think.
from angular.
I understand you better now, thank you.
What would be a solution for a service? (where you can’t use afterNextRender()
)
Thank you for the hint about that hack - you are right, I didn't think about that.
from angular.
What would be a solution for a service? (where you can’t use afterNextRender())
I think what you need is this: 80b953a
This brings up another reason we want to avoid the proposed stop-gap solution: doing that would make it possible to ignore the compatibility problem for longer. We can use the lack of the fake NgZone as a forcing function to drive feedback and development of better replacement APIs. There have been several discoveries through our own explorations here that have led to changes in how the afterRender hooks work to better serve as an NgZone replacement.
from angular.
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.
from angular.
Related Issues (20)
- NullInjectorError in combination with standAlone is very unclear? HOT 3
- Router Outlet won't work if router link is in ngTemplate HOT 2
- NullInjectorError: No provider for Firestore2! HOT 1
- angular.dev: youtube embeds are being blocked on firefox
- reading required signal input from effect causes error NG0950 when done inside structural directive creating an embedded view after promise resolves HOT 5
- withComponentInputBinding doesn't work as excepted with input signals HOT 1
- Angular 17 @for has memory leak HOT 1
- Reactive forms directives should be standalone HOT 1
- Rename Change detection "Default"
- `swPush.requestSubscription` never resolves on Arc browser (mac os) HOT 1
- AngularGPT
- Recursive template with @defer HOT 3
- The output-function page is not accessible https://angular.dev/guide/output-function
- developer preview features HOT 2
- toSignal causes the signal to not being lazy-evaluated HOT 6
- API for ngModule bootstrap for SSR? - `platformServer.bootstrapModule` vs `bootstrapApplication` of `@angular/platform-server`? HOT 2
- Renderer2 method that allows you to set signal inputs HOT 5
- Angular attributes produce HTML validation errors HOT 3
- Angular 15 - router.events are empty with nested router outlets on page refresh HOT 1
- The CSP nonce remains in the DOM after being read by Angular HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.