<div dir="ltr">Hi!!!<br><br>This plugin2 looks great!. It solves execution problems of Dancer2::Plugin.<br><br>I have a question about the add_route functionality, how can I access to the DSL keywords? eg. param('param_name') when I'm defining the code for a new route?<br><br>Ruben.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 3:19 AM, Stefan Hornburg (Racke) <span dir="ltr"><<a href="mailto:racke@linuxia.de" target="_blank">racke@linuxia.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 10/12/2015 05:05 PM, Yanick Champoux wrote:<br>
> Hi all,<br>
><br>
> Underneath the surface, I've been toiling away at a new plugin system<br>
> for Dancer2. This new system aims at fixing a few of the thorny issues<br>
> of the current one, and add a wee bit of unicorn dust to the mix.<br>
><br>
> ## For plugin users, the changes are:<br>
><br>
> * No change! The new plugins will be called the same way<br>
> as the old ones -- it'll be transparent to you if a<br>
> plugin is new gen or old gen. Isn't that music to your<br>
> ears, or what? :-)<br>
><br>
> * No change! Plugins using the new system can work side-by-side<br>
> with original plugins. It's all really transparent to you.<br>
> Relax, we're taking care of everything. :-)<br>
><br>
> ## For plugin writers, the changes are:<br>
><br>
> * The new system inherit from Dancer2::Plugin2 (yes, I know, we just<br>
> loooove that '2' digit around here...).<br>
><br>
> * The new system is much more OO-based, which so far makes for<br>
> cleaner, easier to write plugins.<br>
><br>
> * The new system doesn't export the Dancer keywords into the plugin<br>
> namespace. It removes a little bit of the sugar (you'll have to<br>
> do `$self->app->request` instead of `request()` inside<br>
> the plugin module), but it makes much more explicit what is the<br>
> plugin class, and what is the plugin instance associated<br>
> with an app.<br>
><br>
> * Plugin can now use other plugins!<br>
><br>
> * The list of plugin instances are also kept as an attribute in<br>
> the app object, which makes introspection possible (a<br>
> plugin, for example, can check if other plugin A is<br>
> already loaded or not and do things in consequence).<br>
><br>
><br>
> ## What do I want from you?<br>
><br>
> Before unleashing D2::P2, it needs to be tested. Racke already migrated<br>
> two of his plugins to D2::P2<br>
> (<a href="https://github.com/PerlDancer/Dancer2/wiki/Plugins-migrated-to-D2::P2" rel="noreferrer" target="_blank">https://github.com/PerlDancer/Dancer2/wiki/Plugins-migrated-to-D2::P2</a>).<br>
> I would like for all of you to try to migrate your plugins, and report<br>
> if it was a success, or if you uncovered some sore points.<br>
><br>
> How to do that? I'm glad you asked:<br>
><br>
> 1. clone and use the Dancer2 branch at<br>
> <a href="https://github.com/yanick/Dancer2/tree/plugins-yanick" rel="noreferrer" target="_blank">https://github.com/yanick/Dancer2/tree/plugins-yanick</a><br>
><br>
> 2. read the D2::P2 docs (`perldoc lib/Dancer2/Plugin2`)<br>
><br>
> 3. if docs are not sufficient, check examples (`/t/plugins2-*`) and the<br>
> already-ported modules at bullet #5 below.<br>
><br>
> 4. report all problems, head-scratchers, suggestions, etc to<br>
> <a href="https://github.com/PerlDancer/Dancer2/pull/1010#issuecomment-147376270" rel="noreferrer" target="_blank">https://github.com/PerlDancer/Dancer2/pull/1010#issuecomment-147376270</a><br>
><br>
> 5. you ported the plugin and all works? Post your victory to the PR<br>
> dicussion<br>
> at #4, and add your plugin to the list at<br>
> <a href="https://github.com/PerlDancer/Dancer2/wiki/Plugins-migrated-to-D2::P2" rel="noreferrer" target="_blank">https://github.com/PerlDancer/Dancer2/wiki/Plugins-migrated-to-D2::P2</a><br>
> (that's important, I'll set up a job to test any new tweaks on<br>
> D2::P2 to all the converted modules)<br>
><br>
> And, of course, you have questions or anything, please feel free to hit<br>
> me with'em.<br>
><br>
<br>
</div></div>A few remarks:<br>
<br>
1. Dancer2::Plugin::DBIC is actually ironcamel's module.<br>
<br>
2. Plugins based on Plugin2 can not use plugins based on Plugin(1).<br>
<br>
3. Tests are going to be rewritten, now we need an app object.<br>
I would be good to fake that so we can test plugin calls from<br>
the outside of the routes.<br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888"> Racke<br>
<br>
<br>
--<br>
Perl and Dancer Development<br>
<br>
Visit our Perl::Dancer conference 2015.<br>
More information on <a href="https://www.perl.dance" rel="noreferrer" target="_blank">https://www.perl.dance</a>.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">____________________________<br>Rubén Darío Amórtegui Medina<br>MCE - Ingeniero de Sistemas</div></div>
</div>