question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a plugin event triggered as early as possible

See original GitHub issue

Our earliest triggered plugin event, setup-env, occurs after the Environment is initialized. If we create an even earlier plugin event, even more things might be possible.

E.g. Jinja extensions have to subclass jinja’s Extension before the creation of the jinja env, which happens in the instantiation of our Lektor env. A plugin using a super early event could do this to allow a custom jinja extension to be picked up and added during the env creation.

Being super early, other things are possible too. Some adventurous plugin developer could even patch or rewrite a lot of Lektor classes before they’re called. There’s a lot of possibilities.

setup-env should not move, as that would potentially break things, and it’s name still fits since it’s right after the environment is created, but we could rework the plugin loading a little to allow for running a generic plugin at an even earlier step.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
nixjdmcommented, May 4, 2020

While I generally agree with that comment and like having specific events like the markdown events, it posses the same technical hurdle of reworking the plugin loading system because it’s still at an earlier point than the setup-env event. I would have considered making that a dedicated event, but I still also like the power afforded to an even earlier event too.

That said, I just closed #778 because I discovered my assumption leading down this path was wrong. So, this isn’t needed for adding Jinja extensions. This is now a design change in search of a well-defined feature. Possibly #751.

0reactions
xlotlucommented, Jul 20, 2020

See also #281

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo Server plugin event reference - Apollo GraphQL Docs
This helps you make sure all of your server's dependencies are available before attempting to begin serving requests. This event is fired at...
Read more >
Custom event trigger on a jQuery plugin instance
EDIT: a workaround is to attach/trigger the event on the "link" dom object, but I want to trigger events attached to my plugin...
Read more >
Trigger event for specific plugin only - Joomla Stack Exchange
Is it possible to trigger a event for specific plugin? I can load a specific plugin. $loaded = JPluginHelper::importPlugin('my_component', ' ...
Read more >
Event Trigger - Moodle plugins directory
This plugin plugin allows site administrators to trigger external actions such as an http request or email when certain events happen in Moodle....
Read more >
Configure your Outlook add-in for event-based activation
Learn how to configure your Outlook add-in for event-based activation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found