railspack 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 212441dbc951327c53fb8721a922963da670d0c6
4
- data.tar.gz: 728816d54d0bc12c181439063c8074cc01f244ff
3
+ metadata.gz: 6c9da26d2c28aa7eb1d9ca84f20addaf6e08957d
4
+ data.tar.gz: 5edad48183231ee88947c3a3d776c6a7988aa740
5
5
  SHA512:
6
- metadata.gz: bc95717ba0a937f4ae29b9aa504c0f834467ac0497480e7f0ab832c57ebd5f29c8973d8e74be60ce6643789ac2c810f81d297564294a3d936981542a08d7f64c
7
- data.tar.gz: 4279bb674a694aa0286e98087b69eb9a17c4692ca9efc02b149a7e5f396386ee4209b29bb3490eade30d72a875869650d3f3a9a98d81889839da18c80ca7ce72
6
+ metadata.gz: 1841d6efadd7d4ec921fe790a16abda2643e6c4cb1d8b5ceeb5db3ac29bcbd910ae94a4b8c91251502c132ca0077612942b09e78e999158e419d0535377f29eb
7
+ data.tar.gz: 9fa4ce4f2d005e546f343451ad86e92653dc8478687439758c38fa02dfbfc76cd55ef3a104601bf8adb73b7f90a8234403b84783247214e3b5bcb4f83b4277fc
@@ -10,9 +10,11 @@ const getProps = (container) => {
10
10
 
11
11
  export const registerComponent = (instance, containerName) => {
12
12
  const selector = `[data-react-container=${containerName}]`
13
- const container = document.querySelector(selector)
14
-
15
- if (container) {
13
+ const containers = document.querySelectorAll(selector)
14
+
15
+ for (let i = 0; i < containers.length; ++i) {
16
+ let container = containers[i];
17
+
16
18
  const props = getProps(container)
17
19
  const element = React.createElement(instance, props)
18
20
  ReactDOM.render(element, container)
@@ -10,6 +10,12 @@ module.exports = {
10
10
  path: path.join(__dirname, 'app', 'assets', 'javascripts'),
11
11
  filename: 'frontend.js'
12
12
  },
13
+
14
+ plugins: [
15
+ new webpack.DefinePlugin({
16
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
17
+ })
18
+ ],
13
19
 
14
20
  module: {
15
21
  loaders: [
@@ -1,3 +1,3 @@
1
1
  module Railspack
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railspack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdmorlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-21 00:00:00.000000000 Z
11
+ date: 2016-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -126,4 +126,3 @@ signing_key:
126
126
  specification_version: 4
127
127
  summary: Integrate webpack into your Rails app
128
128
  test_files: []
129
- has_rdoc: