Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46F47DF4E for ; Thu, 4 Oct 2012 21:21:31 +0000 (UTC) Received: (qmail 18004 invoked by uid 500); 4 Oct 2012 21:21:31 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 17966 invoked by uid 500); 4 Oct 2012 21:21:31 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 17957 invoked by uid 99); 4 Oct 2012 21:21:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 21:21:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shazron@gmail.com designates 209.85.160.47 as permitted sender) Received: from [209.85.160.47] (HELO mail-pb0-f47.google.com) (209.85.160.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 21:21:24 +0000 Received: by mail-pb0-f47.google.com with SMTP id ro12so985955pbb.6 for ; Thu, 04 Oct 2012 14:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=vKjzBv+NBAlec+gOjpzWJYPzbRqQzoiZjlho1nY4r9Q=; b=ZpZeWxezSs5SD3Sraa4/ScyWsPeQNVFg9A+IZrkv1nJBEklByclTcSEAxTlbgxkpj1 QboqrE4460mby4yonGRc9V3YBzL0xwRwe8GVYzEtulDBXrZkHtKdrNtfaoKc56lLGtc/ eumI0rKJqU7OQ7gnHNJRPZutHgvH3eJI0Wr0kHYAb+eSZqZLibgFS5w/zelm9KyQ45GR RByNrEVWPK0EP8hDoRV+k6stkMfoTw+Mujb0EW/CynLvsTeioDEKh6m1z8d+KqMmv3H9 jogXY2CsGUc6qZLkJpM4ZBJ9t75Co8HIxLB7yYUvt4UK82fObPCuTJb63NWZa5hK5qtW ZaIQ== Received: by 10.68.200.72 with SMTP id jq8mr25051790pbc.38.1349385663580; Thu, 04 Oct 2012 14:21:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.76.103 with HTTP; Thu, 4 Oct 2012 14:20:23 -0700 (PDT) In-Reply-To: References: From: Shazron Date: Thu, 4 Oct 2012 14:20:23 -0700 Message-ID: Subject: Re: Changes to iOS PluginResult sending To: callback-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 +1 On Thu, Oct 4, 2012 at 2:18 PM, Brian LeRoux wrote: > nice! looks great andrew > > On Thu, Oct 4, 2012 at 10:48 PM, Andrew Grieve wrote: >> TLDR: Added a new method for plugins to use to send plugin results to JS. >> >> I've done some work to try and optimize the exec() bridge on iOS: >> https://issues.apache.org/jira/browse/CB-1579 >> >> The main goal of the change: whenever stringByEvaluatingJavascriptString is >> used to call a JS callback, poll for exec() messages using the return value. >> >> The two ways plugins sent results in before my change: >> >> Before my change, plugins would send results using either: >> [self success:pluginResult callbackId:callbackId] >> or (more commonly) >> [self writeJavascript:[pluginResult toSuccessCallback:callbackId]] >> >> >> Both of these returned a string, which means I had to create a new method >> that could take advantage of the optimization. >> >> So, the new fancy: >> [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId]; >> >> And for custom JS callbacks: >> [self.commandDelegate evalJs:js]; // has a void return value. >> >> >> sendPluginResult: and evalJs:js have the extra bonus that they are >> thread-safe and they work around cases where an alert() in the JS callback >> would result in dead-lock. >> >> I've left both of the old signatures so as to not break third-party >> plugins, but did go and update all of the core plugins. I'd like to >> deprecate them. I'll go ahead and do that tomorrow probably. >> >> I plan on updating the plugin guide to use this new method.