Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Possible reversion back to pure Ruby processing in frontend bundling#170

jaredcwhite started this conversation inGeneral
Discussion options

Hey@rubys,

As awesome a feat as it was to compile Ruby2JS's Ruby code with Opal so it could be used in a pure-Node environment, I've found several challenges working within that setup… A few months ago I had to pin to an older Opal version because new ones totally broke my builds, and I suspect that may still be an issue. Another issue is the Ruby syntax is mismatched between the environments: I can use Ruby 3.1 hash shorthand in my Ruby code but not in my Ruby2JS code. Maybe successfully upgrading Opal would help with that, but there could be other similar lag periods down the road.

I also recently switched a large Rails project with quite a robust set of .js.rb files to esbuild, and was a little surprised the bundling build speeds weren't great…almost 8 seconds total (that's also including Sass styles and a few other JS files). On a whim, I decided to write a replacement esbuild plugin which spawns a Ruby process (similar to my original Webpack plugin back in the day) to compile each file. This happens in parallel for each file so a lot of Ruby processes can happen at once.

I was shocked to find the build speed improved to under 4 seconds! It was an almost 2x improvement.

So I'm inclined to switch the esbuild plugin's default processing mode to use Ruby spawns. Maybe keep the Opal/JS method around as an option, or a separate package. Not sure. Before I plow ahead with this I wanted to get your take on the matter. TIA!

You must be logged in to vote

Replies: 1 comment

Comment options

jaredcwhite
Aug 16, 2022
Maintainer Author

Just pushed a PR up to Render hosting platform with the new custom plugin…previously esbuild was taking 23 seconds to build before, now it's down to 12! Wow

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
1 participant
@jaredcwhite

[8]ページ先頭

©2009-2025 Movatter.jp