Closed 01willtx closed 5 years ago
Hello, Will!
.NET Core 2.0 is backward compatible with .NET Core 1.0. Many have long used the JavaScript Engine Switcher and ReactJS.NET in ASP.NET Core 2.0 Web Applications (for example, ReactJsDotNetMeetup).
ReactJS.NET version 3.1 and JSPool version 3.0.1 do not support the JavaScript Engine Switcher version 3.X. You need to rollback to version 2.X.
This really isn't a bug but wondering if/when there is a port to support .Net Core 2.0 coming soon.
This week will release a version 3.0.0 Alpha 6, that will support .NET Standard 2.0. But with the JavaScriptEngineSwitcher.V8 module there are problems, because .NET Standard 2.0 does not support the IExpando
interface.
I didn't realise JavaScriptEngineSwitcher 3.0 was available. I might release an alpha of JSPool and Reactjs.net that supports it.
Sent from my phone.
On Oct 11, 2017 8:01 PM, "Andrey Taritsyn" notifications@github.com wrote:
Hello, Will!
.NET Core 2.0 is backward compatible with .NET Core 1.0. Many have long used the JavaScript Engine Switcher and ReactJS.NET in ASP.NET Core 2.0 Web Applications (for example, ReactJsDotNetMeetup https://github.com/DaniilSokolyuk/ReactJsDotNetMeetup).
ReactJS.NET version 3.1 and JSPool version 3.0.1 do not support the JavaScript Engine Switcher version 3.X. You need to rollback to version 2.X.
This really isn't a bug but wondering if/when there is a port to support .Net Core 2.0 coming soon.
This week will release a version 3.0.0 Alpha 6, that will support .NET Standard 2.0. But with the JavaScriptEngineSwitcher.V8 module there are problems, because .NET Standard 2.0 does not support the IExpando interface.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/41#issuecomment-335744586, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFnHa9pYJDmYOUYE5OnIQnw3MhZOYvlks5srIP9gaJpZM4P0n1R .
I didn't realise JavaScriptEngineSwitcher 3.0 was available
@Daniel15 I wrote to you about it.
I might release an alpha of JSPool and Reactjs.net that supports it.
@Daniel15 I recommend to wait for release of version 3.0.0 Alpha 6.
@01willtx In version 3.0.0 Alpha 6 in all modules, except the JavaScriptEngineSwitcher.V8 module, added support of .NET Standard 2.0. In JavaScriptEngineSwitcher.V8 failed to solve a problem with the System.Runtime.InteropServices.Expando.IExpando
type. It only remains to wait, when authors of the ClearScript library will add support of .NET Standard.
Hi Andrey,
I am using ClearScript and trying to find a solution for a port to .NET Core 2 in my app and wondering if JavaScriptEngineSwitcher 3.0 alpha would help me make it work. You can find a more thorough description of what I'm looking for at https://stackoverflow.com/questions/47836113/how-to-execute-javascript-in-aspnet-javascriptservices-microsoft-aspnetcore-nod
Thanks in advance. Paul
Hello, Paul!
ASPNET JavaScriptServices (Microsoft.AspNetCore.NodeServices) is a bad idea. You can read my opinion on this matter in the “NodeJS as a JS Engine?” discussion.
I recommend you to use the JavaScriptEngineSwitcher.ChakraCore from version 3.X. I already wrote about how to solve your problem.
Great. Before I dig into it, is there an equivalent to AddHostObject that I use in JavascriptEngineSwitcher.ChakraCore?
Great. Before I dig into it, is there an equivalent to AddHostObject that I use in JavascriptEngineSwitcher.ChakraCore?
EmbedHostObject
. See the IJsEngine
interface and interop tests.
It's progressing. However, I'm getting an error
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot invoke a non-delegate type
at CallSite.Target(Closure , CallSite , Object , IJsEngine , String , SmartBoolean )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4[T0,T1,T2,T3](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
when calling addSmartPropertyBool (see code from https://stackoverflow.com/questions/47836113/how-to-execute-javascript-in-aspnet-javascriptservices-microsoft-aspnetcore-nod) It seems it does not like the syntax or cannot handle the object returned. I am now using IJsEngine instead of ScriptEngine.
Also, I expected this code
var TestB = new SmartBoolean(Guid.Empty, "_test", false);
script._engine.EmbedHostObject("_test", TestB);
script._engine.TimedEvaluate(Constants.DefaultScriptTimeout, "_test = true;");
would call the set operator of SmartBoolean but it's not.
Hello, Paul!
EmbedHostObject
is not full equivalent of the AddHostObject
method. For example, EmbedHostObject
method does not support collections and extension methods. I already told you, that to use the JavaScript Engine Switcher need to simplify your code and architecture.
It is possible, that the JavaScript Engine Switcher initially not suitable for your needs. Since your code is completely focused on working with the Microsoft ClearScript.V8 library, then you should wait for the implementation of .NET Standard 2.0 support.
In version 3.0.0 in all modules, except the JavaScriptEngineSwitcher.V8, added support of .NET Standard 2.0.
V8.Net supports .Net Core now.
This really isn't a bug but wondering if/when there is a port to support .Net Core 2.0 coming soon.
Thanks!
I'm trying to use React.Net with
JavaScriptEngineSwitcher.ChakraCore
(osx)