vue-server
Advanced tools
Comparing version 0.4.17 to 0.5.0
{ | ||
"name": "vue-server", | ||
"version": "0.4.17", | ||
"version": "0.5.0", | ||
"description": "Vue.js server side version", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,3 +62,3 @@ <p align="center"> | ||
| :------------ |:--------------- | | ||
| ^0.4.0 | 1.0.0-migration | | ||
| 0.4.x-0.5.x | 1.0.0-migration | | ||
@@ -163,1 +163,4 @@ | ||
``` | ||
## Custom options | ||
* `renderServer` - accepts compiled template (a function from `require('vue-server').compiler();`) |
@@ -12,2 +12,3 @@ var compiler = require('./../compiler'); | ||
'template': true, | ||
'renderServer': true, | ||
'replace': true, | ||
@@ -217,5 +218,9 @@ 'created': true, | ||
options.template = exports.compileTemplate($logger, options.template, 'Component\'s template'); | ||
options.template = exports.compileTemplate( | ||
$logger, | ||
options.renderServer || options.template, | ||
'Component\'s template' | ||
); | ||
return Component; | ||
}; |
@@ -107,25 +107,23 @@ var log4js = require('log4js'); | ||
vm | ||
.$on('_vueServer.tryBeginCompile', function () { | ||
if (compileInProgress) { | ||
that.logger.error( | ||
'Building proccess gone wrong. Some VMs finished compilation after $root Ready' | ||
); | ||
return; | ||
} | ||
vm.$on('_vueServer.tryBeginCompile', function () { | ||
if (compileInProgress) { | ||
that.logger.error( | ||
'Building proccess gone wrong. Some VMs finished compilation after $root Ready' | ||
); | ||
return; | ||
} | ||
compileInProgress = true; | ||
this.$emit('_vueServer.readyToCompile'); | ||
this.$broadcast('_vueServer.readyToCompile'); | ||
compileInProgress = true; | ||
this.$emit('_vueServer.readyToCompile'); | ||
this.$broadcast('_vueServer.readyToCompile'); | ||
process.nextTick(function () { | ||
compilers.compile(this); | ||
process.nextTick(function () { | ||
compilers.compile(this); | ||
process.nextTick(function () { | ||
var html = renders.render(this); | ||
this.$emit('vueServer.htmlReady', html); | ||
}.bind(this)); | ||
var html = renders.render(this); | ||
this.$emit('vueServer.htmlReady', html); | ||
}.bind(this)); | ||
// } | ||
}); | ||
}.bind(this)); | ||
}); | ||
@@ -132,0 +130,0 @@ return vm; |
315474
79
7761
165