{"action":"closed","issue":{"url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1216","repository_url":"https://api.github.com/repos/PerlDancer/Dancer2","labels_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1216/labels{/name}","comments_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1216/comments","events_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1216/events","html_url":"https://github.com/PerlDancer/Dancer2/issues/1216","id":166038020,"number":1216,"title":"[Dancer2 0.200003] Weird behaviour with Plugin Inclusion","user":{"login":"pierre-vigier","id":7546757,"avatar_url":"https://avatars.githubusercontent.com/u/7546757?v=3","gravatar_id":"","url":"https://api.github.com/users/pierre-vigier","html_url":"https://github.com/pierre-vigier","followers_url":"https://api.github.com/users/pierre-vigier/followers","following_url":"https://api.github.com/users/pierre-vigier/following{/other_user}","gists_url":"https://api.github.com/users/pierre-vigier/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre-vigier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre-vigier/subscriptions","organizations_url":"https://api.github.com/users/pierre-vigier/orgs","repos_url":"https://api.github.com/users/pierre-vigier/repos","events_url":"https://api.github.com/users/pierre-vigier/events{/privacy}","received_events_url":"https://api.github.com/users/pierre-vigier/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-07-18T07:56:41Z","updated_at":"2016-07-21T15:21:42Z","closed_at":"2016-07-21T15:21:41Z","body":"Hi,\r\n\r\ni got an app that was working on Dancer 0.166001 and is breaking with 0.200003 .\r\nHere is a trimmed down version of the problem. Once including Dancer2::Plugin::Database , i get a `Can't locate object method \"dsl\" via package \"DemoApp\"` error message\r\n\r\n* bin/app.psgi\r\n```perl\r\n#!/usr/bin/env perl\r\nuse strict;\r\nuse warnings;\r\nuse lib 'lib';\r\nuse DemoApp;\r\n\r\nreturn DemoApp->to_app;\r\n```\r\n\r\n*lib/DemoApp.pm\r\n```perl\r\npackage DemoApp;\r\nuse DemoApp::Extension;\r\nuse Dancer2;\r\n\r\nget '/' => sub { return 'root' };\r\n\r\ntrue;\r\n```\r\n\r\n*lib/DemoApp/Extension.pm\r\n```perl\r\npackage DemoApp::Extension;\r\nuse Dancer2 appname => 'DemoApp';\r\nuse Dancer2::Plugin::Database;\r\n\r\nget '/extension' => sub { 'extension'; };\r\n```\r\n\r\nThat code runs on Dancer2 0.166001, but not on 0.200003.\r\n\r\nFix is pretty simple, in my code, if i reverse in `lib/DemoApp.pm` the inclusion of Dancer2 and DemoApp::Extension, it is then working as expected:\r\n```perl\r\npackage DemoApp;\r\nuse Dancer2;\r\nuse DemoApp::Extension;\r\n```\r\ninstead of\r\n```perl\r\npackage DemoApp;\r\nuse DemoApp::Extension;\r\nuse Dancer2;\r\n```\r\n\r\nIt might be worth a hint in documentation for people upgrading from a version below 0.200001 to 0.200001 and above.\r\n\r\nThe code is working properly in 0.200001 and above if in my case the DemoApp::Extension package do not include plugin Dancer2::Plugin::Database .\r\nI can't tell if it's a bug of Dancer2 or of my code, but it's a breaking change. That's happening with other plugin as well, like Dancer2::Plugin::Email.\r\n"}}
{"actor":{"display_login":"xsawyerx"}}