Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin section to Tutorial guide #1480

Open
wants to merge 1 commit into
base: master
from
Open

Add plugin section to Tutorial guide #1480

wants to merge 1 commit into from

Conversation

@Grinnz
Copy link
Contributor

Grinnz commented Mar 9, 2020

Summary

A tutorial section for using plugins in applications.

Motivation

Using plugins is not currently covered anywhere in the guides in a general manner.

References


app->start;

Some built-in plugins include L<Mojolicious::Plugin::DefaultHelpers>, which

This comment has been minimized.

Copy link
@kraih

kraih Mar 9, 2020

Member

Mentioning an automatically loaded plugin here is a bit misleading. I guarantee it will be misunderstood.

A list of built-in plugins can be found at L<Mojolicious::Plugins/"PLUGINS">.
Many more plugins are available from CPAN, and you can even write plugins
specifically to help organize your application as described at
L<Mojolicious::Guides::Cookbook/"Adding a plugin to your appplication">.

This comment has been minimized.

Copy link
@kraih

kraih Mar 9, 2020

Member

This is too verbose for a tutorial section. Just replace all of this with a link to MetaCPAN, like we have on the frontpage.

@Grinnz Grinnz force-pushed the plugin_tutorial branch from 3f690a1 to f6ab445 Mar 9, 2020
@Grinnz

This comment has been minimized.

Copy link
Contributor Author

Grinnz commented Mar 9, 2020

Updated to be more concise

@Grinnz

This comment has been minimized.

Copy link
Contributor Author

Grinnz commented Mar 9, 2020

Calling for a vote @mojolicious/core

Copy link
Member

marcusramberg left a comment

Lgtm 👍

Copy link
Member

jhthorsen left a comment

I think in general that this is a great addition to the guide 👍

Plugins are application extensions that help with code sharing and
organization. You can load a plugin with the keyword
L<Mojolicious::Lite/"plugin">, which can omit the C<Mojolicious::Plugin::> part
of the name, and optionally provide configuration for the plugin.

This comment has been minimized.

Copy link
@jhthorsen

jhthorsen Mar 9, 2020

Member

I think "which can omit the CMojolicious::Plugin:: part of the name" is out of place. Doesn't read very well to me. I think instead of mentioning which arguments plugin() can take, I would say why you want to write plugins. Something like "code sharing", "sharing logic between controllers", ...

This comment has been minimized.

Copy link
@Grinnz

Grinnz Mar 10, 2020

Author Contributor

It is necessary to explain why plugin Config loads Mojolicious::Plugin::Config.

This comment has been minimized.

Copy link
@Grinnz

Grinnz Mar 10, 2020

Author Contributor

If not documented here, I'd want to document it in either the Mojolicious::Lite/plugin or Mojolicious/plugin docs, neither of which currently contain this explanation of the arguments (just examples).

This comment has been minimized.

Copy link
@kraih

kraih Mar 13, 2020

Member

Every plugin worth using documents how it prefers to be loaded. I don't think mentioning it here adds much value to the tutorial.

This comment has been minimized.

Copy link
@Grinnz

Grinnz Mar 13, 2020

Author Contributor

That does not help with the other direction: seeing "plugin Config" in code and wanting to find out what that means (or more difficult, plugins from CPAN).

This comment has been minimized.

Copy link
@jhthorsen

jhthorsen Mar 23, 2020

Member

It is necessary to explain why plugin Config loads Mojolicious::Plugin::Config.

I think it's up to Mojolicious::Plugin::Config to document how it is loaded. I do agree that it's useful to have the rules mention in a general section as well, but I don't think this is the right place.

@kraih

This comment has been minimized.

Copy link
Member

kraih commented Mar 16, 2020

Guess i'm voting neutral.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.