[dancer-users] Dancer1 plugins and Dancer2 plugins

Slavik Goltser slavikg at gmail.com
Mon Oct 7 15:34:53 BST 2013


Thanks. That helps.  :-)
On Oct 7, 2013 9:36 AM, "Alexis Sukrieh" <sukria at gmail.com> wrote:

> Hi Slavik,
>
>
> 2013/9/16 Slavik Goltser <slavikg at gmail.com>
>
>> I could not find any information on this, but what is the recommended way
>> of migrating Dancer1 plugins to Dancer2? Is it to add version checking
>> while keeping the Dacer1 naming or is it recommended to rename the plugins
>> to Dancer2::Plugin... ?
>>
>
> First things first: don't bother with D1 compatibility, all
> Dancer2-related distributions should be in the Dancer2 namespace, so no
> need for backward compat and version checks.
>
> What is suggested is to rename Dancer::Plugin::FooBar to
> Dancer2::Plugin::FooBar.
>
> That's for the naming.
>
> Regarding the code, make sure your plugin uses the proper syntax: shifting
> $dsl in each registered subs, like so:
>
>   regsiter foo => sub {
>     my $dsl = shift;
>     ...
>   };
>
> Also make sure any import-time code are defined in "on_plugin_import"
> blocks.
>
> Good luck!
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20131007/eb12457e/attachment.html>


More information about the dancer-users mailing list