server_component 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/server_component.rb +0 -2
- data/lib/server_component/version.rb +1 -1
- data/server_component.gemspec +1 -1
- metadata +4 -6
- data/lib/server_component/jsrb_handler.rb +0 -10
- data/lib/server_component/railtie.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9320945a81de39a89ab9095e72f82a47e72d66cc30a46a9156f89a8e8f7735bc
|
4
|
+
data.tar.gz: 54494358d93080820cb79ef3743ecddf8a8d3dc4a2de167cf2435840b2c4408b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9230c721a1efde5cdb1e9bd67cfadcd2de2b12ea5a3fde66e8abc07b362dfd625a2eb84137c2afe7c31975638fd888bd0361eaf0fa87d7d8b11bb34bc86e1aff
|
7
|
+
data.tar.gz: b2afbce0ab6f87e36d4c1282ece5dc2bfd797036160ea5a5201fc294bc7b89a2d116ac72bc756a9481e9e252c4d4c4284c0243f2a378f41a948b8efcbb9ac7f2
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![CircleCI](https://circleci.com/gh/effective-spa/server_component_rails.svg?style=svg)](https://circleci.com/gh/effective-spa/server_component_rails) [![codecov](https://codecov.io/gh/effective-spa/server_component_rails/branch/master/graph/badge.svg)](https://codecov.io/gh/effective-spa/server_component_rails) [![Maintainability](https://api.codeclimate.com/v1/badges/3a8af74f091ff7c3dbf4/maintainability)](https://codeclimate.com/github/effective-spa/server_component_rails/maintainability)
|
1
|
+
[![CircleCI](https://circleci.com/gh/effective-spa/server_component_rails.svg?style=svg)](https://circleci.com/gh/effective-spa/server_component_rails) [![codecov](https://codecov.io/gh/effective-spa/server_component_rails/branch/master/graph/badge.svg)](https://codecov.io/gh/effective-spa/server_component_rails) [![Maintainability](https://api.codeclimate.com/v1/badges/3a8af74f091ff7c3dbf4/maintainability)](https://codeclimate.com/github/effective-spa/server_component_rails/maintainability) [![Gem Version](https://badge.fury.io/rb/server_component.svg)](https://badge.fury.io/rb/server_component)
|
2
2
|
|
3
3
|
# ServerComponent
|
4
4
|
|
@@ -31,12 +31,14 @@ class CounterComponentController < ServerComponent::ComponentController
|
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
|
+
action :increment
|
34
35
|
def increment
|
35
36
|
set_state do |s|
|
36
37
|
s.count { |prev| prev + 1 }
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
41
|
+
action :decrement
|
40
42
|
def decrement
|
41
43
|
set_state do |s|
|
42
44
|
s.count { |prev| prev - 1 }
|
@@ -70,10 +72,10 @@ class CounterBody extends Component {
|
|
70
72
|
return (
|
71
73
|
<div>
|
72
74
|
<h1>Counter</h1>
|
73
|
-
<button onClick={increment}>increment</button>
|
74
|
-
<button onClick={decrement}>decrement</button>
|
75
|
+
<button onClick={() => increment()}>increment</button>
|
76
|
+
<button onClick={() => decrement()}>decrement</button>
|
75
77
|
<hr />
|
76
|
-
<div>Count: {
|
78
|
+
<div>Count: {count}</div>
|
77
79
|
</div>
|
78
80
|
);
|
79
81
|
}
|
data/lib/server_component.rb
CHANGED
data/server_component.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ['lib']
|
33
33
|
|
34
|
-
spec.add_runtime_dependency 'jsrb', '~> 0.
|
34
|
+
spec.add_runtime_dependency 'jsrb', '~> 0.2'
|
35
35
|
spec.add_runtime_dependency 'rails', '~> 5.0', '>= 5.0.0'
|
36
36
|
|
37
37
|
spec.add_development_dependency 'bundler', '~> 1.13'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: server_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shun MIZUKAMI
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsrb
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,8 +120,6 @@ files:
|
|
120
120
|
- lib/server_component/component_router.rb
|
121
121
|
- lib/server_component/engine.rb
|
122
122
|
- lib/server_component/js_function_builder.rb
|
123
|
-
- lib/server_component/jsrb_handler.rb
|
124
|
-
- lib/server_component/railtie.rb
|
125
123
|
- lib/server_component/version.rb
|
126
124
|
- server_component.gemspec
|
127
125
|
homepage: https://github.com/effective-spa/server_component_rails
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ServerComponent
|
4
|
-
class Railtie < ::Rails::Railtie
|
5
|
-
initializer :server_component do
|
6
|
-
ActiveSupport.on_load :action_view do
|
7
|
-
ActionView::Template.register_template_handler :jsrb, JsrbHandler
|
8
|
-
end
|
9
|
-
|
10
|
-
ActiveSupport.on_load :action_controller do
|
11
|
-
ActionController::Renderers.add :jsrb do |obj, _options|
|
12
|
-
send_data obj.to_s, type: Mime[:js]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|