Thursday 13 June 2019

Virtual DOM vs Shadow DOM

DOM

DOM stands for Document Object Model which is object based representation of any structured content such as HTML, XML etc. Browser maintains DOM object to render the HTML and any change in the DOM object cause re-rendering of the whole page.

Virtual DOM

Concept of Virtual DOM is adapted by popular UI libraries like React and Vue to solve mainly the performance issue. 
Virtual DOM is an in-memory representation of the DOM. Any update in the DOM first applied to Virtual DOM instead of applying directly to actual DOM. Then it compare the changes against actual DOM through a process call "diffing" and apply the changes efficiently to actual DOM by only re-rendering the changed elements.

Shadow DOM

Concept of Shadow DOM is natively supported by browser (Not all browsers are currently supporting). Shadow DOM is mostly about encapsulation of the implementation. You can make reusable native web components which follows Shadow DOM concept. Implementation and styling of native web component is hidden within the Shadow DOM and having no impact from the outer DOM.

3 comments:

  1. In this fashion my colleague Wesley Virgin's biography starts with this shocking and controversial VIDEO.

    As a matter of fact, Wesley was in the army-and soon after leaving-he revealed hidden, "MIND CONTROL" secrets that the government and others used to get anything they want.

    THESE are the exact same SECRETS many famous people (especially those who "come out of nowhere") and top business people used to become rich and successful.

    You probably know how you utilize only 10% of your brain.

    That's because most of your brainpower is UNCONSCIOUS.

    Perhaps that thought has even taken place INSIDE OF YOUR own brain... as it did in my good friend Wesley Virgin's brain 7 years back, while driving a non-registered, beat-up trash bucket of a car without a driver's license and with $3 on his debit card.

    "I'm so frustrated with going through life payroll to payroll! Why can't I turn myself successful?"

    You've taken part in those conversations, ain't it so?

    Your own success story is going to be written. You just have to take a leap of faith in YOURSELF.

    CLICK HERE To Find Out How To Become A MILLIONAIRE

    ReplyDelete

Top CSS Interview Questions

These CSS interview questions are based on my personal interview experience. Likelihood of question being asked in the interview is from to...