stimulus_reflex 3.5.0.pre9 → 3.5.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of stimulus_reflex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +122 -127
- data/README.md +13 -19
- data/app/assets/javascripts/stimulus_reflex.js +1017 -523
- data/app/assets/javascripts/stimulus_reflex.umd.js +940 -496
- data/app/channels/stimulus_reflex/channel.rb +9 -24
- data/bin/console +0 -2
- data/bin/standardize +2 -1
- data/lib/generators/stimulus_reflex/stimulus_reflex_generator.rb +68 -9
- data/lib/generators/stimulus_reflex/templates/app/controllers/examples_controller.rb.tt +9 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/consumer.js.tt +6 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/index.js.esbuild.tt +4 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/index.js.importmap.tt +2 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/index.js.shakapacker.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/index.js.vite.tt +1 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/channels/index.js.webpacker.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/config/cable_ready.js.tt +4 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/config/index.js.tt +2 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/config/mrujs.js.tt +9 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/config/stimulus_reflex.js.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +141 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application.js.tt +11 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application_controller.js.tt +74 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/index.js.esbuild.tt +7 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/index.js.importmap.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/index.js.shakapacker.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/index.js.vite.tt +5 -0
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/index.js.webpacker.tt +5 -0
- data/{test/tmp/app/reflexes/user_reflex.rb → lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt} +38 -9
- data/lib/generators/stimulus_reflex/templates/app/reflexes/application_reflex.rb.tt +27 -0
- data/lib/generators/stimulus_reflex/templates/app/views/examples/show.html.erb.tt +207 -0
- data/lib/generators/stimulus_reflex/templates/config/initializers/cable_ready.rb +27 -0
- data/lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb +18 -13
- data/lib/generators/stimulus_reflex/templates/esbuild.config.mjs.tt +94 -0
- data/lib/install/action_cable.rb +155 -0
- data/lib/install/broadcaster.rb +90 -0
- data/lib/install/bundle.rb +56 -0
- data/lib/install/compression.rb +41 -0
- data/lib/install/config.rb +87 -0
- data/lib/install/development.rb +110 -0
- data/lib/install/esbuild.rb +114 -0
- data/lib/install/example.rb +22 -0
- data/lib/install/importmap.rb +133 -0
- data/lib/install/initializers.rb +25 -0
- data/lib/install/mrujs.rb +133 -0
- data/lib/install/npm_packages.rb +25 -0
- data/lib/install/reflexes.rb +25 -0
- data/lib/install/shakapacker.rb +64 -0
- data/lib/install/spring.rb +54 -0
- data/lib/install/updatable.rb +34 -0
- data/lib/install/vite.rb +64 -0
- data/lib/install/webpacker.rb +90 -0
- data/lib/install/yarn.rb +55 -0
- data/lib/stimulus_reflex/broadcasters/broadcaster.rb +15 -8
- data/lib/stimulus_reflex/broadcasters/page_broadcaster.rb +7 -8
- data/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb +10 -10
- data/lib/stimulus_reflex/broadcasters/update.rb +3 -0
- data/lib/stimulus_reflex/cable_readiness.rb +29 -0
- data/lib/stimulus_reflex/cable_ready_channels.rb +6 -5
- data/lib/stimulus_reflex/callbacks.rb +17 -1
- data/lib/stimulus_reflex/concern_enhancer.rb +6 -4
- data/lib/stimulus_reflex/configuration.rb +12 -2
- data/lib/stimulus_reflex/dataset.rb +11 -1
- data/lib/stimulus_reflex/engine.rb +16 -9
- data/lib/stimulus_reflex/html/document.rb +59 -0
- data/lib/stimulus_reflex/html/document_fragment.rb +13 -0
- data/lib/stimulus_reflex/importmap.rb +6 -3
- data/lib/stimulus_reflex/installer.rb +274 -0
- data/lib/stimulus_reflex/open_struct_fix.rb +2 -0
- data/lib/stimulus_reflex/reflex.rb +40 -31
- data/lib/stimulus_reflex/reflex_data.rb +19 -3
- data/lib/stimulus_reflex/reflex_factory.rb +6 -3
- data/lib/stimulus_reflex/request_parameters.rb +2 -0
- data/lib/stimulus_reflex/utils/logger.rb +10 -0
- data/lib/stimulus_reflex/utils/sanity_checker.rb +8 -48
- data/lib/stimulus_reflex/version.rb +1 -1
- data/lib/stimulus_reflex/version_checker.rb +54 -0
- data/lib/stimulus_reflex.rb +2 -0
- data/lib/tasks/stimulus_reflex/stimulus_reflex.rake +250 -0
- data/package.json +36 -28
- data/{rollup.config.js → rollup.config.mjs} +6 -24
- data/stimulus_reflex.gemspec +16 -19
- data/yarn.lock +1331 -748
- metadata +129 -79
- data/LATEST +0 -1
- data/app/assets/javascripts/stimulus_reflex.min.js +0 -2
- data/app/assets/javascripts/stimulus_reflex.min.js.map +0 -1
- data/app/assets/javascripts/stimulus_reflex.umd.min.js +0 -905
- data/app/assets/javascripts/stimulus_reflex.umd.min.js.map +0 -1
- data/lib/generators/stimulus_reflex/initializer_generator.rb +0 -14
- data/test/broadcasters/broadcaster_test.rb +0 -11
- data/test/broadcasters/broadcaster_test_case.rb +0 -39
- data/test/broadcasters/nothing_broadcaster_test.rb +0 -31
- data/test/broadcasters/page_broadcaster_test.rb +0 -79
- data/test/broadcasters/selector_broadcaster_test.rb +0 -173
- data/test/callbacks_test.rb +0 -652
- data/test/concern_enhancer_test.rb +0 -54
- data/test/element_test.rb +0 -254
- data/test/generators/stimulus_reflex_generator_test.rb +0 -58
- data/test/reflex_test.rb +0 -43
- data/test/test_helper.rb +0 -71
- data/test/tmp/app/reflexes/application_reflex.rb +0 -12
- data/yarn-error.log +0 -4964
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "stimulus_reflex",
|
3
|
-
"version": "3.5.0-
|
3
|
+
"version": "3.5.0-rc1",
|
4
4
|
"description": "Build reactive applications with the Rails tooling you already know and love.",
|
5
5
|
"keywords": [
|
6
6
|
"ruby",
|
@@ -18,50 +18,58 @@
|
|
18
18
|
"dom",
|
19
19
|
"morphdom"
|
20
20
|
],
|
21
|
-
"homepage": "https://docs.stimulusreflex.com
|
22
|
-
"bugs":
|
23
|
-
|
24
|
-
},
|
25
|
-
"repository": {
|
26
|
-
"type": "git",
|
27
|
-
"url": "git+https://github.com:stimulusreflex/stimulus_reflex.git"
|
28
|
-
},
|
21
|
+
"homepage": "https://docs.stimulusreflex.com",
|
22
|
+
"bugs": "https://github.com/stimulusreflex/stimulus_reflex/issues",
|
23
|
+
"repository": "https://github.com/stimulusreflex/stimulus_reflex",
|
29
24
|
"license": "MIT",
|
30
25
|
"author": "Nathan Hopkins <natehop@gmail.com>",
|
31
|
-
"
|
32
|
-
|
26
|
+
"contributors": [
|
27
|
+
"Andrew Mason <andrewmcodes@protonmail.com>",
|
28
|
+
"Julian Rubisch <julian@julianrubisch.at>",
|
29
|
+
"Marco Roth <marco.roth@intergga.ch>",
|
30
|
+
"Nathan Hopkins <natehop@gmail.com>"
|
31
|
+
],
|
32
|
+
"main": "./dist/stimulus_reflex.js",
|
33
|
+
"module": "./dist/stimulus_reflex.js",
|
34
|
+
"browser": "./dist/stimulus_reflex.js",
|
35
|
+
"import": "./dist/stimulus_reflex.js",
|
36
|
+
"unpkg": "./dist/stimulus_reflex.umd.js",
|
37
|
+
"umd": "./dist/stimulus_reflex.umd.js",
|
33
38
|
"files": [
|
34
39
|
"dist/*",
|
35
40
|
"javascript/*"
|
36
41
|
],
|
37
42
|
"scripts": {
|
38
|
-
"lint": "yarn
|
39
|
-
"format": "yarn prettier-standard
|
43
|
+
"lint": "yarn run format --check",
|
44
|
+
"format": "yarn run prettier-standard ./javascript/**/*.js rollup.config.mjs",
|
40
45
|
"build": "yarn rollup -c",
|
41
46
|
"build:watch": "yarn rollup -wc",
|
42
47
|
"watch": "yarn build:watch",
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
48
|
+
"test": "web-test-runner javascript/test/**/*.test.js",
|
49
|
+
"test:watch": "yarn test --watch",
|
50
|
+
"docs:dev": "vitepress dev docs",
|
51
|
+
"docs:build": "vitepress build docs && cp docs/_redirects docs/.vitepress/dist",
|
52
|
+
"docs:preview": "vitepress preview docs"
|
46
53
|
},
|
47
54
|
"peerDependencies": {
|
48
55
|
"@hotwired/stimulus": ">= 3.0"
|
49
56
|
},
|
50
57
|
"dependencies": {
|
51
|
-
"@hotwired/stimulus": "
|
52
|
-
"@rails/actioncable": "
|
53
|
-
"cable_ready": "
|
58
|
+
"@hotwired/stimulus": "^3",
|
59
|
+
"@rails/actioncable": "^6 || ^7",
|
60
|
+
"cable_ready": "5.0.0-rc1"
|
54
61
|
},
|
55
62
|
"devDependencies": {
|
56
|
-
"@open-wc/testing": "^3.1.
|
57
|
-
"@rollup/plugin-
|
58
|
-
"@rollup/plugin-
|
59
|
-
"@rollup/plugin-
|
60
|
-
"@web/dev-server-esbuild": "^0.3.
|
61
|
-
"@web/dev-server-rollup": "^0.3.
|
62
|
-
"@web/test-runner": "^0.
|
63
|
+
"@open-wc/testing": "^3.1.7",
|
64
|
+
"@rollup/plugin-json": "^6.0.0",
|
65
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
66
|
+
"@rollup/plugin-terser": "^0.4.0",
|
67
|
+
"@web/dev-server-esbuild": "^0.3.3",
|
68
|
+
"@web/dev-server-rollup": "^0.3.21",
|
69
|
+
"@web/test-runner": "^0.15.1",
|
63
70
|
"prettier-standard": "^16.4.1",
|
64
|
-
"rollup": "^
|
65
|
-
"
|
71
|
+
"rollup": "^3.19.1",
|
72
|
+
"toastify-js": "^1.12.0",
|
73
|
+
"vitepress": "^1.0.0-alpha.56"
|
66
74
|
}
|
67
75
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import resolve from '@rollup/plugin-node-resolve'
|
2
|
-
import commonjs from '@rollup/plugin-commonjs'
|
3
2
|
import json from '@rollup/plugin-json'
|
4
|
-
import
|
3
|
+
import terser from '@rollup/plugin-terser'
|
5
4
|
|
6
5
|
const pretty = () => {
|
7
6
|
return terser({
|
@@ -14,13 +13,6 @@ const pretty = () => {
|
|
14
13
|
})
|
15
14
|
}
|
16
15
|
|
17
|
-
const minify = () => {
|
18
|
-
return terser({
|
19
|
-
mangle: true,
|
20
|
-
compress: true
|
21
|
-
})
|
22
|
-
}
|
23
|
-
|
24
16
|
const esConfig = {
|
25
17
|
format: 'es',
|
26
18
|
inlineDynamicImports: true
|
@@ -31,38 +23,28 @@ const umdConfig = {
|
|
31
23
|
format: 'umd',
|
32
24
|
exports: 'named',
|
33
25
|
globals: {
|
26
|
+
'@rails/actioncable': 'ActionCable',
|
34
27
|
morphdom: 'morphdom',
|
35
28
|
cable_ready: 'CableReady',
|
36
29
|
'@hotwired/stimulus': 'Stimulus'
|
37
30
|
}
|
38
31
|
}
|
39
32
|
|
33
|
+
const baseName = 'stimulus_reflex'
|
40
34
|
const distFolders = ['dist', 'app/assets/javascripts']
|
41
35
|
|
42
36
|
const output = distFolders
|
43
37
|
.map(distFolder => [
|
44
38
|
{
|
45
39
|
...umdConfig,
|
46
|
-
file: `${distFolder}
|
47
|
-
plugins: [pretty()]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
...umdConfig,
|
51
|
-
file: `${distFolder}/stimulus_reflex.umd.min.js`,
|
52
|
-
sourcemap: true,
|
40
|
+
file: `${distFolder}/${baseName}.umd.js`,
|
53
41
|
plugins: [pretty()]
|
54
42
|
},
|
55
43
|
{
|
56
44
|
...esConfig,
|
57
|
-
file: `${distFolder}
|
45
|
+
file: `${distFolder}/${baseName}.js`,
|
58
46
|
format: 'es',
|
59
47
|
plugins: [pretty()]
|
60
|
-
},
|
61
|
-
{
|
62
|
-
...esConfig,
|
63
|
-
file: `${distFolder}/stimulus_reflex.min.js`,
|
64
|
-
sourcemap: true,
|
65
|
-
plugins: [minify()]
|
66
48
|
}
|
67
49
|
])
|
68
50
|
.flat()
|
@@ -77,7 +59,7 @@ export default [
|
|
77
59
|
],
|
78
60
|
input: 'javascript/index.js',
|
79
61
|
output,
|
80
|
-
plugins: [
|
62
|
+
plugins: [resolve(), json()],
|
81
63
|
watch: {
|
82
64
|
include: 'javascript/**'
|
83
65
|
}
|
data/stimulus_reflex.gemspec
CHANGED
@@ -30,34 +30,31 @@ Gem::Specification.new do |gem|
|
|
30
30
|
}
|
31
31
|
|
32
32
|
gem.files = Dir[
|
33
|
-
"lib/**/*.rb",
|
33
|
+
"lib/**/*.{rb,rake,tt}",
|
34
34
|
"app/**/*.rb",
|
35
35
|
"app/assets/javascripts/*",
|
36
36
|
"bin/*",
|
37
37
|
"[A-Z]*"
|
38
38
|
]
|
39
39
|
|
40
|
-
gem.test_files = Dir["test/**/*.rb"]
|
41
|
-
|
42
40
|
gem.required_ruby_version = ">= 2.7.0"
|
43
41
|
|
44
|
-
rails_version = ">= 5.2"
|
45
|
-
gem.add_dependency "actioncable", rails_version
|
46
|
-
gem.add_dependency "actionpack", rails_version
|
47
|
-
gem.add_dependency "actionview", rails_version
|
48
|
-
gem.add_dependency "activesupport", rails_version
|
49
|
-
gem.add_dependency "railties", rails_version
|
42
|
+
rails_version = [">= 5.2", "< 8"]
|
43
|
+
gem.add_dependency "actioncable", *rails_version
|
44
|
+
gem.add_dependency "actionpack", *rails_version
|
45
|
+
gem.add_dependency "actionview", *rails_version
|
46
|
+
gem.add_dependency "activesupport", *rails_version
|
47
|
+
gem.add_dependency "railties", *rails_version
|
50
48
|
|
51
|
-
gem.add_dependency "cable_ready", ">= 5.0.0.
|
52
|
-
gem.add_dependency "nokogiri"
|
53
|
-
gem.add_dependency "rack"
|
54
|
-
gem.add_dependency "redis"
|
49
|
+
gem.add_dependency "cable_ready", ">= 5.0.0.rc1"
|
50
|
+
gem.add_dependency "nokogiri", "~> 1.0"
|
51
|
+
gem.add_dependency "rack", ">= 2", "< 4"
|
52
|
+
gem.add_dependency "redis", ">= 4.0", "< 6.0"
|
55
53
|
|
56
54
|
gem.add_development_dependency "bundler", "~> 2.0"
|
57
|
-
gem.add_development_dependency "
|
58
|
-
gem.add_development_dependency "
|
59
|
-
gem.add_development_dependency "
|
60
|
-
gem.add_development_dependency "
|
61
|
-
gem.add_development_dependency "
|
62
|
-
gem.add_development_dependency "standardrb", "~> 1.0"
|
55
|
+
gem.add_development_dependency "magic_frozen_string_literal", "~> 1.2"
|
56
|
+
gem.add_development_dependency "mocha", "~> 1.13"
|
57
|
+
gem.add_development_dependency "rails", *rails_version
|
58
|
+
gem.add_development_dependency "rake", "~> 13.0"
|
59
|
+
gem.add_development_dependency "standard", "~> 1.24"
|
63
60
|
end
|