Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Update plugins from old plugin system to new plugin system

Open xsawyerx opened this issue 9 years ago • 90 comments

This is a ticket to track all the plugins that do not work on the new plugin system and also which ones have been converted to pure plugin2.

Release OK or fixed/PR in repo: 61/68 ~ 90%

:+1: Latest release OK (59/68):
plugin Plugin2 only? Release Repo
Adapter no CPAN Github
Ajax :+1: CPAN Github
Articulate no CPAN Github
Auth::Extensible :+1: CPAN Github
Auth::Extensible::Provider::Database :+1: CPAN Github
Auth::Extensible::Provider::DBIC :+1: CPAN Github
Auth::Extensible::Provider::Usergroup :+1: CPAN Github
Auth::HTTP::Basic::DWIW no CPAN Github
Auth::OAuth no CPAN Github
Auth::Tiny PR CPAN Github
BrowserDetect PR CPAN Github
Cache::CHI no CPAN Github
Captcha no CPAN Github
Cart :+1: CPAN Github
Chain no CPAN Github
ConditionalCaching no CPAN Github
Database no CPAN Github
DataTransposeValidator no CPAN Github
DBIC no CPAN Github
Deferred :+1: CPAN Github
ElasticSearch no CPAN Github
Email :+1: CPAN Github
Emailesque no CPAN GitHub : visual verification (no tests)
EncryptID :+1: CPAN Github
Feed no CPAN Github
Flash :+1: CPAN Github
Growler no CPAN Github
HTTP::Auth::Extensible :+1: CPAN Github
Interchange6 :+1: CPAN Github
JWT no CPAN Github
Locale :+1: CPAN Github
Locale::Wolowitz no CPAN Github
LogReport no CPAN no public repo
Minify no CPAN GitHub
Multilang no CPAN Github
Negotiate no CPAN Github
OAuth2::Server no CPAN Github
PageHistory :+1: CPAN Github
ParamKeywords no CPAN Github
ParamTypes :+1: CPAN GitHub
Passphrase :+1: CPAN Github
Path::Class no CPAN Github
Pg no CPAN Github
ProbabilityRoute no CPAN Github : manual testing using demo
ProgressStatus no CPAN Github
Queue no CPAN Github
Queue::MongoDB no CPAN Github
reCAPTCHA no CPAN Github
Redis :+1: CPAN Github
Res no CPAN Github
REST no CPAN Github
RootURIFor no CPAN Github
SendAs :+1: (in core) CPAN Github
Shutdown no CPAN Github
Shutdown::Redis no CPAN Github
Sixpack no CPAN Github
Swagger2 no CPAN GitHub
Syntax::GetPost no CPAN Github
TemplateFlute :+1: CPAN Github
:+1: Release broken but fixed in GH upstream:
plugin Release Repo
RoutePodCoverage CPAN Github
UnicodeNormalize CPAN Github
:-1: Release broken but PR submitted:
plugin Release Repo
Auth::YARBAC CPAN Github : PR
:question: Unknown (no tests)
plugin Release Repo
GoogleAnalytics CPAN Github repo disappeared
HTTP::Caching Github
HTTP::ConditionalRequest Github
HTTP::ContentNegotiation Github
LogContextual CPAN Github
Model Github

xsawyerx avatar Dec 26 '15 09:12 xsawyerx

:-1: Passphrase: Github

t/003_default_settings.t .. Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/apm/git/Dancer2/lib/Dancer2/Plugin.pm line 247.
Can't find originating plugin at t/003_default_settings.t line 5.

SysPete avatar Dec 28 '15 15:12 SysPete

:-1: Deferred

This plugin does: use Dancer2::Plugin qw(:no_dsl); which is what breaks things. If :no_dsl is removed then tests all pass. It also passes against 0.165 with this change.

SysPete avatar Dec 28 '15 15:12 SysPete

:-1: Auth::Extensible: Github Same issue as Passphrase:

t/01-basic.t ...... Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/apm/git/Dancer2/lib/Dancer2/Plugin.pm line 247.
Can't find originating plugin at t/lib/TestApp.pm line 10.

