Due to the way the Reason v3.6 was designed, the resulting JS code of just the parser alone is twice the size of the whole ReScript compiler + syntax. Since users like @bobzhang are oftentimes in slow latency networks, shaping off more than half of the bundle size would heavily decrease load times.
Here is a perf benchmark made by Bob:
Since Reason is pretty much stuck on v3.6, it would probably be a good idea to compile the Reason bundle separately, and plug the compiler + syntax back together on the frontend after lazily loading the Reason parser.
Steps to make this work:
Find a way to compile the Reason parser separately and provide one single bundle (probably in a separate repo for now)
Publish the Reason v3.6 bundle on our CDN
Hook up the parser and the compiler so they can interact with each other on the playground (verify if it works)
Change the playground logic to only load the Reason bundler when the user presses the RE button
Steps in the ReScript JSOO bundle:
Remove refmt completely
Adapt the frontend facing APIs
This will greatly reduce the complexity in the ReScript compiler repo, and make the playground loading experience way more performant.
This is basically solved. refmt is not part of the jsoo bundle since a long time and the Reason parser as part of the compiler only gets loaded when legacy versions like ReScript 9 or earlier are selected.
Due to the way the Reason v3.6 was designed, the resulting JS code of just the parser alone is twice the size of the whole ReScript compiler + syntax. Since users like @bobzhang are oftentimes in slow latency networks, shaping off more than half of the bundle size would heavily decrease load times.
Here is a perf benchmark made by Bob:
Since Reason is pretty much stuck on v3.6, it would probably be a good idea to compile the Reason bundle separately, and plug the compiler + syntax back together on the frontend after lazily loading the Reason parser.
Steps to make this work:
Steps in the ReScript JSOO bundle:
This will greatly reduce the complexity in the ReScript compiler repo, and make the playground loading experience way more performant.