=head1 NAME

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

=head1 TO DO

This document outlines various development plans and ideas for Text::MicroMason. 

The priority and schedule for these items are not well defined; if you are interested in a specific feature please contact the author as described in L<Text::MicroMason::Docs::ReadMe>.

=head2 Distribution

=over 4

=item *

Stabilize interface for 2.0 release. 

=back

=head2 Internals

=over 4

=item *

Clarify and document the clone-on-change behavior of compile 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?

=item *

Remove Base's class() and NEXT() in favor of use of Class::MixinFactory.

=item *

Think about how to best stack lex_token() methods so that named blocks parsing can be moved into a separate mixin.

=back

=head2 Testing

=over 4

=item *

Set up a benchmarking tool to compare subclasses with other templating solutions. Take an example from http://www.chamas.com/bench/ but execute templates directly. Store the expected output in a text file for comparison.

=item *

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.

=item *

Add more templates to examples directory and test them.

=back

=head2 Syntax Classes

=over 4

=item *

Extend Embperl module to support dynamic HTML tags.

=item *

Extend HTMLTemplate module to support loop_context_vars. 

=item *

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

=back

=head2 Mixins

=over 4

=item *

Improve TemplateDir and/or add related file-search mixin classes.
Perhaps optionally accept a search path listing multiple directories to search for templates?
Perhaps optionally chdir() during the execution of each template?
Perhaps refuse to access any file that isn't under the template directory?
Perhaps add methods to search for all files matching a given regex to facilitate tree searches and cache pre-fetching?  

=item *

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.) 

=item *

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.

=item *

Add a DataCache mixin that provides a pre-configured cache object for use within template code. Requires cache() method and configuration attributes.

=item *

Add an OutputHandle mixin that accepts a handle as an attribute, then prints output to it rather than returning the results as a string.

=item *

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.

=item *

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.)

=item *

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

=item *

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.

=back

=head2 Interfaces

=over 4

=item *

Add an ApacheHandler class that acts as an Apache interface. Map Apache config directives to mixin and initialization options. Expose request object to all templates. Return template results to client.

=item *

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

=back

=head1 SEE ALSO

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

=cut
