Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Persist and restore ephemeral attributes of HTML elements using the Rails cache store and StimulusJS
In short, this plugin will persist UI state changes a user makes on a per-element basis.
This is useful for
Image: openjourney, prompt: mdjrny-v4 style cyborg soldering a piece of code onto a web application user interface, 8k, steampunk
Modern server-side rendering techniques like Turbo Frames/Streams, StimulusReflex and others require to persist state on the server to facilitate rerendering without UI discrepancies.
Typically, you have a few options to achieve this:
session
,session[:collapsed_categories]
etc.
Experience shows that the management of those keys tends to increase complexity.Hence, the part that this gem takes care of is the automatic generation and management of those keys.
Add this line to your application's Gemfile:
gem "solder"
And then execute:
$ bundle
Or install it yourself as:
$ gem install solder
In your view, use the solder_onto
helper to create a unique key for the element whose attributes you want to track. For example, imagine we have an online store with multiple category-specific landing pages. There's a tree view on it for further filtering items:
<%= solder_onto([current_user, @category] do %>
<details>
<summary>Outdoor Equipment</summary>
<details> ... </details>
</details>
<% end %>
IMPORTANT:
capture
works.solder_onto
as something akin to a cache key. You want it to be unique with regard to (almost always) the logged in user, and any other record it is scoped to. In fact, it adheres to the same interface as cache
Uses the active Rails cache store, possibly more adapters to come.
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that solder 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.