SysPete avatar Dec 28 '15 16:12 SysPete

:-1: Auth::OAuth: Github PR submitted to remove 'use Dancer2' https://github.com/b10m/p5-Dancer2-Plugin-Auth-OAuth/pull/7 Once patch is applied breaks in the same way as Passphrase and Auth::Extensible.

SysPete avatar Dec 28 '15 16:12 SysPete

:-1: DBIC: Github

t/04-testapp.t ........... Specific subroutines cannot be exported from plugin at t/lib/TestApp.pm line 5.

Due to this in the test: use Dancer2::Plugin::DBIC qw(schema resultset); Simple fix is to remove import list.

PR submitted https://github.com/ironcamel/Dancer2-Plugin-DBIC/pull/13

Update: PR merged. Awaiting new release.

SysPete avatar Dec 28 '15 17:12 SysPete

:-1: Feed: Github Just need to remove use Dancer2. PR submitted.https://github.com/hobbestigrou/Dancer2-Plugin-Feed/pull/5

SysPete avatar Dec 29 '15 08:12 SysPete

:-1: JWT: Github

Two problems here. One was solved by using plugin_setting DSL:

--- a/lib/Dancer2/Plugin/JWT.pm
+++ b/lib/Dancer2/Plugin/JWT.pm
@@ -15,7 +15,7 @@ my $config;

 sub _get_secret {
        my $dsl = shift;
-       $config = $dsl->config->{plugins}{JWT};
+       $config = plugin_setting;
        die "JWT cannot be used without a secret!" unless exists $config->{secret};
        return $config->{secret};
 }

That change is in the master branch of my fork: https://github.com/SysPete/Dancer2-Plugin-JWT

Still leaves the Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN... as in other plugins^^

SysPete avatar Dec 29 '15 10:12 SysPete

:-1: Redis: Github

use strictures 1 along with plugin_args deprecation notice causes exceptions. Removing use of plugin_args fixes all problems.

PR with fix

SysPete avatar Dec 29 '15 12:12 SysPete

:-1: REST: Github

Diff is pretty simple:

remove use Dancer2

--- a/lib/Dancer2/Plugin/REST.pm
+++ b/lib/Dancer2/Plugin/REST.pm
@@ -6,14 +6,9 @@ use warnings;

 use Carp 'croak';

-use Dancer2 0.149000_01;
 use Dancer2::Plugin;

use Class::Load qw/ try_load_class /;

-use Moo::Role;
-
-with 'Dancer2::Plugin';
-
 # [todo] - add XML support
 my $content_types = {
     json => 'application/json',

PR: https://github.com/PerlDancer/Dancer2-Plugin-REST/pull/12

SysPete avatar Dec 29 '15 13:12 SysPete

PerlDancer/Dancer2-Plugin-REST

Using the new plugin_keyword keyword triggers a warning that using the DSL is deprecated. (see t/04_helpers.t)

https://github.com/yanick/Dancer2-Plugin-REST/compare/master...PerlDancer:d2?expand=1

Using the 'sub foo :PluginKeyword` alternative does not trigger the warning.

yanick avatar Dec 29 '15 14:12 yanick

So we're waiting for D2P2 to be released before Dancer2::Plugin::REST gets a new release?

xsawyerx avatar Dec 29 '15 17:12 xsawyerx

What @SysPete was tracking was how to make the most minimal changes to get the next version running without changing it to D2P2. Then it can be released already before D2P2 is released.

xsawyerx avatar Dec 29 '15 17:12 xsawyerx

On 2015-12-29 12:08 PM, Sawyer X wrote:

What @SysPete https://github.com/SysPete was tracking was how to make the most minimal changes to get the next version running without changing it to D2P2. Then it can be released already before D2P2 is released.

Sure. Will release the patch in a few minutes.

yanick avatar Dec 29 '15 17:12 yanick

@SysPete I fixed the uninitialized error!

xsawyerx avatar Dec 30 '15 00:12 xsawyerx

On 30/12/15 01:41, Sawyer X wrote:

@SysPete https://github.com/SysPete I fixed the uninitialized warning!

— Reply to this email directly or view it on GitHub https://github.com/PerlDancer/Dancer2/issues/1078#issuecomment-167906412.

Excellent! Will start going back through them.

SysPete avatar Dec 30 '15 09:12 SysPete

Dancer2::Plugin::DBIC has been released with @SysPete's patch.

racke avatar Dec 30 '15 12:12 racke

On Wed, 30 Dec 2015, Stefan Hornburg (Racke) wrote:

Dancer2::Plugin::DBIC has been released with @SysPete's patch.

... and on its way to the FreeBSD ports-tree :)

