These are chat archives for opal/opal

5th
Jan 2018
Jamie Gaskins
@jgaskins
Jan 05 2018 07:49
I took a shot at a dead-code-removal script running against a Clearwater app. I wrote about it in #1734 if anyone wants to have a look. TL;DR: it cut around 25% off the app boot time (not counting network β€” just JS execution).
Not sure how to shove it into the build pipeline, but I figure it's a decent start.
Elia Schito
@elia
Jan 05 2018 09:38
@jgaskins looks great πŸ˜ƒ!, some months ago I tried something on the same lines but never got to a viable point. The approach I used was to do a graph of calls by method definition and only keep calls that can be walked from the main app file. Probably I over complicated πŸ™‚. Anyway it’s great to see all the benefits coming from DCE, definitely something we should pursue for the next release.
@jgaskins just for info here’s the PR opal/opal#1357
Tom Black
@blacktm
Jan 05 2018 09:44

Ok, I was finally able to install the Opal gem on Windows using the RubyInstaller2 / MSYS2 / MinGW stack, which again will be the standard going forward (Ruby 2.4 and higher). Turns out that the bin symlink to the exe/ dir cannot be written unless the command prompt is "Run as administrator" (Window's equivalent to sudo, sort of). It's probably not a reasonable expectation for gem installation to require such elevated privileges, so maybe there's a better solution here.

@elia Could you share the reason the symlink was originally added here: https://github.com/opal/opal/commit/66849b5da5c54236eea5a0e5eaf95ba06a744fe3#diff-98e83379d45538379c2ac4e47c3be81d
Doing a quick Google search for windows rb_file_s_symlink turns up a bunch of GitHub issues where people have been removing symlinks from their gems to avoid the same error.

Elia Schito
@elia
Jan 05 2018 11:55
@blacktm I thought it was nice to keep the old path in place to make the transition in that commit easier, feel free to remove the symlink, or maybe replace it with a call to exec "exe/opal" preceded to something like warn "Please use the new path exe/opal etc"
Tom Black
@blacktm
Jan 05 2018 19:25
@elia Ah, well intentioned indeed. That sounds good, I'll open a PR.
Forrest Chang
@fkchang
Jan 05 2018 22:28
@elia @jgaskins cool beans on pseudo tree shaking, related I've been musing about replacing sprockets w/something more opal focussed, and hopefully more performant, tree shaking would be appropriate to do there