Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
MicroMason::Docs::ToDoUser Contributed Perl DocumentaMicroMason::Docs::ToDo(3)

       Text::MicroMason::Docs::ToDo - Development Plans	for the	MicroMason

       This document outlines various development plans	and ideas for

       The TO DO section describes plans which are likely to happen.

       The WISH	LIST section describes a variety of ideas which	are likely to
       be accepted as patches, but which will most likely not be developed
       with any	priority any time soon.

       If you are interested in	a specific feature, whether it is listed here
       or not, please contact the current maintainer as	described in

   Fix all known bugs
       So, please report them.

       o   Move	the module files into a	lib/ directory as expected in modern
	   CPAN	distributions.

   New Mixins
       o   AutoLoad mixin. Using this mixin adds an AUTOLOADER to the mason
	   object, which interprets all	unknown	method calls as	template

   New Features
       o   Support the previously supported but	now unsupported	compile(lines
	   => ...) source type.	This was documented but	non- functional, and
	   so the pod was removed.

       o   Use Module::Build instead of	ExtUtils::MakeMaker.

       o   Consider reorganizing the Text::MicroMason::* modules into a	number
	   of subdirectories. There are	currently over two dozen of them, and
	   it's	bound to get worse as time goes	on. Perhaps separate them by
	   intent: Cache::*, Errors::*,	Syntax::*, Features::*,	etc.

       o   Finish and test the ParseInfo module	to facilitate template

       o   Rewrite the MOTIVATION section of the ReadMe	pod to reflect the
	   shift from an HTML::Mason clone to a	more general templating	engine
	   that	has at least partial compatibilty with quite a few other

       o   Test	and improve the	ApacheHandler interface.

	   Map user-friendly Apache config directives to mixin and
	   initialization options. Review HTML::Mason::ApacheHandler,
	   HTML::Mason::Params,	and HTML::Mason::Admin.

	   Headers need	to be constructed as per and	not sent until our
	   first print statement; see PLP::Tie::Print.

       o   Review integration with Inline::Mason. Facilitate use of mixins so
	   this	can also do inline ServerPages and other syntaxes.

   Core	Syntax
       o   Determine how to best stack lex_token() method so that multiple
	   syntax plugins can work together.

       o   Extract named blocks	parsing	from HTMLMason to form a separate

       o   Extract variable interpolation syntax to allow it to	be stacked
	   with	other lexers.

   Syntax Emulations
       o   Add TemplateToolkit module with support for the basic TT syntax.
	   The key syntax definition is	in Parser.yp, which is used to build
	   Template::Grammar. ("/
	   2.14/parser/Parser.yp" in http:) The	Template::Stash	dot notation
	   can be handled by Data::DRef.

       o   Extend HTMLTemplate module with a hash mapping options that could
	   be passed to	HTML::Template's new() into the	equivalent behavior,
	   or croak if they're unsupported.

       o   Consider extending Embperl module to	support	dynamic	HTML tags.

       o   Consider extending ServerPages module to support dynamic XML	tags.

   Template Sources
       o   Provide a mixin to search for all files matching a given regex to
	   facilitate tree searches and	cache pre-fetching.

       o   Ensure template inclusion is	always handled correctly. Possibly
	   provide the current template's location in %ENV.

       o   Add a DHandlers mixin that supports default files. On file
	   requests, if	file not found,	look for default file. (Attribute
	   dhandler_name controls name of file to look for.)

       o   Add an AutoHandlers mixin that supports wrapper files. On file
	   requests, also search hierarchy for autohandler files. (Attribute
	   autohandler_name controls name of file to look for.)	Build a	stack
	   of autohandlers and store it	in a mason attribute. Support
	   ->call_next() to work through the chain.

	   (I've also gotten a user request for	"decorator files" which	turns
	   out to be roughly equivalent	to the AutoHandler system.)

       o   Add a TemplateDB mixin which	shows how to retrieve templates	from a
	   database table. Provides a read_db()	method.	Accept a DBI
	   connection as an attribute -- or a reference	to a function which
	   will	return rows from a sql statement.

	   Consider how	to support caching for templates drawn from a
	   TemplateDB.	Perhaps	in addition to the source_file there can be
	   some	kind of	opaque cache key returned by the prepare method?

	   Maybe cache values for db templates can be abstracted into closures
	   which are run to retrieve the cached	value.

       o   Add a DataCache mixin that provides a pre-configured	cache object
	   for use within template code. Requires cache() method and
	   configuration attributes. Cache namespace should be based on	source
	   file	name or	arbitrary instance for text compilation.

	   Alan	says: I	believe	this is	intended for use to cache contextual
	   data	across template	runs? Is this intended to be persistent	across
	   multiple templates (in memory/singleton), or	across multiple
	   process invocations (in a file)? I use mod_perl, and	this sounds at
	   best	not useful and at worst, dangerous.

       o   Add an InterpretCache mixin that allows caching of the parsed and
	   assembled Perl code for a template file, akin to Mason's var/obj/
	       directory. (This	would also allow visual	review when debugging
	   the converted code.)

       o   The InterpretCache and CompileCache benefit from using a cache
	   object that checks the keys as filenames to see if the source file
	   has been updated and	forces cache expiration; find a	way to extract
	   and reuse this capability from Text::MicroMason::Cache::File.

   Blessing Templates
       o   Add a BlessSub mixin	that blesses the compiled subroutine. This
	   would let us	add support for	template-specific behaviors and
	   attributes.	Override eval_sub() to bless sub before	returning.
	   Attribute bless_sub controls	initializer arguments passed to
	   BlessedSub class.  BlessedSub class is base class for blessed
	   template objects. Provides execute()	method.

	   BlessedSub classes may need their own mixin factory... To avoid
	   having to define separate mixins for	both packages, perhaps the
	   methods should be delegated from the	coderef	to the Mason instance?
	   (This becomes particularly attractive if each sub is	automatically
	   getting its own cloned mason	instance anyway.)

       o   Add an AttrBlock mixin, using BlessedSub. Override lexer methods to
	   parse <%attr> blocks. Stores	attribute definitions in a %once
	   block.  Provides attr() method.

       o   Add a MethodBlock mixin, using BlessedSub. Override lexer methods
	   to parse <%method> blocks. Stores method definitions	in a %once
	   block.  Hooks AUTOLOAD to catch method calls.

       o   Consider moving output_sub to a new OutputHandle mixin which
	   accepts a handle as an attribute, then prints output	to it rather
	   than	returning the results as a string.

       o   Clarify and document	the clone-on-change behavior of	prepare() and
	   its effects when making changes to a	mason object after compiling a
	   template. Perhaps we	should ensure that we clone every time,	or at
	   least every time that it matters?

       o   Set up a benchmarking tool to compare subclasses with other
	   templating solutions. Take an example from ApacheBench but execute
	   templates directly rather than via Apache. Store the	expected
	   output in a text file for comparison.

	   Other links to consider when	benchmarking:

       o   Set up a compliance test tool that compares the output of the
	   various MicroMason mixins with the other modules they emulate. This
	   should be able to use many of the same data files as	the
	   benchmarking	tool.

       o   Add more templates to samples directory and test them.

       For distribution, installation, support,	copyright and license
       information, see	Text::MicroMason::Docs::ReadMe.

perl v5.32.1			  2009-11-12	     MicroMason::Docs::ToDo(3)


Want to link to this manual page? Use this URL:

home | help