Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C09C10324 for ; Tue, 29 Oct 2013 04:10:27 +0000 (UTC) Received: (qmail 6591 invoked by uid 500); 29 Oct 2013 04:10:26 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 6366 invoked by uid 500); 29 Oct 2013 04:10:20 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 6345 invoked by uid 99); 29 Oct 2013 04:10:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 04:10:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gtanner@gmail.com designates 209.85.212.180 as permitted sender) Received: from [209.85.212.180] (HELO mail-wi0-f180.google.com) (209.85.212.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 04:10:11 +0000 Received: by mail-wi0-f180.google.com with SMTP id ey11so4738448wid.13 for ; Mon, 28 Oct 2013 21:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=xX/0ZaGV+3SJSh6ZwPXyA4YNp+qwkcdFsp1efKe4EvI=; b=WQ8hqOxsLUviDXeDk3+zq/GLrp4qS5D4C8WbH7e75+eKThN6M+LNi1e0PSdDWSZlN1 O1rm3vInKFWOAGfOORd1xzn4StkOWpBlUbRq0JNFC1Qhn+K8YqE8khXR7Q0K1VDigObu 1QaLIX41aWszgy4bewkl1AcXqQOMIqUVP24AVk0KNbtTnDLORT5DEK4kVmsSJLKAi9/x h7y9hxsddUQCS8WARx6CLZJssUlUE9H03EUlKVB7Ats0PvkV5dT4CXVHEpbeuPpDXU/G opE2id8kNEMqnzkN6PEMqAzgbNrpr8uD2Xvy6PdVQ3g57w83/NRZ1mge5mE9OOx55DER 5bQQ== X-Received: by 10.194.187.232 with SMTP id fv8mr643443wjc.56.1383019790996; Mon, 28 Oct 2013 21:09:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.10.167 with HTTP; Mon, 28 Oct 2013 21:09:30 -0700 (PDT) From: Gord Tanner Date: Tue, 29 Oct 2013 00:09:30 -0400 Message-ID: Subject: CommandProxy and misbehaving plugins To: dev@cordova.apache.org Content-Type: multipart/alternative; boundary=047d7bea3b825c1c2e04e9d963e6 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bea3b825c1c2e04e9d963e6 Content-Type: text/plain; charset=ISO-8859-1 Hey everyone, Long time no commit but I was working on getting cordova 3.X support working in ripple (really really close and about to release it) but I saw some weird stuff in some of the plugins. In the vibration plugin the base javascript calls into the cordova exec module [1] and does all the work in the native layer, which is perfect. BlackBerry 10 overrides the base javascript with their own implementation that just delegates this to navigator.vibrate [2]. This isn't a unique problem as firefox does the same thing but handles it behind the exec layer [3]. It would be nice if we could keep each platform as close to being the same as possible and diverge behind the exec layer (like firefox does). I saw that windows8 and firefox both have a commandProxy that they use to add in services and actions for the "native" layer. I moved this to a common plugin [4] (since it was duplicated anyway). Now that this is a common plugin we can use it to override and add in "native" modules so that BlackBerry and other platforms don't need to diverge at the javascript API layer making it harder to emulate. [1] - https://github.com/apache/cordova-plugin-vibration/blob/master/www/vibration.js [2] - https://github.com/apache/cordova-plugin-vibration/blob/master/www/blackberry10/vibrate.js [3] - https://github.com/apache/cordova-plugin-vibration/blob/master/src/firefoxos/VibrationProxy.js [4] - https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commitdiff;h=c6817556d90cc4e500c4f480b6e106b1b52d3002 --047d7bea3b825c1c2e04e9d963e6--