You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Isolate's startup time on Windows became abysmally slow (~30-60s) after adding React and Reason as dependencies.
Investigating, I found the app had high disk activity, and appeared to be creating a new directory under ~/AppData/Local/Temp/... that would contain the unpacked asar, with just 300mb of bs-platform. The exe was only 60mb, so I suspect on EVERY startup it was unpacking, compiling the bs-platform tooling, and then deleting it after the app closes, but I would need to do more investigation.
Unfortunately bs-platform does not expose the runtime libraries as a separate package, so the only way to include these dependencies (for example bs-platform/lib/js/array.js) is to include all of bs-platform
Workaround
505d159 includes a janky addition to build.sh which copies out bs-platform/lib/js/*.js and reason-react into local modules, includes them in the electron-builder build and replaces all references to the bs-platform module with local modules.
Ideally rescript-lang/rescript-compiler/pull/2171 or rescript-lang/rescript-compiler/issues/2127 will separate bs-platform's Javascript stdlib into a separate package. This would be preferable because the *.bs.js files and any other libraries (e.g. reason-react) reference bs-platform. Changing the compilation of these files seems more stable than hacking at the require references afterwards.
Short of that, maybe there's a more stable way of doing this in the build. Maybe replacing require references is what webpack is for, and could make vendoring these libraries easier.
The text was updated successfully, but these errors were encountered:
Problem
Isolate's startup time on Windows became abysmally slow (~30-60s) after adding React and Reason as dependencies.
Investigating, I found the app had high disk activity, and appeared to be creating a new directory under
~/AppData/Local/Temp/...
that would contain the unpacked asar, with just 300mb of bs-platform. The exe was only 60mb, so I suspect on EVERY startup it was unpacking, compiling the bs-platform tooling, and then deleting it after the app closes, but I would need to do more investigation.Unfortunately
bs-platform
does not expose the runtime libraries as a separate package, so the only way to include these dependencies (for examplebs-platform/lib/js/array.js
) is to include all ofbs-platform
Workaround
505d159 includes a janky addition to
build.sh
which copies outbs-platform/lib/js/*.js
andreason-react
into local modules, includes them in the electron-builder build and replaces all references to thebs-platform
module with local modules.Better solution
Ideally rescript-lang/rescript-compiler/pull/2171 or rescript-lang/rescript-compiler/issues/2127 will separate
bs-platform
's Javascript stdlib into a separate package. This would be preferable because the*.bs.js
files and any other libraries (e.g.reason-react
) referencebs-platform
. Changing the compilation of these files seems more stable than hacking at therequire
references afterwards.Short of that, maybe there's a more stable way of doing this in the build. Maybe replacing
require
references is what webpack is for, and could make vendoring these libraries easier.The text was updated successfully, but these errors were encountered: