Skip to content

Commit

Permalink
Remove harmful warning Update plugins.md
Browse files Browse the repository at this point in the history
Align with Mage-OS.
Around plugins are good and explicitly show up in a stack trace, performance degradation is minuscule by comparison with hours of debugging and understanding combinations of plugins.
https://devdocs.mage-os.org/docs/main/plugins#content-2-after-plugin
  • Loading branch information
kirmorozov authored Sep 17, 2024
1 parent 0435450 commit a439fd7
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/pages/development/components/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,6 @@ If an argument is optional in the observed method, then the after method should

The application runs the code in around methods before and after their observed methods. Using these methods allow you to override an observed method. Around methods must have the same name as the observed method with 'around' as the prefix.

<InlineAlert variant="warning" slots="text"/>

Avoid using around method plugins when they are not required because they increase stack traces and affect performance.
The only use case for around method plugins is when the execution of all further plugins and original methods need termination.
Use after method plugins if you require arguments for replacing or altering function results.

Before the list of the original method's arguments, around methods receive a `callable` that will allow a call to the next method in the chain. When your code executes the `callable`, the application calls the next plugin or the observed function.

Expand Down

0 comments on commit a439fd7

Please sign in to comment.