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 311F91731A for ; Wed, 8 Apr 2015 09:12:52 +0000 (UTC) Received: (qmail 64819 invoked by uid 500); 8 Apr 2015 09:12:46 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 64780 invoked by uid 500); 8 Apr 2015 09:12:46 -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 64769 invoked by uid 99); 8 Apr 2015 09:12:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 09:12:46 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=RCVD_ILLEGAL_IP,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Tim.Barham@microsoft.com designates 157.56.111.132 as permitted sender) Received: from [157.56.111.132] (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.111.132) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 09:12:41 +0000 Received: from BN3PR0301CA0030.namprd03.prod.outlook.com (0.160.180.168) by BN1PR0301MB0643.namprd03.prod.outlook.com (0.160.171.16) with Microsoft SMTP Server (TLS) id 15.1.130.23; Wed, 8 Apr 2015 09:12:19 +0000 Received: from BL2FFO11OLC001.protection.gbl (2a01:111:f400:7c09::169) by BN3PR0301CA0030.outlook.office365.com (2a01:111:e400:4000::40) with Microsoft SMTP Server (TLS) id 15.1.130.23 via Frontend Transport; Wed, 8 Apr 2015 09:12:19 +0000 Authentication-Results: spf=pass (sender IP is 206.191.230.212) smtp.mailfrom=microsoft.com; cordova.apache.org; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of microsoft.com designates 206.191.230.212 as permitted sender) receiver=protection.outlook.com; client-ip=206.191.230.212; helo=064-smtp-out.microsoft.com; Received: from 064-smtp-out.microsoft.com (206.191.230.212) by BL2FFO11OLC001.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (TLS) id 15.1.142.12 via Frontend Transport; Wed, 8 Apr 2015 09:12:17 +0000 Received: from HKXPR30MB021.064d.mgd.msft.net (141.251.57.209) by HKXPR30MB022.064d.mgd.msft.net (141.251.57.210) with Microsoft SMTP Server (TLS) id 15.1.125.19; Wed, 8 Apr 2015 09:12:15 +0000 Received: from HKXPR30MB021.064d.mgd.msft.net ([141.251.57.209]) by HKXPR30MB021.064d.mgd.msft.net ([141.251.57.209]) with mapi id 15.01.0125.002; Wed, 8 Apr 2015 09:12:15 +0000 From: Tim Barham To: "dev@cordova.apache.org" Subject: Re: Question about plugin/platform --save: src vs version? Thread-Topic: Question about plugin/platform --save: src vs version? Thread-Index: AdBqle4E8p63N8fSRluHt7Er1LYCEgAYd7UAAAs8q4AACYHPAAALEecAAAqJvCYADtEQgAApBcFOAA+ekYAA7PLuEgAJJbCAAAfUAJYASUn9uQ== Date: Wed, 8 Apr 2015 09:12:15 +0000 Message-ID: <1428484343453.2896@microsoft.com> References: <87D960E7-4D04-4461-8BD6-057F6505AB13@gmail.com> <36B80F86-DA4A-4E75-AB31-012FBE3549F7@gmail.com> <1428330522948.38732@microsoft.com>,,<1428358691483.86117@microsoft.com> In-Reply-To: <1428358691483.86117@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [58.173.149.75] Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:206.191.230.212;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(438002)(51704005)(252514010)(24454002)(41574002)(377454003)(52314003)(51444003)(164054003)(189002)(199003)(479174004)(86146001)(110136001)(2656002)(6806004)(50466002)(2501003)(50986999)(107886001)(19580405001)(62966003)(19580395003)(87936001)(106466001)(47776003)(92566002)(46102003)(15975445007)(2351001)(76176999)(86362001)(2950100001)(36756003)(77156002)(16796002)(2900100001)(117636001)(102836002)(54356999)(66066001)(450100001)(93886004)(21314002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR0301MB0643;H:064-smtp-out.microsoft.com;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0643; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:BN1PR0301MB0643;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0643; X-Forefront-PRVS: 0540846A1D X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2015 09:12:17.4918 (UTC) X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;Ip=[206.191.230.212];Helo=[064-smtp-out.microsoft.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0643 X-Virus-Checked: Checked by ClamAV on apache.org @gorkem - are you ok for this to be merged, or do you feel strongly we shou= ld stick with 'version'? Thanks, Tim ________________________________________ From: Tim Barham Sent: Tuesday, April 7, 2015 8:18 AM To: dev@cordova.apache.org Subject: Re: Question about plugin/platform --save: src vs version? Thanks Jesse. Well, according to semver standards, a bumped minor version means it is 100= % backwards compatible, and I'm hoping semver at least complies with semver= standards :). But I did look through all our uses of semver and everything= seemed pretty basic - nothing to raise a concern with a minor version chan= ge. ________________________________________ From: Jesse Sent: Tuesday, April 7, 2015 4:28 AM To: dev@cordova.apache.org Subject: Re: Question about plugin/platform --save: src vs version? I'm okay with spec, the pr looks good. Are there any side-effects updating the version of sem-ver? @purplecabbage risingj.com On Mon, Apr 6, 2015 at 7:28 AM, Tim Barham wrote= : > Ok, so... Jesse's ok with 'spec', but prefers 'src'. Gorkem prefers > 'version'. Glad we at least agree we need something :). > > So, because I'd like to wrap this up and get this change in (in part > because along with this specific change I have a couple of fixes for > platform - save the version that was actually installed, and save it as a > tilde range), I've coded up all three. > > When working on this, one benefit I found with using 'spec' was that I > think it makes the code clearer. That is, we have this value 'spec' that > can be a version or a source location, rather than a value 'version' that > actually might not be a version, or 'src' that actually might be a versio= n. > I think that has the potential to get confusing quickly. Anyway, primaril= y > as a result of that, I created the PR for the change with the 'spec' > attribute [1]. But I also have branches for the 'version' [2] and 'src' [= 3] > attributes. > > Note that for clarity I've renamed variables as appropriate in the places > where I'm making the immediate change (version --> spec or src, for > example), but to keep the change as simple as possible, I haven't renamed > various secondary locations that get called by this code (like lazy_load, > for example). > > [1] https://github.com/apache/cordova-lib/pull/202 > [2] > https://github.com/apache/cordova-lib/compare/master...MSOpenTech:CB-8799= -version > [3] > https://github.com/apache/cordova-lib/compare/master...MSOpenTech:CB-8799= -src > > Thanks, > > Tim > > ________________________________________ > From: Jesse > Sent: Thursday, April 2, 2015 7:01 AM > To: dev@cordova.apache.org > Subject: Re: Question about plugin/platform --save: src vs version? > > I'm ok with 'spec' > However; I had always thought we would jam the new single attribute > into 'src' which is much more generic than 'version', and I think is > still close enough in meaning. > > I have been looking at this more from the perspective of added > plugins, but I think even the engine tag having a src=3D"^1.2.3" makes > sense. It just means it comes from the 'default' location, at that > particular version. > > > On Apr 1, 2015, at 6:43 AM, Tim Barham wrote: > > >> Ahh.. the stages of config.xml discussions. Starts with "rename things= " > >> continues to "rename more" and usually ends with "let's change to JSON= " > >> :) > > > > How boring would life be without constantly renaming things to give the > impression of progress? :) > > > >> It looks like single attribute is preferred, so instead of trying to > >> find a word that can mean "source and version", we should settle on > >> version and change it for plugin. > > > > I could live with that, however I have one final suggestion which > personally I'd much prefer (because I still cringe when I see the "versio= n" > attribute with a filename or URL as its value)... I won't cry myself to > sleep if I can't get agreement on it, but I think it is where I'd cast my > vote... Npm internally uses the term "spec" for this value, and I think > that works pretty well - it's general enough to cover both scenarios, whi= le > conveying the right sense: > > > > https://github.com/apache/cordova-windows/tarball/master" /> > > > > > > Tim > > > > ________________________________________ > > From: Gorkem Ercan [gorkem.ercan@gmail.com] > > Sent: Wednesday, April 01, 2015 3:59 AM > > To: dev@cordova.apache.org > > Subject: Re: Question about plugin/platform --save: src vs version? > > > >> On 31 Mar 2015, at 8:44, Tim Barham wrote: > >> > >> So... I agree that: > >> > >> a) if we don't find it in the specified location, we should fail, and > >> b) storing the version is really superfluous when a source location is > >> specified (since we're gonna grab whatever is at the specified > >> location regardless of version). > >> > >> And particularly since one of our goals with this was to move towards > >> being more npm'ish - 'npm install' doesn't save the version when you > >> specify a source location. For example: > >> > >> "dependencies": { > >> "semver": "https://github.com/npm/node-semver/tarball/master" > >> } > >> > >> Jesse - are you suggesting that rather than having a name and a > >> ?version attribute, we instead store them in a single attribute, > >> something like the following? > >> > >> > >> > >> > >> (I'm not actually suggesting "param" BTW - just something for the sake > >> of example) > >> > >> That's a possibility, though it makes it harder to quickly look up > >> something by name (that is, simply find the element that has a 'name' > >> attribute that matches). So I'd prefer to keep the name ad the other > >> bit in separate attributes, but use the same attribute name whether > >> we're storing version or source. That, we go with: > >> > >> >> xxx=3D"https://github.com/apache/cordova-windows/tarball/master" /> > >> > >> > >> But where "xxx" is something other than "version" or "src" (something > >> that works for both types of value). Any suggestions? Only thing that > >> comes to my mind right now is "at" (because of the "@"): > >> > >> >> at=3D"https://github.com/apache/cordova-windows/tarball/master" /> > >> > >> > >> Any better ideas? > > > > Ahh.. the stages of config.xml discussions. Starts with "rename things" > > continues to "rename more" and usually ends with "let's change to JSON" > > :) > > > > It looks like single attribute is preferred, so instead of trying to > > find a word that can mean "source and version", we should settle on > > version and change it for plugin. > > > >> > >> Thanks! > >> > >> Tim > >> > >> ________________________________________ > >> From: Jesse [purplecabbage@gmail.com] > >> Sent: Tuesday, March 31, 2015 3:53 PM > >> To: dev@cordova.apache.org > >> Subject: Re: Question about plugin/platform --save: src vs version? > >> > >> I agree with Andrew, fail loudly if we cannot find it. > >> And, jam all this into 1 attribute which may or may not have a version > >> ( or > >> a tag? ) > >> Essentially just store whatever the parameter to 'cordova plugin add' > >> was. > >> > >> > >> > >> > >> > >> > >> @purplecabbage > >> risingj.com > >> > >> On Mon, Mar 30, 2015 at 5:36 PM, Andrew Grieve > >> wrote: > >> > >>> I don't think we'd want to try a fallback in this case. Better to > >>> fail > >>> loudly if the plugin can't be found where it's expected to be. > >>> > >>> I think since NPM uses only a single field (although theirs isn't > >>> labeled), > >>> we should do likewise. Don't feel strongly about it though. > >>> > >>> On Mon, Mar 30, 2015 at 4:04 PM, Edna Y Morales > >>> wrote: > >>> > >>>> It could make sense to store both for the case where restoring from > >>>> src > >>>> fails. For example, if the path to a local folder no longer exists, > >>>> what > >>> do > >>>> you use to restore? In that case you could use the version as a > >>>> fallback? > >>>> > >>>> Thanks, > >>>> Edna Morales > >>>> > >>>> [image: Inactive hide details for "Gorkem Ercan" ---03/30/2015 > >>>> 10:45:03 > >>>> AM--- On 29 Mar 2015, at 23:11, Tim Barham wrote:]"Gorkem Ercan" > >>>> ---03/30/2015 10:45:03 AM--- On 29 Mar 2015, at 23:11, Tim Barham > >>> wrote: > >>>> > >>>> From: "Gorkem Ercan" > >>>> To: "dev =FD[dev@cordova.apache.org]=FD" > >>>> Date: 03/30/2015 10:45 AM > >>>> Subject: Re: Question about plugin/platform --save: src vs version? > >>>> ------------------------------ > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>> On 29 Mar 2015, at 23:11, Tim Barham wrote: > >>>>> > >>>>> Hi - I'm looking for input on this issue: For the plugin/platform > >>>>> --save feature, there's currently an inconsistency between how we > >>>>> store the information in config.xml for platforms vs plugins. > >>>>> > >>>>> > >>>>> > >>>>> For platforms, we have a 'version' attribute where we store either > >>>>> the > >>>>> source location or the version: if the platform was added by > >>>>> specifying a specific location (git repository, local folder, > >>>>> package > >>>>> file etc), we store that in the 'version' attribute. Otherwise we > >>>>> store the actual version. > >>>>> > >>>>> > >>>>> > >>>>> For plugins, these two values are stored separately - source > >>>>> location > >>>>> in the 'src' attribute and version in the 'version' attribute. Note > >>>>> however that when we restore a plugin, we ignore the 'version' > >>>>> attribute if there is a 'src' attribute. > >>>> This comes from the history of the implementation ( as these things > >>>> do). > >>>> In the old experimental save implementation, we had 3 parameters, > >>>> namely, version, url and installPath, and for every plugin we > >>>> expected > >>>> one of them to exist. During the effort for npmizing the save > >>>> functionality the contribution for platforms and plugins were done > >>>> separately hence the unmatching attributes. So there is no real > >>>> technical reason for doing one way or the other and if you are > >>>> willing > >>>> to unify them that is fantastic. > >>>> > >>>> > >>>>> > >>>>> I'd like to make these consistent. My first thought was to support > >>>>> 'version' and 'src' for platforms like we currently do for plugins. > >>>>> But since we always ignore the version if we have a src, I'm not > >>>>> sure > >>>>> we actually gain anything by doing that. Storing them in different > >>>>> attributes is perhaps clearer, but storing both implies we make use > >>>>> of > >>>>> both, which we don't. Also, the code ends up being simpler overall > >>>>> if > >>>>> we just store whichever we care about in the version attribute. > >>>> > >>>> I personally prefer to clearly label data in case user needs to > >>>> read/modify the config.xml, seeing a git url on the version > >>>> attribute > >>>> still puzzles me. But I am fine with either way. Whatever you decide > >>>> please remember to support/migrate the current attributes so that we > >>>> do > >>>> not end up with stale entries on config.xml > >>>> > >>>>> > >>>>> > >>>>> Any thoughts either way? > >>>>> > >>>>> > >>>>> > >>>>> Thanks! > >>>>> > >>>>> > >>>>> > >>>>> Tim > >>>> > >>>> --------------------------------------------------------------------= - > >>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > >>>> For additional commands, e-mail: dev-help@cordova.apache.org > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > >> For additional commands, e-mail: dev-help@cordova.apache.org > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > > For additional commands, e-mail: dev-help@cordova.apache.org > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > > For additional commands, e-mail: dev-help@cordova.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > For additional commands, e-mail: dev-help@cordova.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > For additional commands, e-mail: dev-help@cordova.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org