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

This virtual-dom algorithm is used in facebook react Native? #424

Open
rogerjiang opened this issue Jan 16, 2017 · 1 comment
Open

This virtual-dom algorithm is used in facebook react Native? #424

rogerjiang opened this issue Jan 16, 2017 · 1 comment

Comments

@rogerjiang
Copy link

Is this virtual-dom algorithm used in reactNative. I don't know what is the different between the react Native. Thank you very much.

@arun2786
Copy link

arun2786 commented Feb 27, 2017

React creates a new object of DOM tree (VirtualDOM tree) and manipulates it thus increases performance.
To port this new DOM structure to various platforms we do need something that maps to the View components existing in Android and iOS, which is like reimplement a subset of a real DOM based on mobile technology.
Dont know what kind of replacement is used by react-native but WEEX is one of the solutions.

React used VirtualDOM that is a form of IR (Intermediate Representation)

IR: An intermediate representation is a representation of a program part way between the source and target languages. A good IR is one that is fairly independent of the source and target languages, so that it maximizes its ability to be used in a re-targetable compiler.

  1. Original code is spitted out to Intermediate Representation (IR) code.
  2. Then optimiser, mangling one IR into optimised equivalent IR (android, ios).
  3. Then, machine code is produced by this IR optimised for a specific CPU (x86, arm, etc...)

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