[Catalyst] Alien-Dojo / HTML-Dojo merger suggestions

Yuval Kogman nothingmuch at woobling.org
Wed Jun 14 18:51:31 CEST 2006


I think too much sugar has leaked into this design.

I propose:

	Alien::Dojo::Dist; # an object that has js sources somewhere and
	can return them or write them to a dir. Encapsulates both
	version and edition
	Alien::Dojo::Dist::FileTree; # really just a bunch of files
	Alien::Dojo::Dist::Archive; # archive::zipp or whatever
	Alien::Dojo::Dist::RAM; # strings in memory

	Alien::Dojo::Fetch; # makes Alien::Dojo::Dist::RAM objects that
	lazily get the needed files from the web, based on a path to
	some dojo release somewhere.

	Alien::Dojo::Fetch::Version; # based on a known scheme fetch a
	version of dojo, probably via a REST api... Virtual versions
	also work (e.g. latest stable, bleading edge, etc as supported
	by this). Should be configurable enough to use mirrors and
	stuff, or local repositories.

	Alien::Dojo; # a sugar layer to create an
	Alien::Dojo::Fetch::Version, get it, and manage the files

I also propose these roles/classes::

	Alien::Dist; # simple introspection api - mostly meta data (version, files, etc)
	Alien::Dist::Read; # for loading dists from $whatever
	Alien::Dist::Write; # for storing a dist locally, so that it can be read later

	Alien::Dist::Data::Package; # integrate with Adam Kennedy's
	Data::Package

	Alien::Dist::Archive; # a provider for ::Read and ::Write based
	on Archive::Tar, Archive::Zip, etc

	Alien::Dist::FetchUtil; # utility functions/methods wrapping
	LWP::UserAgent, for in memory or in temp dir creation of an
	Alien::Dist

This should enable writing Alien::* pretty easily, helping to
standardize on a sane approach.



On Wed, Jun 14, 2006 at 17:19:58 +0100, Carl Franks wrote:
> message cc'd to Dominique in case you're not still on the cat list.
> 
> Further to the discussion a couple of weeks ago, I suggest deprecating
> HTML-Dojo (of which I'm the author), and merging it's functionality
> into Alien-Dojo, with the following changes.
> 
> Backwards compatabilty shouldn't be an issue, as there's only been 1
> release of Alien-Dojo, and it's broken as it doesn't include all files
> necessary for the dojo JS to work. So I'm pretty sure no-one's using
> it ;)
> 
> Currently, HTML-Dojo comes with the dojo distro bundled. Alien-Dojo
> doesn't include the dojo code at all, it downloads it from the
> internet.
> I suggest Alien-Dojo includes the dojo code, but is capable of
> downloading and installing other versions from the internet.
> Advantages:
>   The Alien-Dojo distro can be updated with each dojo release, meaning
> cpan clients will know of the upgrade.
>   We'll have a permanent archive of dojo versions on cpan.
>   The Alien-Dojo distro number will match the dojo version number,
> meaning the `use Alien::Dojo 0.3` idiom to ensure a minimum working
> version will work.
> 
> Alien-Dojo currently isn't aware of the different dojo "editions"
> (customized builds) available. This capability will have to be added.
> By default, we should use the "ajax" edition, as that's the prefered
> dojo edition.
> 
> Alien-Dojo should include all files from the dojo distrobution, not
> just the src directory.
> 
> Alien-Dojo->new() allows a single argument, interpreted as the minimum
> version of dojo required.
> I suggest it's changed to be a named argument, to allow for expansion.
> Also, with experience of using dojo, I suggest it should instead mean
> the *exact* version you want, rather than minimum. (the dojo library
> changes a lot between releases).
> If you really want a minimum version, you can do `use Alien::Dojo x.x`
> 
> Also, rather than dumping the js library directory into perl/site_lib,
> I'd rather the library is dumped into a single .pm file such as
> HTML-Dojo does.
> Like HTML-Dojo, the intended use is that the module is used by
> something such as Catalyst-Helper-Dojo to dump the library into an
> application directory, and so Alien-Dojo should not be used by general
> programs (such as for serving files live).
> 
> To handle versions not already installed, I'm thinking it should first
> try using CPAN.pm, and if the version/edition isn't available there,
> to try downloading the library from the dojo website, building a .pm
> from it, and then installing it with ExtUtils::Install.
> Does that sound sane?
> 
> Cheers,
> Carl
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/

-- 
  Yuval Kogman <nothingmuch at woobling.org>
http://nothingmuch.woobling.org  0xEBD27418

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060614/045f9bc6/attachment-0001.pgp 


More information about the Catalyst mailing list