[ 
https://issues.apache.org/jira/browse/THRIFT-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randy Abernethy updated THRIFT-2350:
------------------------------------

    Attachment: 0003-reorg-of-js-tests-removed-js-tests-from-node-dir.patch

Hi Henrique,

Let me know what you think about this arrangement.

This patch applies over the prior two. It removes all of the redundant 
JavaScript browser tests from lib/nodejs/test. The nodejs/test dir installs 
with npm, so we lose these as examples in the dist.

On the lib/js side the patch breaks browser based JavaScript tests into three 
mutually exclusive files:
 ++ test.js   these are generic tests that should complete with Normal (-gen 
js) and with jQuery (-gen js:jquery) builds.
 ++ test-jq.js   these are tests that only work with the jQuery build (-ge 
js:jquery)
 ++ test-nojq.js   these are tests that only work with Normal builds (-gen js)

The test.html works as before, testing the jQuery (-gen js:jquery) 
implementation, now pulling tests from test.js and test-jq.js. The new 
test-nojq.html tests the normal (-gen js) build and runs all of the tests in 
test.js and test-nojq.js. At present build.xml only runs test.html and grunt 
only runs test-nojq.html. More to do...

> Add async calls to normal JavaScript
> ------------------------------------
>
>                 Key: THRIFT-2350
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2350
>             Project: Thrift
>          Issue Type: Improvement
>          Components: JavaScript - Compiler, JavaScript - Library
>    Affects Versions: 0.9.2
>         Environment: All
>            Reporter: Randy Abernethy
>            Assignee: Randy Abernethy
>            Priority: Minor
>             Fix For: 0.9.2
>
>         Attachments: 
> 0001-add-async-support-to-default-JavaScript-client.patch, 
> 0002-updated-grunfile-and-tests-for-async.patch, 
> 0003-reorg-of-js-tests-removed-js-tests-from-node-dir.patch
>
>
> Currently async call are only available with -gen js if you unwire the client 
> send/recv methods (pretty messy and unintuitive) or if you use jQuery (-gen 
> js:jquery). This patch makes it easy to use async callbacks with any Thrift 
> call by simply appending the desired callback to the args). e.g.
> client.myFunc(arg1, arg2, function (result) {
>     //do callback stuff with result
>     //result will be the normal return value or the exception
> });
> This patch preserves the existing sync call style (just leave off the 
> callback).
> Compiler js generator changes
> =============================
> - Combining node and jquery switches now results in a compile error rather 
> than silently producing corrupt code in ./gen-nodejs
> - Updated comments
> - Added ability to make async calls without jQuery
> Node test client.js
> ===================
> - Corrected comments and spelling
> JS thrift.js
> ====================
> - Added support for async calls w/o jQuery
> Node/JS test.js
> ====================
> - Updated comments to clarify jQuery dependency (-gen js:jquery)
> Node/JS test-nojq.js test-nojq.html
> ===================================
> - Full test suite for normal JS build (-gen js)
> Node http test server and handler
> =================================
> linted



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to