Abdu Taviq

Frontend Frameworks

YouTube Video

Just Enough Frontent Framework concepts
Just Enough Frontent Framework concepts

Comparison

React Angular VueJs AngularJs SolidJs Svelte
Internal State useState Class Variables reactive()/data() $state createSignal Variables
Shared State useContext Sevices/NgRx provide/inject Services useContext setContext/getContext
Computed State useMemo Function computed Functions createMemo $:
Props Arguments/Class Variables @Input props Class Variables Arguments export
Events Callbacks @Output $emit Callbacks Callbacks dispatch
Side Effects useEffect ngAfterViewChecked watch $watch createEffect afterUpdate
Change Detection Virtual DOM (Fiber) Zones.js Virtual DOM (Proxy) $digest Cycle (Dirty Check) Direct (N/A) Direct (N/A)

Framework Component

Frontent Framework Architecture
Frontent Framework Architecture

State

It’s divided into:

Communication

Communication is trying to change the Model through the Controller and then render the View.

It’s done through:

Communication should be in a one-direction flow:

Event -> State -> Render
Event (Child) -> Listener (Parent) -> State (Parent) -> Render (Parent) -> Render (Child)

Side-effects

It’s how frameworks handles side effects that are not part of the single flow of data. Usually they are done either with Life Cycle hooks or Watchers or using directives.

They can be:

Change Detection (Reactivity)

It’s how each library finds the data changes and then updates the DOM tree.

Examples are:

Good Articles