Loading ...
Sorry, an error occurred while loading the content.

Re: AJILE + PackTag, recommended strategy?

Expand Messages
  • make_you_mad
    Thanks for looking into this Mike. I m going to take a look at the first option before moving on. As of now, we ve had to do all of the legwork of making
    Message 1 of 4 , Dec 15, 2008
    • 0 Attachment
      Thanks for looking into this Mike. I'm going to take a look at the
      first option before moving on. As of now, we've had to do all of the
      legwork of making sure we include the right dependencies and files by
      hand, so I understand by going this long without a solution like this
      we've already made some sacrifices that AJILE could have helped with.

      I will feel out the pack:tag dev team for any support in this arena.
      It seems like the two libraries could compliment each other well.
      While RPO looks attractive, unfortunately we find ourselves in a
      situation where we serve most of our 'heavy lifting' scripts off of
      the app server and not the web server (which would be ideal,
      especially once they stabilize.)

      Thanks again,

      Chris

      --- In ajile@yahoogroups.com, "iskitzdev" <ajile@...> wrote:
      >
      > Hi Chris,
      > Having spent some time looking at PackTag, I have to say that it would
      > be challenging to use it with Ajile without modifying either
      > solution's source code.
      >
      > The main reasons for this are:
      >
      > + Ajile is a client-side solution while PackTag is server-side:
      >
      > - Ajile provides dependency support via just-in-time loading
      > of required scripts at the client. PackTag packs scripts
      > on the server before they reach the client.
      >
      >
      > + Ajile relies on scripts' filenames, but PackTag changes them:
      >
      > - Ajile provides dependency support by associating JavaScript
      > modules with their filenames (i.e. MyStuff is in MyStuff.js).
      >
      > - PackTag generates virtual and physical packed files with
      > new (non-configurable) names
      > (i.e. MyStuff.js -> MyStuff.js.h-1867926113.pack).
      >
      > - PackTag's file renaming breaks Ajile's ability to
      > dynamically locate and load scripts via statements like
      > Import("MyStuff") because MyStuff will no longer be
      > mapped to MyStuff.js when packed with PackTag.
      >
      >
      > Possible Solutions:
      >
      > 1. Use Ajile to create namespaced modules that import
      > each other, then combine all of them into one using
      > PackTag's <pack:script><src>..</src><src>...</src>
      >
      > Ajile will only try to load a module's script file
      > if it doesn't find the module in memory. By combining
      > and loading all scripts with PackTag, Ajile should be
      > able to find those modules within the combined script
      > and therfore not need to issue a request for the
      > module's script file. This approach may work, but
      > sacrifices some of Ajile's automation because you'll
      > need to declare all imported scripts in your JSP
      > even though you'll have already defined the dependency
      > within your JS files. Ordered declaration via PackTag
      > should help to avoid additional script file loading.
      >
      >
      > 2. Use something like RPO (http://tinyurl.com/4xyqzk/)
      > on your server.
      >
      > 3. Contact PackTag's developer and request configurable
      > packed filenames (i.e. No appended ".h-###.pack").
      >
      > Ajile provides a refresh option that causes a
      > fresh request to be generated for scripts. If PackTag
      > could be made to process such requests and serve the
      > cached version if the resource is unchanged Ajile can
      > be used with it.
      >
      > 4. Set up server-side filtering to translate Ajile's
      > normal script requests to PackTag's renamed resources.
      >
      > It may be less intrusive if PackTag generated unique
      > query strings or directories for packed scripts
      > instead of renaming the script files directly.
      >
      > If directories were used and the unique id could be
      > referenced via a JSP variable, you could use Ajile's
      > Namespace statement to dynamically set all imports
      > for a specific namespace to point to the proper
      > location, thereby getting the most out of both Ajile
      > and PackTag i.e.:
      >
      > <script>Namespace("net.ajile", "${packedID}/");</script>
      >
      > I hope you can find a way to use Ajile within your project. If you're
      > committed to using PackTag, I'd realy suggest speaking with its author
      > or modifying its source code to gain more flexible script file renaming.
      >
      >
      > Best,
      > Mike
      >
      > --- In ajile@yahoogroups.com, "iskitzdev" <ajile@> wrote:
      > >
      > > Hi Chris,
      > > Thanks for posting and sharing knowledge about PackTag.
      > >
      > > I've read the available documentation at the PackTag site and
      > > understand that it's a JSP Tag Library that offers runtime
      > > minification, compression and caching of JavaScript and CSS resources.
      > >
      > > At first glance I suspect the major challenging for getting Ajile &
      > > PackTag to work well together is the fact that Ajile uses external
      > > scripts' filenames to support importing namespaced functionality while
      > > PackTag appears to generate renamed script files that may no longer
      > > maintain the filename to namespaced content mapping.
      > >
      > > I haven't actually tried using Ajile with PackTag, but believe that
      > > the two technologies could possibly work together under certain
      > > conditions.
      > >
      > > I need some time to look into PackTag's actual operation to better
      > > understand what limitations it imposes on Ajile's operation. Let me do
      > > some investigation and get back to you.
      > >
      > > -Mike
      > >
      > >
      > >
      > > --- In ajile@yahoogroups.com, Chris Wash <cwash@> wrote:
      > > >
      > > > Hello,
      > > >
      > > > I¹m very interested in using AJILE and am wondering if anyone had an
      > > idea
      > > > for one obstacle I see in the way of being able to cleanly plug this
      > > into my
      > > > project. We use packtag (http://www.galan.de/projects/packtag) to
      > > compress,
      > > > minify, and control the setting of all the client-side caching for
      > > us. What
      > > > this means is that most of our JS files get included in a JSP page
      > > by using
      > > > the PackTag taglib and it produces markup that essentially looks
      > > like this:
      > > >
      > > > <script type="text/javascript"
      > > > src="/path/to/ErrorHoverBox.js.h-130259695.pack"
      > > charset="utf-8"></script>
      > > > <script type="text/javascript"
      > > > src="/path/to/ErrorHandler.js.h1268316776.pack"
      > > charset="utf-8"></script>
      > > > <script type="text/javascript"
      > > src="/path/to/hideDiv.js.h1060640246.pack"
      > > > charset="utf-8"></script>
      > > > <script type="text/javascript"
      > > src="/path/to/highlight.js.h-1103827952.pack"
      > > > charset="utf-8"></script>
      > > > <script type="text/javascript"
      > > src="/path/to/sortable.js.h451535514.pack"
      > > > charset="utf-8"></script>
      > > >
      > > >
      > > > I haven¹t looked in depth at how I would go about plugging these
      > > into the
      > > > framework, but is this possible? Can you recommend a strategy for
      > using
      > > > AJILE in this setting? We¹re in dire need of Namespacing and a
      > > Dependency
      > > > management solution!
      > > >
      > > > Thanks very much,
      > > >
      > > > Chris
      > > >
      > > >
      > > > [Non-text portions of this message have been removed]
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.