-
Notifications
You must be signed in to change notification settings - Fork 920
Remove auto-registered JS engines from React.Core #582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Website preview is ready! |
Ugh.. cassette does not seem to work with .NET 4.5. Going to roll back those changes (should be minor) |
Tested all the samples, they pass. This should be ready for review. |
I'll try to reply in 36 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! We can include this as part of the 4.x release, since we already have another breaking change (switching to newer JsEngineSwitcher beta version) :)
I do still wonder if we should remove the usage of JsEngineSwitcher.Current
and instead use the IoC container to manage its life cycle. I guess that'd make registering JS engines a bit more difficult though. Probably not worth it?
title: Webpack | ||
--- | ||
|
||
This guide is for Webpack 1. To see the latest example for how to use webpack, check out the [sample project](https://github.com/reactjs/React.NET/tree/master/src/React.Sample.Webpack). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should upgrade this guide one day.
.SetReuseJavaScriptEngines(false); | ||
|
||
JsEngineSwitcher.Current.DefaultEngineName = MsieJsEngine.EngineName; | ||
JsEngineSwitcher.Current.EngineFactories.AddMsie(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if a singleton instance of JsEngineSwitcher
should be registered in the IoC container rather than using the static Current
property.
My suggestions are as follows:
catch (JsEngineLoadException ex)
{
Trace.WriteLine(string.Format("Error initialising {0}: {1}", engineFactory, ex));
exceptionMessages.Add(ex.Message);
} This code intercepts almost all common errors that occur when creating engines. In the |
This can introduce additional confusion. |
Thanks for the feedback. I pushed an update to exception logging. Changing the way the default JS engine is selected seemed out of scope for this PR and I'm not quite sure yet if a web project would need default JS engine separately from the built-in handling in JsEngineSwitcher. As long as So with that in mind, I'll merge after the build passes. |
This started as an effort to remove VroomJs from the core library, and evolved into removing the default engine registration logic, so the core library can remain simple. The MSBuild project ends up registering the MSIE engine directly, which works fine. I updated a lot of the documentation to make getting started more clear as well.
Previous efforts are in #501, #459 , and #456
Once this is merged we can work on #566 :)