mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Switch to using DI to acquire Node instances. Bump versions to alpha2.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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/**/*"
|
||||
|
||||
Reference in New Issue
Block a user