crumble-stimulus
github.com/sbsoftware/crumble-stimulus
Seamless integration of stimulus.cr into crumble
Installation
# Add this to your shard.yml
dependencies:
crumble-stimulus:
github: sbsoftware/crumble-stimulus
version: ~> 0.4.3Then run:
shards installshard.yml
- Crystal
1.9.2- License
- MIT
- Author
- Stefan Bilharz
Dependencies
Runtime Dependencies
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
crumble-stimulus
Seamless integration of stimulus.cr into crumble, providing a JS module that includes all your Stimulus::Controllers that is automatically added to your layout template.
Installation
-
Add the dependency to your
shard.yml:dependencies: crumble-stimulus: github: sbsoftware/crumble-stimulus -
Run
shards install
Usage
# make sure this comes before you require any controllers you want to include,
# otherwise they'll be missing
require "crumble-stimulus"
# or wherever your Stimulus controllers are
require "./stimulus_controllers/*"
The Crumble::StimulusControllers script is automatically added to any template inheriting from the generic ToHtml::Layout. Stimulus is served by the application as a fingerprinted asset, so pages do not depend on a third-party request for the runtime.
Vendored Stimulus runtime
The shard vendors the stimulus.js ES module from @hotwired/stimulus 3.2.2. The upstream MIT license is included at vendor/stimulus/3.2.2/MIT-LICENSE, and its notice is preserved in the served JavaScript.
To upgrade Stimulus, replace both vendored files from the same pinned upstream release, preserve the complete license notice at the start of the JavaScript file, update the version in the registered asset path and this documentation, and run the full spec suite.
Custom Layout
If you don't use a layout based on ToHtml::Layout, you'll have to include the Crumble::StimulusControllers script manually:
html do
head do
# [...]
Crumble::StimulusControllers
# [...]
end
end
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.4.3- Tagged
- Mar 3, 2026
- Commit
7e104086fa30- Crystal
1.9.2- Indexed
- yes
Dependents
Repository
github.com/sbsoftware/crumble-stimulus
Metadata
- Created
- Aug 12, 2026
- Updated
- Oct 11, 2026
- Synced
- Oct 11, 2026
- Versions
- 10