React-compiler: Compiling React Applications to Improve Performance
Student thesis: Master Thesis and HD Thesis
- Niclas Jon Sommer
- Kristoffer Magill Nash
4. term, Software, Master (Master Programme)
In this project, we design and imple- ment React-compiler, a compiler written in JavaScript for compiling applications writ- ten in React, a front-end framework for the web, to more performant JavaScript code. The compiled applications outperform Re- act by up to 28% - 1740% in 5 out of 10 benchmarks in the Krausest benchmarking tool. In the worst performing benchmark we are 40% worse than React. The total file size of the application is reduced by up to 87% when compiled in our benchmarks. These results are achieved, in part by, re- moving the React runtime, and minimis- ing DOM operations by computing depen- dencies of JSX elements at compile time. React-compiler does have some limitations in terms of which React features it is capa- ble of compiling such as React hooks, por- tals, context. It also does not support third party libraries without modification to the library itself.
Language | English |
---|---|
Publication date | 12 Jun 2020 |
Number of pages | 127 |