cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brodybits <>
Subject [GitHub] cordova-wp8 pull request: Added Newtonsoft json dll
Date Thu, 07 May 2015 12:32:12 GMT
Github user brodybits commented on the pull request:
    > @brodybits follow these steps:
    as documented in Could add a
reference to in the plugin for those who may be unfamiliar. Thanks @vladimir-kotikov.
    > It looks like these changes brought new test failures on wp8:
    If we would restore the old code in `JsonHelper.Serialize` in `template/cordovalib/JSON/JsonHelper.cs`
then the problem in CB-8968 goes away. Then:
    Using `JsonConvert.SerializeObject` from `Newtonsoft.Json` in cordova-plugin-file *is
working OK in the test*:
    --- a/src/wp/File.cs
    +++ b/src/wp/File.cs
    @@ -22,7 +22,9 @@
     using System.Text;
     using System.Windows;
     using System.Windows.Resources;
     using WPCordovaClassLib.Cordova.JSON;
    +using Newtonsoft.Json;
     namespace WPCordovaClassLib.Cordova.Commands
    @@ -771,7 +773,7 @@ public void readAsText(string options)
                     // JIRA:
                     // Need to perform additional serialization here because NativeExecution
is always trying
                     // to do JSON.parse() on command result. This leads to issue when trying
to read JSON files
    -                var resultText = JsonHelper.Serialize(text);
    +                var resultText = JsonConvert.SerializeObject(text);
                     DispatchCommandResult(new PluginResult(PluginResult.Status.OK, resultText),
                 catch (Exception ex)
    Using `JsonConvert.SerializeObject` from `Newtonsoft.Json` in `template/cordovalib/ScriptCallback.cs`
is *working OK in the cordova-plugin-file test*:
    --- a/template/cordovalib/ScriptCallback.cs
    +++ b/template/cordovalib/ScriptCallback.cs
    @@ -25,6 +25,8 @@
     using WPCordovaClassLib.Cordova.JSON;
     using System.Diagnostics;
    +using Newtonsoft.Json;
     namespace WPCordovaClassLib.Cordova
         /// <summary>
    @@ -65,7 +67,7 @@ public ScriptCallback(string function, string id, object msg, object
                 this.ScriptName = function;
                 String arg = String.Format("{{\"id\": {0}, \"msg\": {1}, \"value\": {2}}}",
    -                 JsonHelper.Serialize(id), JsonHelper.Serialize(msg), JsonHelper.Serialize(value));
    +                 JsonConvert.SerializeObject(id), JsonConvert.SerializeObject(msg), JsonConvert.SerializeObject(value));
                 this.Args = new string[] { arg };
    Using `JsonConvert.SerializeObject` from `Newtonsoft.Json` in `template/cordovalib/CordovaCommandCall.cs`
gave me a problem with `file.spec.83` (blob test) the first time, then was passing the cordova-plugin-file
tests when I tried it again (should be OK).
    Using `JsonConvert.SerializeObject` from `Newtonsoft.Json` in `template/cordovalib/PluginResult.cs`
gives me the errors as described in CB-8968.
    Wondering if any other Apache Cordova or major third-party plugins would be affected as

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message