Return-Path: X-Original-To: apmail-tapestry-dev-archive@www.apache.org Delivered-To: apmail-tapestry-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 0AD599DD4 for ; Sun, 22 Jul 2012 18:29:06 +0000 (UTC) Received: (qmail 43148 invoked by uid 500); 22 Jul 2012 18:29:05 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 43093 invoked by uid 500); 22 Jul 2012 18:29:05 -0000 Mailing-List: contact dev-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tapestry development" Delivered-To: mailing list dev@tapestry.apache.org Received: (qmail 43082 invoked by uid 99); 22 Jul 2012 18:29:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 18:29:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hlship@gmail.com designates 74.125.82.54 as permitted sender) Received: from [74.125.82.54] (HELO mail-wg0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 18:29:01 +0000 Received: by wgx1 with SMTP id 1so4030823wgx.11 for ; Sun, 22 Jul 2012 11:28:40 -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=pDXymoJ0jf+LB9pS+vQEmJECbbKJT5VAgZLg0BpsLsM=; b=fP9E4aQYqOrdmHR23IAXI6Es7aK3yrWEk2Z1IB8h3Am35rlMajlACPKOMUjuYYlJPL yzKqhkKT6vSCpwx/3y5ewwGtuAkQZcJiPXBx+V7WcGr1GKnYujHRES4JLU/9DANU+SUq LHpGa0OZPukUgJoydOuluM8TCL7+DFmrnlTbpBZTJQuzUp7a5OEQHabV3o6SYheLHd4D YD/LsnDmM2D6EGRtUJJOKAHKmkzFqi3bw8VyaK9lnrXc318+9+Y3bwj4vBL3SF9Ilusx GK0s19QLgBeO3ZNgPUNZZnm8lyjSCrak10TN/M4B1RS86P+CaZUpzvFw/FnhKLY2Iotn sOkQ== MIME-Version: 1.0 Received: by 10.216.137.193 with SMTP id y43mr6192239wei.71.1342981719741; Sun, 22 Jul 2012 11:28:39 -0700 (PDT) Received: by 10.180.146.34 with HTTP; Sun, 22 Jul 2012 11:28:39 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Jul 2012 11:28:39 -0700 Message-ID: Subject: Re: Module-specific versioning of assets? From: Howard Lewis Ship To: Tapestry development Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org One of the advantages of the single version number as implemented in 5.3, is that (from the client's point of view) the hierachy of assets is simple and predictable. I've leveraged this in the past to have a CSS in a library use a ../core relative URL to access an asset packaged with the core framework. If every module has its own version number, that kind of relative url (rare but useful) would no longer be possible, since it would have to be ../../123abc/core (where "123abc" is the core version number, and not statically predictable). This may not be a big issue however; I've been thinking about how to aggregate CSS as we do JS; the first step there is to expand all url() references to absolute paths anyway. On Fri, Jul 13, 2012 at 4:39 PM, Lenny Primak wrote: > I like the optional version number idea. I don't think it's impossible to track asset versions by module. > You could make it a dual alias, I.e. both referenceable by the application version and by module version. It can be a bit more flexible without any sacrifices. > > > > On Jul 13, 2012, at 2:36 PM, Howard Lewis Ship wrote: > >> Earlier versions of Tapestry tried to track versions of each library >> separately; you had to contribute a LibraryMapping to >> ComponentClassResourceResolver, and contribute a seperate value to >> ClasspathAssetAliasManager that included your version number. That >> was a lot of work and was error prone, which is why 5.2 switched to >> the one-version-number-to-rule-them-all. >> >> The upcoming module stuff will make version numbers even more >> important. I don't see a viable middle ground currently, though >> that's short of saying it is impossible. Perhaps there's a way that we >> could define an optional library version number, that would default to >> the application version number. >> >> On the other hand, I expect that 5.4 will be much "lighter" in its use >> of JavaScript as the use of stand-alone libraries & stacks will start >> to switch over to modules, which are loaded in parallel and as needed. >> By 5.5, stacks and libraries should be the rare exception, and >> modules the main approach. >> >> I'm still working on many of the details, including whether and how to >> aggregate modules into stacks for efficient preloading. >> >> As a side note, I expect that by 5.5 we'll require that all classpath >> assets made visible to the user be moved from the main class path to >> folders under META-INF/assets. I.e., >> "com/example/foolib/components/MyLib.js". I'm not quite sure what the >> folder structure will be; possibly just parallel packages, just rooted >> under META-INF/assets/ instead of /. >> >> >> >> On Fri, Jul 13, 2012 at 11:17 AM, Thiago H de Paula Figueiredo >> wrote: >>> Sounds good to me. >>> >>> >>>> >>>> >>>> >>>> On Jul 13, 2012, at 1:16 PM, Kalle Korhonen >>>> wrote: >>>> >>>>> We are deploying our app to production once a week and I find it quite >>>>> annoying that every time we basically force our users to re-download >>>>> all of the application resources even though only a small subset of >>>>> them changed, causing wasted bandwidth and perceived performance >>>>> issues. At the same time, we cannot afford users to have stale >>>>> resources in their caches. All of the Tynamo.org modules add their own >>>>> version to asset paths so adding the application version is completely >>>>> redundant, for example: >>>>> >>>>> http://localhost:8080/assets/0.0.1-SNAPSHOT-1341940822046/facebook-0.1.0/components/fb-button.css >>>>> >>>>> We briefly looked into generically changing how asset paths are >>>>> constructed to include module's own version but it's difficult to >>>>> achieve because the context (from which module the asset came) is >>>>> lost. >>>>> >>>>> Tynamo modules contribute something like: >>>>> public static void >>>>> contributeClasspathAssetAliasManager(MappedConfiguration>>>> String> configuration) >>>>> { >>>>> configuration.add(PATH_PREFIX + "-" + version, >>>>> "org/tynamo/security"); >>>>> } >>>>> >>>>> What if we implemented a ClassPathAssetAliasManager2 that would take a >>>>> MappedConfiguration so we could automatically do the >>>>> same as above for add-on modules, using >>>>> Package.getImplementationVersion()? >>>>> >>>>> It would encourage the (best) practice of placing the main module >>>>> class to the intended root package of a module, and it'd be very >>>>> simple to contribute in the module like so: >>>>> public static void >>>>> contributeClasspathAssetAliasManager2(MappedConfiguration>>>> Package> configuration) >>>>> { >>>>> configuration.add(PATH_PREFIX, getClass().getPackage() ); >>>>> } >>>>> >>>>> Similarly, LibraryMapping (a contribution to ComponentClassResolver) >>>>> could also accept a Package, rather than just a string. >>>>> >>>>> What do you think? >>>>> >>>>> Kalle >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >>>>> For additional commands, e-mail: dev-help@tapestry.apache.org >>>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >>>> For additional commands, e-mail: dev-help@tapestry.apache.org >>>> >>> >>> >>> -- >>> Thiago H. de Paula Figueiredo >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >>> For additional commands, e-mail: dev-help@tapestry.apache.org >>> >> >> >> >> -- >> Howard M. Lewis Ship >> >> Creator of Apache Tapestry >> >> The source for Tapestry training, mentoring and support. Contact me to >> learn how I can get you up and productive in Tapestry fast! >> >> (971) 678-5210 >> http://howardlewisship.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >> For additional commands, e-mail: dev-help@tapestry.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org > For additional commands, e-mail: dev-help@tapestry.apache.org > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org For additional commands, e-mail: dev-help@tapestry.apache.org