Switch to using DI to acquire Node instances. Bump versions to alpha2.

This commit is contained in:
SteveSandersonMS
2015-11-02 13:35:14 -08:00
parent 301657a207
commit de991b9858
23 changed files with 103 additions and 92 deletions

View File

@@ -5,7 +5,6 @@ namespace Microsoft.AspNet.NodeServices.React
public static class ReactRenderer
{
private static StringAsTempFile nodeScript;
private static NodeInstance nodeInstance = new NodeInstance();
static ReactRenderer() {
// Consider populating this lazily
@@ -13,8 +12,8 @@ namespace Microsoft.AspNet.NodeServices.React
nodeScript = new StringAsTempFile(script); // Will be cleaned up on process exit
}
public static async Task<string> RenderToString(string moduleName, string exportName, string baseUrl) {
return await nodeInstance.InvokeExport(nodeScript.FileName, "renderToString", new {
public static async Task<string> RenderToString(INodeServices nodeServices, string moduleName, string exportName, string baseUrl) {
return await nodeServices.InvokeExport(nodeScript.FileName, "renderToString", new {
moduleName,
exportName,
baseUrl

View File

@@ -1,5 +1,5 @@
{
"version": "1.0.0-alpha1",
"version": "1.0.0-alpha2",
"description": "Microsoft.AspNet.NodeServices.React Class Library",
"authors": [
"Microsoft"
@@ -25,7 +25,7 @@
}
},
"dependencies": {
"Microsoft.AspNet.NodeServices": "1.0.0-alpha1"
"Microsoft.AspNet.NodeServices": "1.0.0-alpha2"
},
"resource": [
"Content/**/*"