vueport 0.1.4 → 0.1.5
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 -0
- data/lib/vueport.rb +3 -2
- data/lib/vueport/node_client.rb +7 -1
- data/lib/vueport/renderer.rb +3 -3
- data/lib/vueport/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8797f912f967bbac2f39d8bd432cf8d741b5985f
|
4
|
+
data.tar.gz: 530870bb8674928cd37dcdb2dd4741eb8d99b79d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3965f4fbc6db9e9302df48680e866f0c9f7e01f2e665ed54e01e9073647e7bdc6006556beefd7a0720b71842d8f138f2c010284814dc251144717c959aa36033
|
7
|
+
data.tar.gz: 46a9a1eba532d30db227910e16392d8dc8bec3fc0142e9e01a67dcbe359bafe0cb5196cb7f451c8afefe07c82cadb742267b4b8e5fe89309bb6ea56537eb4aca
|
data/README.md
CHANGED
@@ -134,6 +134,12 @@ I use React on a regular basis for SPAs and love its functional philosophy, but
|
|
134
134
|
|
135
135
|
For a Vue.js and React [collaborative](https://github.com/vuejs/vuejs.org/issues/364) comparison, [check this out](https://vuejs.org/guide/comparison.html).
|
136
136
|
|
137
|
+
## FAQs
|
138
|
+
|
139
|
+
- **I get the error `Could not load compiled manifest from /app/public/webpack/manifest.json` in production**
|
140
|
+
|
141
|
+
You'll need to run `npm run compile` as part of your build process to generate the production JS bundle (this error is generated by WebpackRails)
|
142
|
+
|
137
143
|
## To Do
|
138
144
|
|
139
145
|
- [x] Handle SSR
|
data/lib/vueport.rb
CHANGED
@@ -12,11 +12,12 @@ module Vueport
|
|
12
12
|
server_port: 5000,
|
13
13
|
server_config_file: 'config/vueport/webpack.server.conf',
|
14
14
|
client_config_file: 'config/vueport/webpack.prod.conf',
|
15
|
-
ssr_enabled: false
|
15
|
+
ssr_enabled: false,
|
16
|
+
ssr_timeout: 3
|
16
17
|
}
|
17
18
|
end
|
18
19
|
|
19
|
-
def configure(&
|
20
|
+
def configure(&_)
|
20
21
|
yield config if block_given?
|
21
22
|
end
|
22
23
|
end
|
data/lib/vueport/node_client.rb
CHANGED
@@ -25,11 +25,17 @@ module Vueport
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def response
|
28
|
-
@response ||= http
|
28
|
+
@response ||= http
|
29
|
+
.tap { |http| http.read_timeout = timeout }
|
30
|
+
.post path, content, 'Content-Type' => 'text/plain'
|
29
31
|
end
|
30
32
|
|
31
33
|
def http
|
32
34
|
@http ||= Net::HTTP.new Vueport.config[:server_host], Vueport.config[:server_port]
|
33
35
|
end
|
36
|
+
|
37
|
+
def timeout
|
38
|
+
Vueport.config[:ssr_timeout] || 3
|
39
|
+
end
|
34
40
|
end
|
35
41
|
end
|
data/lib/vueport/renderer.rb
CHANGED
@@ -28,12 +28,12 @@ module Vueport
|
|
28
28
|
|
29
29
|
def ssr_content
|
30
30
|
Vueport::NodeClient.new(wrapper(content), path: path).run!
|
31
|
-
rescue
|
31
|
+
rescue
|
32
32
|
wrapper
|
33
33
|
end
|
34
34
|
|
35
|
-
def wrapper(
|
36
|
-
content_tag :div,
|
35
|
+
def wrapper(inner = '')
|
36
|
+
content_tag :div, inner, id: CONTENT_WRAPPER_ID, 'v-bind:class' => 'wrapperClass'
|
37
37
|
end
|
38
38
|
|
39
39
|
def ssr_enabled?
|
data/lib/vueport/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vueport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Garson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|