
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
A Rails engine that provides a view helper that will speed your page loads. See the bottom of the README for the example use, that will probably make more sense than me explaining it here.
This is Alpha, naive, itch scratching bozo code.
Don't reinvent the wheel. Always reinvent the wheel.
Ponder this, good luck.
Add it to your gemfile:
gem "rails-async", :require => "async"
Add the following to your app/controllers/application\_controller.rb
:
class ApplicationController < ActionController::Base
helper :async
after_filter do
Thread.new { AsyncCache.instance.build }
end
# ...
end
That's it. If you don't want it available on every request, add it to the specific controllers where you intend to use it.
Slow page:
<h1>Accounts</h1>
<ul>
<% sleep 3.8 %>
<% @accounts.each do |account| %>
<li>
<%= render 'account', :account => account %>
</li>
<% end %>
</ul>
Fast page:
<h1>Accounts</h1>
<ul>
<% asynchronously do %>
<% sleep 3.8 %>
<% @accounts.each do |account| %>
<li>
<%= render 'account', :account => account %>
</li>
<% end %>
<% end %>
</ul>
Async worries about responding, you worry about why your code is so slow.
Speed: at what point is an approach like this worse than just rendering the whole page at once? Gotta measure to know if you're improved anything.
Practicality of testing: what's the mimimum viable test rig?
Praticality in general: who's gonna use it? When would this be more useful than manual ajax / async page splitting?
FAQs
Unknown package
We found that rails-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.