stimulus-rails 0.5.0 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/stimulus-importmap-autoloader.js +1 -1
- data/app/assets/javascripts/stimulus.js +1701 -2
- data/app/assets/javascripts/{stimulus@3.0.0-beta.1.js → stimulus@3.0.0-beta.2.js} +9 -33
- data/lib/stimulus/manifest.rb +12 -8
- data/lib/stimulus/version.rb +1 -1
- metadata +3 -4
- data/app/assets/javascripts/stimulus@2.js +0 -1699
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b76adfc6184f43fba7999678ff2dccaf782bf186ab6df85ed450246ab3d081b7
|
4
|
+
data.tar.gz: 507152a9434e30bafb617714b03209a47af6c036c2d5656c980f8c505f4ad6d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c563ff9bd7b2c0b81140acea06367dc4110f47a1733b613aa4e5e6d0594bc3eb4ad3353d3d8e16b74c285ca1e9cf945fdb3f85da7acc3982a5d00bf5bd6ffa4
|
7
|
+
data.tar.gz: 32e038cc0d8dfa889f29279a1970ed303e04d8150c4a1294756b37432be768d3668f741e9de4112e1a2a930e8f6043be795356b623de22f8743fe8d3c645c24e
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[Stimulus](https://stimulus.hotwired.dev) is a JavaScript framework with modest ambitions. It doesn’t seek to take over your entire front-end in fact, it’s not concerned with rendering HTML at all. Instead, it’s designed to augment your HTML with just enough behavior to make it shine. Stimulus pairs beautifully with Turbo to provide a complete solution for fast, compelling applications with a minimal amount of effort. Together they form the core of [Hotwire](https://hotwired.dev).
|
4
4
|
|
5
|
-
Stimulus for Rails makes it easy to use this modest framework with the asset pipeline and ES6/ESM in the browser. It relies on `importmap-rails` to make
|
5
|
+
Stimulus for Rails makes it easy to use this modest framework with the asset pipeline and ES6/ESM in the browser. It relies on either `importmap-rails` to make Stimulus available via ESM or a node-capable Rails (like via `jsbundling-rails`) to include Stimulus in the bundle. Make sure to install one of these first!
|
6
6
|
|
7
7
|
|
8
8
|
## Installation
|
@@ -11,7 +11,7 @@ Stimulus for Rails makes it easy to use this modest framework with the asset pip
|
|
11
11
|
2. Run `./bin/bundle install`.
|
12
12
|
3. Run `./bin/rails stimulus:install`
|
13
13
|
|
14
|
-
The installer will automatically detect whether you're using an import map or
|
14
|
+
The installer will automatically detect whether you're using an [import map](https://github.com/rails/importmap-rails) or [JavaScript bundler](https://github.com/rails/jsbundling-rails) to manage your application's JavaScript. If you're using an import map, the Stimulus dependencies will be pinned to the versions of the library included with this gem. If you're using node, yarn will add the dependencies to your `package.json` file.
|
15
15
|
|
16
16
|
|
17
17
|
## Usage
|
@@ -14,7 +14,7 @@ export function parseImportmapJson() {
|
|
14
14
|
|
15
15
|
function registerControllerFromPath(path, under, application) {
|
16
16
|
const name = path
|
17
|
-
.replace(
|
17
|
+
.replace(new RegExp(`^${under}/`), "")
|
18
18
|
.replace("_controller", "")
|
19
19
|
.replace(/\//g, "--")
|
20
20
|
.replace(/_/g, "-")
|