You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2012/11/22 21:54:57 UTC

[jira] [Commented] (CB-1892) Refactor type-checking code in plugins into a helper method

    [ https://issues.apache.org/jira/browse/CB-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502929#comment-13502929 ] 

Andrew Grieve commented on CB-1892:
-----------------------------------

argscheck module:
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=1dfa2ac54a41287279e6726d2b748060e1cc44bf

Lower-case .js plugin files:
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=9ba65d4f42cddf0cdc1c1f1b624df201bde0ca18
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=f400233bef00da6d3678d95e4abf745a1f62e07f
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=58990dad50f337fd8c71250398d6586ae2b055ac
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=f81be6623d3429f442a0e214adfe3f66fff32b1f
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=4864283bcc17d37d7d28d85ffed9dc41dd3931f9
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=1fe276bcb9b36ced8be236c40886a6c0dc0a1076
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=ee4a70cce10fadd7a7563eb2941f231c9841d009

So far, 4kb off of cordova.ios.js (from 192 to 188kb)
245 insertions(+), 323 deletions(-)

This is now mostly done, but need to check if it would make sense for any of the CamelCase.js files to use it.
                
> Refactor type-checking code in plugins into a helper method
> -----------------------------------------------------------
>
>                 Key: CB-1892
>                 URL: https://issues.apache.org/jira/browse/CB-1892
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaJS
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> ML Discussion: http://callback.markmail.org/thread/4vgze66wlaaxthsd
> The idea is to add a typecheck module along the lines of:
> argscheck.checkArgs('noasdf', 'testFunc', arguments);
> where n=number, o=object, a=array, s=string, d=date, f=function, *=anything
> Side-effects of this change will include:
> 1. All core plugins will have their callbacks be optional
> 2. Incorrect types will result in an exception thrown
> 3. Should reduce the size of cordova.js through removing repetitive code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira