Skip to content

feat: skip require for already-loaded Template::Plugin subclasses#333

Merged
atoomic merged 1 commit intoabw:masterfrom
atoomic:koan.atoomic/skip-loaded-plugins
Feb 14, 2026
Merged

feat: skip require for already-loaded Template::Plugin subclasses#333
atoomic merged 1 commit intoabw:masterfrom
atoomic:koan.atoomic/skip-loaded-plugins

Conversation

@Koan-Bot
Copy link
Contributor

When a plugin class is already loaded in memory (e.g., defined inline
or bundled in the same file), skip the require call. This allows
plugins to be preloaded/embedded without needing a separate .pm file
on disk.

Uses isa($PLUGIN_BASE) check before require in both PLUGIN_NAME and
PLUGIN_BASE code paths. Classes that don't inherit from
Template::Plugin still go through the normal require path.

Resolves: #112

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

When a plugin class is already loaded in memory (e.g., defined inline
or bundled in the same file), skip the require call. This allows
plugins to be preloaded/embedded without needing a separate .pm file
on disk.

Uses isa($PLUGIN_BASE) check before require in both PLUGIN_NAME and
PLUGIN_BASE code paths. Classes that don't inherit from
Template::Plugin still go through the normal require path.

Resolves: abw#112

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atoomic atoomic marked this pull request as ready for review February 14, 2026 15:48
@atoomic atoomic self-assigned this Feb 14, 2026
@atoomic atoomic merged commit ad2d766 into abw:master Feb 14, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow plugins being preloaded/embedded in a bundle [rt.cpan.org #77554]

2 participants

Comments