AAU Student Projects - visit Aalborg University's student projects portal
A master's thesis from Aalborg University
Book cover


React-compiler: Compiling React Applications to Improve Performance

Term

4. term

Education

Publication year

2020

Submitted on

Pages

127

Abstract

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.