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 AB535DFA3 for ; Wed, 19 Dec 2012 19:39:51 +0000 (UTC) Received: (qmail 54895 invoked by uid 500); 19 Dec 2012 19:39:51 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 54790 invoked by uid 500); 19 Dec 2012 19:39:51 -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 54780 invoked by uid 99); 19 Dec 2012 19:39:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 19:39:51 +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 (athena.apache.org: domain of agrieve@google.com designates 209.85.219.45 as permitted sender) Received: from [209.85.219.45] (HELO mail-oa0-f45.google.com) (209.85.219.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 19:39:44 +0000 Received: by mail-oa0-f45.google.com with SMTP id i18so2456960oag.4 for ; Wed, 19 Dec 2012 11:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=TOiE4s9gocip/ZwtjBsYYPm9CuPM5Jix6Uq++7BnXhg=; b=joFVjaEM0GL33HNa4DNWe9vjJ9cw+3mA8vwxNjk/4ttN40TWdk6X86cLhcCMDP0Bxu WGxrwvvo2X/+ecOLIRj7vzzoTM/AJKFu77UF2ysiOeYZWou6DbT2sq5q5Rhk76c0nqiU ErnGxT5tr158IDIRApY769nf9uNCk8jqHEgPBoSSjQ0JCO1dgK7dhIn4sDlWKLfnj6ry Qc4mz8QvJuOILIkDxnUCKvWGtvms+30Tjr/SHMqtPhyvYx99mhzSRYcKSheR0KRQ9zOU eBGBo0ioT+SWMUxnFW6Tc70zxigDjpZumGPbLcTfWxrSET44Wr20ukyB6EDlD1TrQ0S/ xUqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=TOiE4s9gocip/ZwtjBsYYPm9CuPM5Jix6Uq++7BnXhg=; b=UkLT3lAHJ/Kq/UxT4hFfZv2hcuOYW3vMvmrwa/TDCvgr2dzyK8ypn65tnmK3jX2TKQ 7Tg5MYfUHaSwJlfA+Tr4wS7pddD6PZ1dSwY90jAdJ9g3q/5I0xy5iMfi+r7OIxbweLz1 4eYEOWO+8x7Zjn/OaLeO65Sx6YaBCAXA5e7G5AtCblBiKLlvui0GmzedSpPyR1G/2dEB Dn2+FfzHa6cez518779J4ddk0k1cDanz27YElgAxmb5CH1wFEO3y/8S8qO5SJUkZ9i9R ctoCGI784SCKcJorbKyyZUY5vu5uAe2IgcVwjKRDPYTdi1vlUfFd0PMswncEFTJMCn+O D/rg== Received: by 10.60.28.74 with SMTP id z10mr5861828oeg.29.1355945964080; Wed, 19 Dec 2012 11:39:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.25.137 with HTTP; Wed, 19 Dec 2012 11:39:03 -0800 (PST) From: Andrew Grieve Date: Wed, 19 Dec 2012 14:39:03 -0500 Message-ID: Subject: Food for thought over the holidays To: dev Content-Type: multipart/alternative; boundary=e89a8ff1c170860ef504d139c5f4 X-Gm-Message-State: ALoCoQkuKAy46DqymCik85K5z3/AhE3e9YBSVUAZ1VavzztfdtN0Jrrf3uFOWHDN9H1G0BEhYDctU+2vSjHdsoS8JfUV/K/9Zhno4AuMrD9JEBESjxKtntpdH8D3l28p1MPij34qHdqxPl1GWy9E/PbdeJbNXTtwXBZMFfTodWh44boj8Yjq0YJgVDVg1Qxxi3TyfvdZITDy X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff1c170860ef504d139c5f4 Content-Type: text/plain; charset=ISO-8859-1 Here's a proposal (with some unknowns) on how improve the state of JS within plugins (following on from the earlier thread on the subject). What cordova-client currently does (using iOS as the example): -Copies www -> platform/ios/www -Copies platform/ios/cordova.ios.js -> platform/ios/www/cordova.js -Copies config.xml -> platform/ios/www/config.xml, and customizes per-platform -Install plugin native code / assets via plugman What cordova-client should do to better support plugins: -Instead of considering JS the same as other assets, treat it as a first-class thing. -Build cordova.js from source (check it out as a sibling to cordova-ios.git) How we can enhance plugins: -Change from listing module->symbol mapping within common.js & platform.js, to listing this within the plugins themselves. -Maybe it could go in the plugin.xml? (clobbers / defaults / merges) -Another option is to dedicate a single .js file for exporting this info. -The plugin.xml would define which .js file is the symbols.js file -Or just hard-code it to symbols.js -This would be a normal module that would export the clobbers / defaults / merges JSON. -As a part of the cordova-client build step, collect all of the module->symbol mapping info from plugins and put it into a single symbols.js file. -Problem! Sometimes order matters! -The ordering is generally the same as inter-plugin dependencies -We should use the notion of dependency info in the package.json file when determining symbol export order. -E.g.: FileTransfer & LocalFileSystem depend on File -Or, is there dependency info in the plugin.xml? -Have the symbols.js file export an array of the DAG of the {clobbers / defaults / merges}. -We could probably do some optimizations around collapsing multiple non-dependent entries together. -Problem! What if plugin wants different JS on iOS vs Android (we really want to encourage x-platform plugins) -We should allow plugins to use the same directory structure as cordova-js -E.g. enforce that all JS files have a top-level directory called "common|android|ios|etc" -We can then merge all of the files together and run jake on the whole thing -We can have an opt-in toggle in the plugin.xml to maintain compatibility with old plugins -Or maybe just use the presence of a symbols.js file? -Old plugins will continue to treat their JS as assets --e89a8ff1c170860ef504d139c5f4--