isomorfeus-react 16.12.2 → 16.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2f2cf299b88aea2632443beec126b7d0407eb85dced22573d0ad712c92019a9
4
- data.tar.gz: d4af259b498ae72fc0a09dc099a307587ae383630a77f578de1b364feeb752ff
3
+ metadata.gz: 16b27da18f07ffa5532831f4eb7223e2811186de76a311b6b6c5382daa31e07b
4
+ data.tar.gz: 94216067a6cd36e0eda714fbe5c5d807432b478da1cdb0ae193312659f879a21
5
5
  SHA512:
6
- metadata.gz: 3eea5b7f5db17a5d788b1fcc110329b00c7ef4e0ba82513e717a799ad8a456ec02ed7659e540b3ca5f544d10df04c9c1f4bc6cea38b0c650ff691879360accdf
7
- data.tar.gz: 862dfd20043bcfaae2a6aa1b416e3fadd7bc3d8d0f64faf406a92089691d132fc2125ec73c69512be7814a6e65c9f6490dc95e8ec3222da477c00b186afc3ad9
6
+ metadata.gz: 4b8414d7467dc8b04f3838db146e497556ac68d7a4016f38b4c1b445c5a035a3c157c6f9bc53d8937444677660596e6049da71865bb0681d77c5400b3c22bf75
7
+ data.tar.gz: cbf406f15a160204347a20cdb8f38293b431a0517537c80eaf742191849386fadb4bda6c56810b8b00b08c28712630a3b070915f0e50d6113f9970ed4a0c3df7
data/README.md CHANGED
@@ -39,7 +39,7 @@ Which component to use?
39
39
  - Usually LucidApp and LucidComponent along with some imported javascript components.
40
40
  - For MaterialUI LucidMaterial::App and LucidMaterial::Component along with some imported javascript components.
41
41
 
42
- Specific to Class, Pure, Lucid and LucidMaterial Components:
42
+ Specific to Class, Lucid and LucidMaterial Components:
43
43
  - [Events](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/events.md)
44
44
  - [Lifecycle Callbacks](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/lifecycle_callbacks.md)
45
45
  - [Props](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/props.md)
@@ -63,7 +63,6 @@ Other Features:
63
63
  - [Server Side Rendering](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/server_side_rendering.md)
64
64
  - [Using React Router](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/react_router.md)
65
65
  - [Isomorfeus Helpers](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/isomorfeus_helpers.md)
66
- - [Reducing Asset Size](https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/reducing_asset_size.md)
67
66
 
68
67
  ### Development Tools
69
68
  The React Developer Tools allow for analyzing, debugging and profiling components. A very helpful toolset and working very nice with isomorfeus-react:
@@ -6,10 +6,11 @@ module LucidFunc
6
6
  base.store_updates = true;
7
7
  base.equality_checker = null;
8
8
  base.instance_init = function(initial) {
9
- let ruby_instance = { instance: #{base.new(`{}`)} };
10
- ruby_instance.data_access = function() { return this.props.store; }
11
- ruby_instance.data_access.bind(ruby_instance);
12
- return ruby_instance;
9
+ let ruby_state = { instance: #{base.new(`{}`)} };
10
+ ruby_state.instance.__ruby_instance = ruby_state.instance;
11
+ ruby_state.instance.data_access = function() { return this.props.store; }
12
+ ruby_state.instance.data_access.bind(ruby_state.instance);
13
+ return ruby_state;
13
14
  }
14
15
  base.instance_reducer = function(state, action) { return state; }
15
16
  base.react_component = Opal.global.React.memo(function(props) {
@@ -7,10 +7,11 @@ module LucidMaterial
7
7
  base.store_updates = true;
8
8
  base.equality_checker = null;
9
9
  base.instance_init = function(initial) {
10
- let ruby_instance = { instance: #{base.new(`{}`)} };
11
- ruby_instance.data_access = function() { return this.props.store; }
12
- ruby_instance.data_access.bind(ruby_instance);
13
- return ruby_instance;
10
+ let ruby_state = { instance: #{base.new(`{}`)} };
11
+ ruby_state.instance.__ruby_instance = ruby_state.instance;
12
+ ruby_state.instance.data_access = function() { return this.props.store; }
13
+ ruby_state.instance.data_access.bind(ruby_state.instance);
14
+ return ruby_state;
14
15
  }
15
16
  base.instance_reducer = function(state, action) { return state; }
16
17
  base.react_component = Opal.global.React.memo(function(props) {
@@ -37,7 +37,13 @@ module React
37
37
  if (key[0] === 'o' && key[1] === 'n' && key[2] === '_') {
38
38
  let handler = ruby_style_props['$[]'](key);
39
39
  if (typeof handler === "function") {
40
- result[Opal.React.lower_camelize(key)] = handler;
40
+ let active_c = self.active_component();
41
+ result[Opal.React.lower_camelize(key)] = function(event, info) {
42
+ let ruby_event;
43
+ if (typeof event === "object") { #{ruby_event = ::React::SyntheticEvent.new(`event`)}; }
44
+ else { #{ruby_event = `event`}; }
45
+ #{`active_c.__ruby_instance`.instance_exec(ruby_event, `info`, &`handler`)};
46
+ }
41
47
  } else {
42
48
  let active_component = Opal.React.active_component();
43
49
  result[Opal.React.lower_camelize(key)] = active_component[handler];
@@ -9,6 +9,7 @@ module React
9
9
  event_handlers << name
10
10
  %x{
11
11
  var fun = function(event, info) {
12
+ let ruby_event;
12
13
  if (typeof event === "object") { #{ruby_event = ::React::SyntheticEvent.new(`event`)}; }
13
14
  else { #{ruby_event = `event`}; }
14
15
  #{`this.__ruby_instance`.instance_exec(ruby_event, `info`, &block)};
@@ -4,7 +4,11 @@ module React
4
4
  def self.extended(base)
5
5
  component_name = base.to_s
6
6
  %x{
7
- base.instance_init = function(initial) { return { instance: #{base.new(`{}`)} }; }
7
+ base.instance_init = function(initial) {
8
+ let ruby_state = { instance: #{base.new(`{}`)} };
9
+ ruby_state.instance.__ruby_instance = ruby_state.instance;
10
+ return ruby_state;
11
+ }
8
12
  base.instance_reducer = function(state, action) { return state; }
9
13
  base.react_component = function(props) {
10
14
  const oper = Opal.React;
@@ -4,7 +4,11 @@ module React
4
4
  def self.extended(base)
5
5
  component_name = base.to_s
6
6
  %x{
7
- base.instance_init = function(initial) { return { instance: #{base.new(`{}`)} }; }
7
+ base.instance_init = function(initial) {
8
+ let ruby_state = { instance: #{base.new(`{}`)} };
9
+ ruby_state.instance.__ruby_instance = ruby_state.instance;
10
+ return ruby_state;
11
+ }
8
12
  base.instance_reducer = function(state, action) { return state; }
9
13
  base.equality_checker = null;
10
14
  base.react_component = Opal.global.React.memo(function(props) {
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '16.12.2'
2
+ VERSION = '16.12.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.12.2
4
+ version: 16.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby