DotVVM 2.0.0-preview02-final
Pre-releaseBreaking changes
DotVVM Registration
Signature of registration methods was changed. The reason is to be able safely execute registration of dotvvm services in compiler.
We introduced new interface called IDotvvmServiceConfigurator
. This interface includes method void ConfigureServices(IDotvvmServiceCollection services)
. This method should includes all registrations of services needed for runtime of dotvvm. This part of code is called from compiler really often.
Warning: Avoid to init Entity Framework, calling API, sending emails and similar actions. Method void ConfigureServices(IDotvvmServiceCollection services)
is meant only for registration of DotVVM
OWIN
The parameter IDotvvmOptions options
was removed from signature of app.UseDotVVM()
method. This functionality was moved to IDotvvmServiceConfigurator
. You can simply implement IDotvvmServiceConfigurator
interface on your DotvvmStartup.cs or you can create another class. If your DotvvmStartup implements this interface then a generic parameter TDotvvmStartup from app.UseDotVVM<TDotvvmStartup>()
internally casts the DotvvmStartup as IDotvvmServiceConfigurator
.
We introduced new overload app.UseDotVVM<TDotvvmStartup, TDotvvmServiceConfigurator>()
in case you want to implement IDotvvmServiceConfigurator
to separated class.
AspNet Core
The same change as for OWIN was made on function IServiceCollection AddDotVVM<TServiceConfigurator>
.
The IDotvvmOptions options
parameter was removed and replaced by generic type that expects implementation of IDotvvmServiceConfigurator.
DotvvmConfiguration
Debug property can be modified only in IDotvvmStartup and registration method app.UseDotVVM()
. When you try to modify Debug property after initialization it throws exception.
Resources
Removed jQuery resource
In an effort to make DotVVM less depended we have removed jQuery resource. If you need it simply add jquery to you project and register in DotVVM configuration config.Resources.Register("jquery", new ScriptResource() { ... }
.
Routes
Method config.RouteTable.Add()
contained parameter type of Func<IDotvvmPresenter>
. This signature of the parameter was change to Func<IServiceProvider, IDotvvmPresenter>
. Now we provide an instance of IServiceProvider in factory method.
Some of Javascript API changes
dotvvm.postBackHandlers
was renamed todotvvm.postbackHandlers