Skip Menu |

This queue is for tickets about the Template-Declare CPAN distribution.

Report information
The Basics
Id: 62394
Status: open
Priority: 0/
Queue: Template-Declare

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Template::Declare and Moose don't get along
A Møøse once bit my Template::Declare ... No realli! She was Karving her initials on the møøse with the sharpened end of an custØm @Expørt config given her by Øbra - her brother-in-law - an Oslo dentist and star of many Norwegian møvies: "The Høt Hands of an Oslo Dentist", "Fillings of Passion", "The Huge Mølars of Horst Nordfink". We apologise for the fault in the ticket reporting. Those responsible have been sacked. If you try this: use Moose; use Template::Declare::Tags qw( HTML ); you will get two separate conniption fits from Moose. 1. The "with" sub will be replaced, which tends to do nasty things if you want to implement roles. 2. The "meta" sub will be replaced, which tends to do nasty things to everything related to Moose. This gets even worse if you want to use MooseX::Declare and Template::Declare. I am willing to contribute a patch if one of the maintainers will tell me what they consider the best solution to be. The solutions that come to mind include: 1. Rename "with" and "meta" to something else. (e.g., "wik"/"metadata") 2. Add an option to TD::Tags::import() to prevent import or offer an alternate name for "with". E.g.: use Template::Declare::Tags qw( -moose_friendly HTML ); 3. Do the latter, but automagically detect Moose friendly mode. use Moose; use Template::Declare::Tags ( HTML ); # warn "I see you are using Moose; so -moose_friendly mode is. Please use -moose_friendly or - moose_unfriendly in your with use Template::Declare::Tags to avoid this warning in the future." 4. None of the above... Anyway, Moose-friendly templates would be nice...
Hey Hanenkamp, While I sympathize with your Moose plight I'm not sure what the best long-term solution is. In the short-term you can just rename the "with" and "meta" that Moose gives you. You mention MooseX::Declare being an additional pain point but I don't know how much leverage it gives you for renaming its symbols. We may eventually move to Sub::Exporter for Template::Declare itself so you can rename the exports from TD as well. But in the meantime I'll leave this ticket open for now. Shawn
Hey Hanenkamp, While I sympathize with your Moose plight I'm not sure what the best long-term solution is. In the short-term you can just rename the "with" and "meta" that Moose gives you. You mention MooseX::Declare being an additional pain point but I don't know how much leverage it gives you for renaming its symbols. We may eventually move to Sub::Exporter for Template::Declare itself so you can rename the exports from TD as well. But in the meantime I'll leave this ticket open for now. Shawn
Subject: [rt.cpan.org #62394] any decision made ?
Date: Fri, 15 Jul 2011 19:37:54 +0200
To: bug-Template-Declare [...] rt.cpan.org
From: Marc Chantreux <marc.chantreux [...] linkfluence.net>
hello guys, I tested my first async app. using Template::Declare, Tatsumaki and MooseX::Declare. The combo would be really pleasant to use if this bug wouldn't exist. I joined #jifty channel last night and chatted with trs about a solution. Show quoted text
trs> without thinking too hard, I think the best option is renaming. trs> so moving TD to Sub::Exporter might be useful there. trs> that would give the option of renaming Moose's imports or TD's imports (or both)
regards, marc