hvoers avatar Dec 30 '15 12:12 hvoers

Passphrase has been released on CPAN and is on its way to FreeBSD. Next port: Auth::Extensible

hvoers avatar Dec 30 '15 12:12 hvoers

Auth::Extensible @racke Is version 0.402 the one that is D2P2 ready?

hvoers avatar Dec 30 '15 12:12 hvoers

On 12/30/2015 01:49 PM, Henk van Oers wrote:

Auth::Extensible @racke https://github.com/racke Is version 0.402 the one that is D2P2 ready?

It doesn't have any special patches for D2P2, so it is uncertain. I'll check that.

Regards Racke

Perl and Dancer Development

Visit our Perl::Dancer conference 2015. More information on https://www.perl.dance.

racke avatar Dec 30 '15 12:12 racke

It throws a lot of warnings:

t/01-basic.t ...... 1/? Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.

racke avatar Dec 30 '15 12:12 racke

For ProgressStatus, I have a branch that uses new style. I hadn't merged it yet but I can do that now

shumphrey avatar Dec 30 '15 13:12 shumphrey

Throwing warnings is on purpose. It's like that so you would have to upgrade. The warnings will only be thrown if someone uses an older version of the plugin (which uses the older D2::P plugin interface) while the new D2::P interface is available.

This means that you release this version now - no warnings yet. We release a new version of Dancer2 with the new D2::P and then you have warnings until you upload a new version that uses the new interface.

That's the deprecation cycle.

Also, I pushed a fix for the last uninitialized error.

xsawyerx avatar Dec 30 '15 14:12 xsawyerx

Yes, sounds like a good plan.

racke avatar Dec 30 '15 14:12 racke

Thus that mean that after the release of the new Dancer2 with the new D2::P all the plugins need a new version? Will D2::P::Passphrase version 3.2.2 need a next version?

hvoers avatar Dec 30 '15 15:12 hvoers

When we introduce a new feature, we start by deprecating the old one. This means supporting it but warning that it's deprecated. After a while we stop supporting it. That's what we do every time.

The plugins system is not different. The new Dancer2 version will still support plugins written in the old syntax, but will warn that they are deprecated. This gives you a chance to release new versions that use the new plugin system when you're ready. However, we will warn in order to make sure plugins are updated and author don't force us to continue supporting the old syntax forever.

xsawyerx avatar Dec 30 '15 19:12 xsawyerx

@SysPete Your JWT fork works.

xsawyerx avatar Dec 30 '15 21:12 xsawyerx

@hvoers I see the latest Passphrase release doesn't actually use the new syntax, it's just in compatibility mode. You don't need to bump the Dancer2 requirement there. At some point the module will have to start using the new syntax, but only after it's released.

xsawyerx avatar Dec 30 '15 21:12 xsawyerx

On Wed, 30 Dec 2015, Sawyer X wrote:

@hvoers I see the latest Passphrase release doesn't actually use the new syntax, it's just in compatibility mode. You don't need to bump the Dancer2 requirement there. At some point the module will have to start using the new syntax.

I am sorry to read that I was wasting time on unusable modules :(

hvoers avatar Dec 30 '15 21:12 hvoers

@hvoers What do you mean?

xsawyerx avatar Dec 30 '15 22:12 xsawyerx