You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by mowcixo <gi...@git.apache.org> on 2014/10/12 16:53:35 UTC

[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

GitHub user mowcixo opened a pull request:

    https://github.com/apache/cordova-wp8/pull/62

    JsonHelper testing, and use of Newtonsoft.Json library to compile/decompile JSON

    When I tried to parse a WSSE security header with **JsonHelper**, I noticed that the **DataContractJsonSerializer** doesn't return the wanted output.
    
    That is because, the WSSE patterns has extra commas and colons in the value string, like that:
    
    ```
    UsernameToken Username="foo@bar.net", PasswordDigest="ZTQXXXXXXXXXXXXXXXXXXXXXXXXXXXX0NTJlMGE2M2I0NGJiYWM4NA==", Nonce="XXXXXXXXXXXXXXXXXXXXXXXXXXXXA==", Created="2014-10-11T18:48:07.232Z"
    ```
    
    I recommend to delegate the serialization/deserialization of JSON in the library Newtonsoft.Json for performance and a better result.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mowcixo/cordova-wp8 develop

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-wp8/pull/62.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #62
    
----
commit e434cdf82f1bde2b544c37d110f02c2248eebfb7
Author: Moisés Gramary Barbosa <mo...@webet.es>
Date:   2014-10-12T14:14:53Z

    First draft on JsonHelper tests.

commit 8d537823c885a87311344e27ee7a7740ff5ba579
Author: Moisés Gramary Barbosa <mo...@webet.es>
Date:   2014-10-12T14:38:17Z

    Simple array testing serialize/deserialize.

commit a93938d876300336c804415a63a10f8fb910190b
Author: Moisés Gramary Barbosa <mo...@webet.es>
Date:   2014-10-12T14:38:51Z

    Merge branch 'feature/implementing-json.net' into develop

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-59523467
  
    I just reviewed this pull request, it's a great improvement in performance and stability.
    Even Microsoft has replaced his __DataContractJsonSerializer__  in favor of __Newtonsoft.Json__ in ASP.NET Web Api.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-60058263
  
    Thanks for the insights guys.
    
    Besides, I found this improvement debuggin the cordova-plugin-file-transfer, in the **"parseHeaders"** function https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/wp/FileTransfer.cs#L319, **that just fails** decompiling the fragment I said in the pull request description... because it uses a split of colon...
    
    With the pull request proposal, the **"parseHeaders"** function will only have a few lines...
    
    On the other hand... the Phonegap PushPlugin https://github.com/phonegap-build/PushPlugin, that uses a Newtonsoft.Json dll, would not have to use it...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by brodybits <gi...@git.apache.org>.
Github user brodybits commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-84024563
  
    Hi @mowcixo, I tried pulling your `develop` branch into my workarea, generating a test project, and building it with Visual Studio Express 2013 but am getting a bunch of errors. Also, did you see the AppVeyor build failure?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by brodybits <gi...@git.apache.org>.
Github user brodybits commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-78657210
  
    :+1: Any idea if and when this will be included?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-83774967
  
    Ok, I will review it... Can a PR be edited?
    El 19/03/2015 20:02, "Vladimir Kotikov" <no...@github.com> escribió:
    
    > .gitmodule just adds the sources to codebase, but this is not enough. You
    > have to open template solution in VS and add a reference to corresponding
    > project manually.
    >
    > --
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/cordova-wp8/pull/62#issuecomment-83719311>.
    >



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-86358789
  
    @mowcixo, here is another solution for the problem with headers, you described: https://github.com/apache/cordova-plugin-file-transfer/pull/72


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by zahhak <gi...@git.apache.org>.
Github user zahhak commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-60050917
  
    We were wondering why cordova for wp8 is not using the Newtonsoft.Json and were thinking of implementing the exact same change. It will be awesome improvement as @SomaticIT said :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-86590836
  
    I close this pull request in favor of apache/cordova-plugin-file-transfer#72


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-86197976
  
    I just pushed another change, to include Newtonsoft.Json by nuget package manager. I think it is the best solution, because, the errors you was getting, those was because of the Newtonsoft.Json self dependences.
    
    The bad side, is that before executing, nuget has to be executed.
    
    I'm aggreed with you about cordova-windows... but to be honest, I've never tried it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-83985629
  
    Ok @vladimir-kotikov I have already included the Newtonsoft.Json project in the template, can you try if it's all right?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-68132960
  
    +1 for switching to Newtonsoft.Json (The MIT License) as it is currently a de-facto standard plus simplifies accessing/parsing arguments for cordova plugin devs.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by pietertingly <gi...@git.apache.org>.
Github user pietertingly commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-73509892
  
    +1 here also. I have issues parsing JSON in Cordova also, only on Windows Phone platform


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo closed the pull request at:

    https://github.com/apache/cordova-wp8/pull/62


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by brodybits <gi...@git.apache.org>.
Github user brodybits commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-85245731
  
    Given a version of `cordova-wp8` checked out (or extracted from a release zip) in the `cordova-wp8` subdirectory, I tried creating my test project using the following command:
    ```shell
    .\cordova-wp8\bin\create JSONTest com.test.jsontest JSONTest
    ```
    
    then in the `JSONTest` subdirectory you can find `JSONTest.sln` (Visual Studio Solution, File Explorer probably will not show the extension). You should be able to open it by double-clicking. I have Visual Studio Express 2013 installed, which should be good enough just for building and running Cordova apps for the WP8 platform.
    
    To be honest, I am not sure how much more effort we should put into the WP8 version. The Cordova-Windows version at https://github.com/apache/cordova-windows supports building universal Windows apps that work on Windows 8.0/8.1(+) and Windows Phone 8.1(+). Also, the universal Windows version provides a much smoother interface between the Javascript and native libraries including built-in libraries, C++ libraries, and .NET/C# libraries.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-81827543
  
    LGTM.  Was worried about possible compatibility breaks, but that library respects Data Contract attributes.  So, should be g2g.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-83588895
  
    @mowcixo I’ve looked at this PR today and it seems that it doesn’t add a reference to Newtonsoft JSON library to _template’s_ project file. This causes build to fail with the following error: 
    ```
    cordovalib\JSON\JsonHelper.cs(15,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) [d:\cordova\mobilespec\platforms\wp8\mobilespec.csproj]
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-78895170
  
    No one of the main countributors has pronounced about this...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-83719311
  
    `.gitmodule` just adds the sources to codebase, but this is not enough. You have to open template solution in VS and add a reference to corresponding project manually.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: [GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by Jesse <pu...@gmail.com>.
We have to evaluate if including Newtonsoft's library is a) legal, b) worth
it
Truthfully, the library itself is bigger than cordova-wp8, so this is a
non-starter for me, which is why I haven't pulled this in.

@purplecabbage
risingj.com

On Thu, Mar 19, 2015 at 9:17 AM, mowcixo <gi...@git.apache.org> wrote:

> Github user mowcixo commented on the pull request:
>
>     https://github.com/apache/cordova-wp8/pull/62#issuecomment-83647420
>
>     @vladimir-kotikov it uses a .gitmodule to do that... I don't know if
> it is the best way. How do you recommend to do that? Using the .dll
> directly?
>
>
> ---
> 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 infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

[GitHub] cordova-wp8 pull request: JsonHelper testing, and use of Newtonsof...

Posted by mowcixo <gi...@git.apache.org>.
Github user mowcixo commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/62#issuecomment-83647420
  
    @vladimir-kotikov it uses a .gitmodule to do that... I don't know if it is the best way. How do you recommend to do that? Using the .dll directly?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org