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 5FE8AC985 for ; Thu, 3 May 2012 20:31:24 +0000 (UTC) Received: (qmail 50947 invoked by uid 500); 3 May 2012 20:31:24 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 50893 invoked by uid 500); 3 May 2012 20:31:24 -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 50885 invoked by uid 99); 3 May 2012 20:31:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 20:31:24 +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 purplecabbage@gmail.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 20:31:19 +0000 Received: by wibhj13 with SMTP id hj13so623521wib.0 for ; Thu, 03 May 2012 13:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RDbigwhlt3pNSP8GPLxDRQE5E9TvgeQg03VEbHDr3u0=; b=qXUrrcCp5y691sqVKpGJv7jJ8rNSywVfWQ9IOeOZC5R7UUdfBLmNq0MrnwXNi+hL9M /SiKTiE5/vyoM/xR0QTO7/s0f55eNipETkR3fmwB/5opVJDoWmmyAS8Tced2gsnulofZ qBTfpTiAYqzsuydLIxx0qn/A5n4FC+gsm1RvbZ5ixfnqu+jesrKsELqWx/DdV0n4KxUY sSYI3B2l6pgh+uPVBNf9M00pDg7T8UnxRnVdettBi88hfVIriAB0QjU9MkrMg2ggBqNr 5U0Eo9cRPgeJJflaRYMgP8J+SWDjc6uu5T+lM1V/YM/685yv14rQ0+9Ir1ZFWtkzUBzW GKqQ== MIME-Version: 1.0 Received: by 10.216.205.35 with SMTP id i35mr2378358weo.17.1336077058052; Thu, 03 May 2012 13:30:58 -0700 (PDT) Received: by 10.216.196.35 with HTTP; Thu, 3 May 2012 13:30:57 -0700 (PDT) In-Reply-To: References: <2484959577825821691@unknownmsgid> <5870768929662404887@unknownmsgid> Date: Thu, 3 May 2012 13:30:57 -0700 Message-ID: Subject: Re: Checking platform + version in cordova-js From: Jesse To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=0016e6dbdf2670126004bf27ae97 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6dbdf2670126004bf27ae97 Content-Type: text/plain; charset=ISO-8859-1 I like that approach best so far, since it is relatively a small change, and easily proven. Given that we have detected a mis-match, how do we respond? window.alert is NOT supported on all platforms ( pre deviceready) console.log is NOT supported on all platforms ( pre deviceready) Should we just document.write('there is a problem'); ?? On Thu, May 3, 2012 at 1:14 PM, Shazron wrote: > Just throwing out an idea - iOS used to inject a DeviceInfo js object > on load. Could we do a check in cordova.js based on a known variable > being set by the native wrapper? > > On Thu, May 3, 2012 at 1:01 PM, Shazron wrote: > > @jesse it's not a problem for "us", it's a problem with users. Trust > > me it will be a headache for users judging from the mailing lists. > > Better if we inject, no fuss - since a version of the .js is tightly > > coupled with the .framework anyway. In a CLI world sure -- judging > > from our user-base, probably not. We can test this by removing the > > template for a version and see who complains :P > > > > I'm not opposed to it, I just think if we want to change, might as > > well go for the best solution. > > > > However, we still haven't solved the "how do we detect they are using > > the wrong cordova version without going to the bridge", this however > > solves the "wrong platform cordova js in your www folder" problem. > > > > On Thu, May 3, 2012 at 12:51 PM, Jesse MacFadyen > > wrote: > >> @shaz > >> I replied before reading yours... > >> > >> I don't see really what the problem is with having it be a resource to > >> the project... > >> The only issue I see is updating to a new version, the dev would have > >> to update the js file manually if they started from a template. > >> In a CLI world it would be trivial wouldn't it? > >> > >> I guess the part of this approach that I like is that it is > >> transparent, I do understand though that it may be 'not enough' > >> > >> > >> Cheers, > >> Jesse > >> > >> Sent from my iPhone5 > >> > >> On 2012-05-03, at 11:48 AM, Shazron wrote: > >> > >>> Yeah - read my post again wrt to maintenance. How do you think the > >>> app/cordova.js gets in there in the bundle? It has to be a resource in > >>> the the Xcode project - a hard-coded thing. > >>> > >>> On Thu, May 3, 2012 at 11:46 AM, Jesse MacFadyen > >>> wrote: > >>>> Actually, I was just saying that the device specific js file was > >>>> referenced from the parent folder to www That way when the dev > >>>> dropped their www into a different project it was still valid. > >>>> > >>>> I mean this: > >>>> > >>>> > >>>> So the package at runtime would look like: > >>>> app/cordova.js > >>>> app/www/index.html > >>>> > >>>> > >>>> The injection approach is interesting, but a much larger change and > >>>> potentially a long path until it works for all. Architecturally I like > >>>> it, but worry about the number of moving parts in the move from here > >>>> to there. > >>>> > >>>> Cheers, > >>>> Jesse > >>>> > >>>> Sent from my iPhone5 > >>>> > >>>> On 2012-05-03, at 11:22 AM, Filip Maj wrote: > >>>> > >>>>> Are you saying, seeding the webview with the JS contents before > loading > >>>>> app assets? We could even eliminate the need for having a