Dancer1 plugins and Dancer2 plugins
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... ? I apologize if I am uncovering some heated debates relating to the subject.
Plugins are a sore point. They've been handled multiple times by gifted individuals but it still seems like a problematic issue. I think the shared knowledge of David Precious, Alberto Simoes and Damien Krotkine. Could you guys chime in for a bit? Maybe we could brainstorm on the current problems with the plugins system and how to fix them? On Mon, Sep 16, 2013 at 10:05 AM, Slavik Goltser <slavikg@gmail.com> wrote:
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... ?
I apologize if I am uncovering some heated debates relating to the subject.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
I think I could have ideas/background to share as well, let's do that by email shall we? The base of Dancer2::Plugin comes from a first brainstorming we had Matt and I in the early stage of D2, when I was working on porting D1 into a Moo-ish structure. The main idea is that a plugin is actually an extension to the DSL of the app. The idea itself is quite good, I think (credits to mst) but it's true the reality of the implementation is quite complex and not optimal. It's true we could/should find a way to implement that in a better way. I'd be happy to join the thinking process. 2013/10/7 sawyer x <xsawyerx@gmail.com>
Plugins are a sore point. They've been handled multiple times by gifted individuals but it still seems like a problematic issue. I think the shared knowledge of David Precious, Alberto Simoes and Damien Krotkine.
Could you guys chime in for a bit?
Maybe we could brainstorm on the current problems with the plugins system and how to fix them?
On Mon, Sep 16, 2013 at 10:05 AM, Slavik Goltser <slavikg@gmail.com>wrote:
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... ?
I apologize if I am uncovering some heated debates relating to the subject.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Alexis Sukrieh
Hi Slavik, 2013/9/16 Slavik Goltser <slavikg@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!
Thanks. That helps. :-) On Oct 7, 2013 9:36 AM, "Alexis Sukrieh" <sukria@gmail.com> wrote:
Hi Slavik,
2013/9/16 Slavik Goltser <slavikg@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@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (3)
-
Alexis Sukrieh -
sawyer x -
Slavik Goltser