diff --git a/src/Framework/Framework/Configuration/DotvvmExperimentalFeaturesConfiguration.cs b/src/Framework/Framework/Configuration/DotvvmExperimentalFeaturesConfiguration.cs index be99e9deb..5b85913a3 100644 --- a/src/Framework/Framework/Configuration/DotvvmExperimentalFeaturesConfiguration.cs +++ b/src/Framework/Framework/Configuration/DotvvmExperimentalFeaturesConfiguration.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Text.Json.Serialization; @@ -40,15 +41,16 @@ public class DotvvmExperimentalFeaturesConfiguration [JsonPropertyName("knockoutDeferUpdates")] public DotvvmFeatureFlag KnockoutDeferUpdates { get; private set; } = new DotvvmFeatureFlag("KnockoutDeferUpdates"); + [JsonPropertyName("useDotvvmSerializationForStaticCommandArguments")] - public DotvvmGlobalFeatureFlag UseDotvvmSerializationForStaticCommandArguments { get; private set; } = new DotvvmGlobalFeatureFlag("UseDotvvmSerializationForStaticCommandArguments"); + [Obsolete("This is now enabled by default and can only be disabled by overriding services in IServiceCollection (create StaticCommandExecutor with different jsonOptions argument)", true)] + public DotvvmGlobalFeatureFlag? UseDotvvmSerializationForStaticCommandArguments => null; public void Freeze() { LazyCsrfToken.Freeze(); ServerSideViewModelCache.Freeze(); ExplicitAssemblyLoading.Freeze(); - UseDotvvmSerializationForStaticCommandArguments.Freeze(); } } diff --git a/src/Framework/Framework/Hosting/StaticCommandExecutor.cs b/src/Framework/Framework/Hosting/StaticCommandExecutor.cs index a8fd04c97..049f67bd7 100644 --- a/src/Framework/Framework/Hosting/StaticCommandExecutor.cs +++ b/src/Framework/Framework/Hosting/StaticCommandExecutor.cs @@ -29,16 +29,7 @@ public StaticCommandExecutor(IStaticCommandServiceLoader serviceLoader, IDotvvmJ this.viewModelProtector = viewModelProtector; this.validator = validator; this.configuration = configuration; - if (configuration.ExperimentalFeatures.UseDotvvmSerializationForStaticCommandArguments.Enabled) - { - this.jsonOptions = jsonOptions.ViewModelJsonOptions; - } - else - { - this.jsonOptions = new JsonSerializerOptions(DefaultSerializerSettingsProvider.Instance.SettingsHtmlUnsafe) { - WriteIndented = configuration.Debug - }; - } + this.jsonOptions = jsonOptions.ViewModelJsonOptions; } #pragma warning restore CS0618 diff --git a/src/Framework/Testing/DotvvmTestHelper.cs b/src/Framework/Testing/DotvvmTestHelper.cs index 269b42981..e15129b17 100644 --- a/src/Framework/Testing/DotvvmTestHelper.cs +++ b/src/Framework/Testing/DotvvmTestHelper.cs @@ -98,7 +98,6 @@ public static void RegisterMockServices(IServiceCollection services) private static Lazy _defaultConfig = new Lazy(() => { var config = CreateConfiguration(); - config.ExperimentalFeatures.UseDotvvmSerializationForStaticCommandArguments.Enable(); config.RouteTable.Add("TestRoute", "TestRoute", "TestView.dothtml"); config.Diagnostics.Apply(config); config.Freeze(); @@ -108,7 +107,6 @@ public static void RegisterMockServices(IServiceCollection services) private static Lazy _debugConfig = new Lazy(() => { var config = CreateConfiguration(); - config.ExperimentalFeatures.UseDotvvmSerializationForStaticCommandArguments.Enable(); config.RouteTable.Add("TestRoute", "TestRoute", "TestView.dothtml"); config.Debug = true; config.Diagnostics.Apply(config); diff --git a/src/Samples/Common/DotvvmStartup.cs b/src/Samples/Common/DotvvmStartup.cs index 98253794e..c80fd6e3b 100644 --- a/src/Samples/Common/DotvvmStartup.cs +++ b/src/Samples/Common/DotvvmStartup.cs @@ -62,7 +62,6 @@ public void Configure(DotvvmConfiguration config, string applicationPath) { config.DefaultCulture = "en-US"; } - config.ExperimentalFeatures.UseDotvvmSerializationForStaticCommandArguments.Enable(); AddControls(config); AddStyles(config);