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 8E90F11360 for ; Fri, 6 Jun 2014 17:56:25 +0000 (UTC) Received: (qmail 87595 invoked by uid 500); 6 Jun 2014 17:56:25 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 87560 invoked by uid 500); 6 Jun 2014 17:56:25 -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 87549 invoked by uid 99); 6 Jun 2014 17:56:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2014 17:56:25 +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 mmocny@google.com designates 209.85.128.169 as permitted sender) Received: from [209.85.128.169] (HELO mail-ve0-f169.google.com) (209.85.128.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2014 17:56:21 +0000 Received: by mail-ve0-f169.google.com with SMTP id jx11so3693141veb.0 for ; Fri, 06 Jun 2014 10:56:00 -0700 (PDT) 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=2Uod1NHbSIcgZZNEPXj7n2VgsntebWdQfPpVaNtwovs=; b=A8WuN7OdZ8aPYV9ddgvBBsJYafr9aBF8vC5WmzFL+q0W7MTMqUJPSHPyi0IHTPxnUf dFg3eTrHZLSfdwYUBheoLtiDeRsov2CMu3qqQ/4/2xorxcZUHa2WsPHZo2VOnPx7GrrV Oy8hhdRVTujaTkDsxUPFmvufN99vODoE6CE918+bUMMWGu9LrcrEUMTas8FbnqF++rWQ GH95Vo0Z2c3tcZmB+HuX01RnMO5wZpncl/cUQNwXTyLkLa2zzAnPExyZdxarLJc1pUAz v3k+VKdILFyIQDtIioVTD0W2GIQzcbyoiTawtEE9uXgStxL8+3f1s1ZxfhPuIF0+L+L6 +k/g== 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=2Uod1NHbSIcgZZNEPXj7n2VgsntebWdQfPpVaNtwovs=; b=ZkZtcv0I+Z4PXjivnM8RtcWkm1WYKjhCO2bg9xR49j2Ltzc+nqTmAh/KMfVAWLsp5D 1YSVDtNnWGyYIOgWaogHUUhbR1pIC4cKCYRgYHDY0OPghaWwLaRZQt5i22ZK26q4MO+B XQku7AL2SE8PaIqlOGpWDi4HayWut2PvfnZak= 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=2Uod1NHbSIcgZZNEPXj7n2VgsntebWdQfPpVaNtwovs=; b=NLr92f0jtvErjG2/7K3MnSbO352f/5kbOJ9k1sKgK0yAsx5YTyupEwosD88qTMfJXb AiSQbG1CuO0Y3jqfvYBFmhR39ZAPi+2ZVzyq2C/3O7lZ9HbXxVumbRu83VgKhbvYJhes 1YrJXJQ3KxaB7j+xd2h7p4nxcb9Y12BkJ7cUBit/z+MJCOLg4a8SPrtgpVUz5QRwrYaV 43nL0g9CGMvZEdBEpXpqtW3dMy6Q9TkFQsn+lUGTxhwOUtkLQvRsfWjdWp0QPFJZ0UKC ZFxpAHnoPzGu5hyulVNPnBQXF4QeqvjZdLL7bq0pjKD1b91T4n40QQ13N9L/2QOASLbx G5fA== X-Gm-Message-State: ALoCoQmBne/PI6SIRbl58OQ/NUovfBeAaTSWp7Au/g9nKKCQRsV/wcEsg03u08aEQ1iWKUin/eG/ X-Received: by 10.220.85.1 with SMTP id m1mr5608926vcl.42.1402077360436; Fri, 06 Jun 2014 10:56:00 -0700 (PDT) MIME-Version: 1.0 Sender: mmocny@google.com Received: by 10.52.31.101 with HTTP; Fri, 6 Jun 2014 10:55:40 -0700 (PDT) In-Reply-To: References: From: Michal Mocny Date: Fri, 6 Jun 2014 13:55:40 -0400 X-Google-Sender-Auth: BBZ0QAgBb1c8fw2xE2SYUFv2G3U Message-ID: Subject: Re: wip on cordova-lib? pls let us know To: dev Content-Type: multipart/alternative; boundary=001a11c2c9ca045f5704fb2e93ab X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2c9ca045f5704fb2e93ab Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Additionally, I think it will only be a problem when each of the modules call into one another. I.e. when cordova-cli calls into cordova-plugman and that throws a CordovaError which is caught by cordova-cli and then compared with instanceof to its own version.. Its not a problem in isolation. This problem usually comes up with singletons / internal caching, such as reading config files from disk once and then modifying in-memory, but I'm not sure if we actyally have that problem. -Michal On Fri, Jun 6, 2014 at 1:12 PM, Andrew Grieve wrote: > On Fri, Jun 6, 2014 at 12:37 PM, Brian LeRoux wrote: > > > Ya I spoke to Issac a bit about this last week and he wasn't being > entirely > > facetious. One path that apparently works well is to treat root > > `./node_modules` as something npm manages and then nested node_modules > for > > userspace stuff. > > > > eg. `./src/node_modules` and then `var foo =3D require('src/foo')` > > > > Not a huge win over just using relative paths so meh. > > > > I don't understand why instanceof wouldn't work? > > > > You probably have a better understanding of this than I do... But: > - There's no problem when running locally, since we've defined the > structure of node_modules to work, > > But when npm install is run on an end-users machine, if it ends up like: > > cordova-lib/node_modules/cordova-plugman/node_modules/CordovaError > cordova-lib/node_modules/cordova-cli/node_modules/CordovaError > cordova-lib/node_modules/CordovaError > > then there are now 3 CordovaError constructors, so instanceof will not wo= rk > between them. > > Now, if npm sees that all packages call for the same version of > CordovaError, and install them like: > > cordova-lib/node_modules/cordova-plugman > cordova-lib/node_modules/cordova-cli > cordova-lib/node_modules/CordovaError > > then all is well. > > Easy to answer with a quick test :) > > > > > > > > > On Fri, Jun 6, 2014 at 9:14 AM, Andrew Grieve > > wrote: > > > > > Exciting! I tried the "check in node_modules" approach in > > > cordova-app-harness and it works really well there: > > > https://github.com/apache/cordova-app-harness/tree/master/harness-pus= h > > > It's a simpler case since there's a strict parent/child relationship. > > > > > > The main unknown for me is how to make CordovaError work as its own > > module > > > since we'll require that there is never multiple copies of the module > > when > > > the end-user types "npm install" (or else the instanceof check won't > > work). > > > I *think* that npm does the right thing so long as all of the package= s > > use > > > the same version constraints for it, but I haven't tested it. > > > > > > > > > On Fri, Jun 6, 2014 at 11:37 AM, Michal Mocny > > wrote: > > > > > > > Brian: sounds good. Looking forward to see where we get. > > > > > > > > -Michal > > > > > > > > > > > > On Fri, Jun 6, 2014 at 11:36 AM, Brian LeRoux wrote: > > > > > > > > > @Michal: we're going to start extracting things to their own > modules. > > > (As > > > > > discussed.) We're going to start small and simple: CordovaError, > > > > > SuperSpawn, etc. But before we do that we'll try to merge up as > many > > > PRs > > > > as > > > > > possible. Ideally there are none when we get rolling. (Next week.= ) > > > > > > > > > > Many repos (or just small modules) would isolate the changes maki= ng > > it > > > > > easier to refactor. Anyhow: I'm tired of advocating that design > > pattern > > > > > choice and I'm sure you're tired of hearing about it! > > > > > > > > > > > > > > > On Thu, Jun 5, 2014 at 6:04 PM, Michal Mocny > > > > wrote: > > > > > > > > > > > On Thu, Jun 5, 2014 at 6:47 PM, Brian LeRoux wrote= : > > > > > > > > > > > > > we're about to do some heavy refactoring on cordova-lib=E2=80= =A6it > would > > > > appear > > > > > > > many ppl are working on it atm: > > > > > > > > > > > > > > > > > > > Who/how/what/why? > > > > > > > > > > > > > > > > > > > > > > > > > > https://github.com/apache/cordova-lib/pulls > > > > > > > > > > > > > > I'm afraid to find out how many *aren't* open PR's =E2=80=A6b= ut this > > > > certainly > > > > > > > illustrates the problem with one giant repo with all our code > > > > > > > > > > > > > > > > > > > If you are refactoring the code in a way that breaks PR from > > > applying, > > > > I > > > > > > don't think multiple repos would make a difference. Probably > this > > > way > > > > is > > > > > > easier if you were making changes that needed to touch multiple > > > repos. > > > > > But > > > > > > this conversation feels sorta Deja Vu. > > > > > > > > > > > > -Michal > > > > > > > > > > > > > > > > > > > > > --001a11c2c9ca045f5704fb2e93ab--