trypurescript icon indicating copy to clipboard operation
trypurescript copied to clipboard

Proposal: Add the es-optimizer as an option for ShowJS

Open mikesol opened this issue 3 years ago • 1 comments

A lot of times I use the ShowJS tab to do a quick-and-dirty performance evaluation of PS code before I use it in a repo. These days, almost all of my repos are using the es-optimizer, so my quick-and-dirty flow no longer works. I'm wondering if it's too much trouble to wire up the backend optimizer to trypurescript as an option?

mikesol avatar Oct 04 '22 08:10 mikesol

Unfortunately this is not currently realistically possible. First, The outputs of each are incompatible. That is, backend-es necessarily does not interop with main’s data constructors. So this requires the server to maintain both outputs for library code as well as CoreFn. Second, backend-es is currently batch only. It necessarily needs to optimize the whole dependency tree as it relies on that work for its own internal analysis and book keeping. It would not be realistic to process the entire dependency tree every time you paused typing.

So I think before this can even be thought about, backend-es would need to support some sort of incremental or online mode at a minimum.

natefaubion avatar Oct 04 '22 13:10 natefaubion