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 68EE817CD9 for ; Wed, 5 Nov 2014 16:14:20 +0000 (UTC) Received: (qmail 91105 invoked by uid 500); 5 Nov 2014 16:14:13 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 91063 invoked by uid 500); 5 Nov 2014 16:14:13 -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 91041 invoked by uid 99); 5 Nov 2014 16:14:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 16:14:13 +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 agrieve@google.com designates 209.85.218.53 as permitted sender) Received: from [209.85.218.53] (HELO mail-oi0-f53.google.com) (209.85.218.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 16:13:47 +0000 Received: by mail-oi0-f53.google.com with SMTP id a141so10698516oig.12 for ; Wed, 05 Nov 2014 08:13:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=J2aEJYOiOduSi078hPj5qUWr4oanK7rBJe5f3ez4O+U=; b=hpQOgskH+ghDr0TgYn3zYVRMGLDQ8BwhzipfeqpgjyiCF1s6yr2DO39KfLgbPZaiRw zqrRPysIJK6EA+hO1PeVn7WCvp/tH6wiTAk8e2UrPfb8iMhgP3VimoN6YZi/d4PMNgl6 FL1k0fHjSRRM5blMdDj7LGl2/sICuW1u0zgsdzyUF9WlLoGJqCDklFho6jO3TlyMX7rG KwVABAA7a7mVjEsJqrDdXz/e/pB6kYrax0zIlouXUE56QJ1bLr3zaFG4kDlGoZqORqza BoixFdkhb+bjCSSI1mLmBcyPyUPS1v1Kuxh3pew7ltFZZGN6uCK65nHzGZBH9Ny8mfzW LrYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=J2aEJYOiOduSi078hPj5qUWr4oanK7rBJe5f3ez4O+U=; b=e82qpayB94aQbX38cSOylpxaHymn9HWvsxFGlKIPW7rYgOxfaPURCu0FZd0WWGkkVx cCdMZu9m/0fgosa7UG+gE8buFT1onl6XyYytpwibbePv0f5Z6N0VCgZg5wnbtVh87SXq 2biSeRjrxu+dIO3e1YvwJ5Dm/fIyJJLVPc6cw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=J2aEJYOiOduSi078hPj5qUWr4oanK7rBJe5f3ez4O+U=; b=aEYbBzt3CP9BOx0il8oecSQEd603US9Q0P4mn8j1bSSVD0Urfb9qxONS6KhZ0THB9s y3F8s0JCRgy4fa1ASqTm7p+oA069JZSuhtSHPUOc2Yq7uAASB6OjvTDiaFnia83AEpvT IXI9OcMc3NeeCu0RhrcFcTvoRUenzvlLGakK9RNvBT/Hn3idA5e4yQl+fJP+HcwgEZv3 h+IG+xGiGa3nWw52sf6FXijKLUusrhyP2NJbBfGEqXIZt9Y1o13+T2nzyQBWEfZe4oM9 GXrhsaBUva0jIEHAMh2CJ6tgNHQGZj66VcR1g9S+ZsyWxvNkG8r/dPVnzQZ1Utnxj0Y6 75JQ== X-Gm-Message-State: ALoCoQnOUR6QUAh6qI+QKbxfcXKRUAK6aeE4Qo2Ea5xYZqkpTTwJxKqJvv7CQtVprr4cyMBK0wcY X-Received: by 10.60.136.129 with SMTP id qa1mr2967959oeb.59.1415203980587; Wed, 05 Nov 2014 08:13:00 -0800 (PST) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.182.98.161 with HTTP; Wed, 5 Nov 2014 08:12:40 -0800 (PST) In-Reply-To: References: From: Andrew Grieve Date: Wed, 5 Nov 2014 11:12:40 -0500 X-Google-Sender-Auth: C5kmkpYSDySmz8nruODoTezpZSE Message-ID: Subject: Re: cordova-browser plugin polyfills -- which projects already have work in this space? To: dev Content-Type: multipart/alternative; boundary=047d7b339f1f8c545005071eda40 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b339f1f8c545005071eda40 Content-Type: text/plain; charset=UTF-8 On Wed, Nov 5, 2014 at 10:57 AM, Michal Mocny wrote: > Hi All, > > So there's this new cordova-browser platform thing, which is awesome. I > wanted to get the ball rolling on full plugin support for browser platform > (thanks to Suraj Pindoria + other Adobe folk for the great work so far). > > I know a bunch of people/teams have independently solved a lot of the > problems with cordova plugins not running in a browser. E.g. Some teams > have built client libraries that do feature detection and fallback. I know > there are some frameworks like angular that have libs for polyfilling > cordova plugins (I think Ionic may do this by default?). And we saw > Telerik demo cordova plugin polyfills in something that already looked like > cordova-browser at PGDay. > > Instead of re-inventing the wheel, please help point out such existing > solutions, and/or reach out to those devs and get them involved in > upstreaming. > > Core plugins that still need implementations are: > > cordova-plugin-battery-status > cordova-plugin-console > cordova-plugin-contacts > cordova-plugin-dialogs > cordova-plugin-file-transfer > cordova-plugin-file > cordova-plugin-geolocation > cordova-plugin-globalization > cordova-plugin-inappbrowser > cordova-plugin-media > cordova-plugin-media-capture > cordova-plugin-splashscreen > cordova-plugin-vibration > cordova-plugin-statusbar > cordova-plugin-test-framework > > cordova-plugins/android-legacy-websql/ > cordova-plugins/file-system-roots/ > cordova-plugins/keyboard/ > cordova-plugins/websql/ > Just deleted all but keyboard here (within cordova-plugins) as they are obsolete. > > The process for implementing a browser polyfill (I'm new to this, may be > missing steps), appears to be just like any other platform whose > implementations are in js (like firefoxos, windows). Here is the > implementation for device plugin for example: > > In plugin.xml: > > > > > > > > > > > > > > > The critical bits of src/browser/DeviceProxy.js: > > module.exports = { > getDeviceInfo: function (success, error) { > setTimeout(function () { > success({ > cordova: browser.cordovaVersion, > platform: getPlatform(), > model: getModel(), > version: getVersion(), > uuid: null > }); > }, 0); > } > }; > > require("cordova/exec/proxy").add("Device", module.exports); > > That last line is the critical bit, which signals to the bridge to forward > exec calls to these js functions for the "Device" feature. Proxy handler > is called with (success, fail, args). > > -Michal > --047d7b339f1f8c545005071eda40--