Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 6179

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 27, 20242024-11-27T04:09:08+00:00 2024-11-27T04:09:08+00:00

Episode 23/28: effect() outside Change Detection, RFCs Q&A with Angular Team

  • 60k

Effects in Signals will be decoupled from the Change Detection. The Angular Q&A provided answers to common questions about the latest RFCs.

Decouple effect() from Change Detection

Signals are tightly coupled to the template, which makes them not very suitable for generic usage.

We see this with the signal and computed function. They do nothing, unless we call them within a template or use them in an effect.

The effect plays a crucial role if we need side-effects but it comes with a constraint. It only runs during the change detection. In other words, we cannot run a signal-based side-effect outside of the change detection. That's going to change.

Alex Rickabaugh published a new PR which intends to remove the execution of the effect in the change detection. Instead, the effect runs as an asynchronous task. To be precise, the effect should run as a microtask, which is like a native Promise.

GitHub logo refactor(core): decouple effects from change detection #51049

alxhub avatar

alxhub posted on Jul 15, 2023

Previously effects were queued as they became dirty, and this queue was flushed at various checkpoints during the change detection cycle. The result was that change detection was the effect runner, and without executing CD, effects would not execute. This leads a particular tradeoff:

  • effects are subject to unidirectional data flow (bad for dx)
  • effects don't cause a new round of CD (good/bad depending on use case)
  • effects can be used to implement control flow efficiently (desirable)

This commit changes the scheduling mechanism. Effects are now scheduled via the microtask queue. This changes the tradeoffs:

  • effects are no longer limited by unidirectional data flow (easy dx)
  • effects registered in the Angular zone will trigger CD after they run (same as Promise.resolve really)
  • the public effect() type of effect probably isn't a good building block for our built-in control flow, and we'll need a new internal abstraction.

As effect() is in developer preview, changing the execution timing is not considered breaking even though it may impact current users.

View on GitHub

RFCs Q&A with the Angular Team

We shouldn't forget the “older” RFCs, which are still open. The first is about integrating control flow commands directly into the template syntax. The second one is about the possibility of deferring the loading of components.

An official Q&A took place, where members of the Angular team explained these RFCs and answered questions.

The pattern where we combine async and *ngIf for Observable will not be necessary anymore and will get a better version with the new syntax.

We've learned that Angular looked into JSX but will not follow its path. The reason is that JSX is executed code that doesn't fit Angular's approach. Some ideas from JSX might land in Angular.

Alex Rickabaugh, Angular core lead, made vague comments about the future of forms. They are looking into ways to unify the current ones, but this is a long-term goal.

youtube.com

Minor Releases

In terms of new releases, it was pretty quiet. Playwright, an E2E testing framework, moved up to version 1.36.

ChangeLog

angularjavascriptprogrammingwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers
  • Author

    Refactoring for Efficiency: Tackling Performance Issues in Data-Heavy Pages

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.