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

Introduce perflab_active_modules filter to control which modules are active #87

Merged
merged 8 commits into from
Jan 18, 2022

Conversation

eugene-manuilov
Copy link
Contributor

Addresses #33

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eugene-manuilov Looks great!

I left one comment below that doesn't block this from being merged, but we'll need to keep this in mind. Maybe it's better for now to put 1.0.0 like we have elsewhere. However, I think it'd be great to have an issue bringing up the n.e.x.t proposal.

load.php Outdated
/**
* Filters active modules to allow programmatically control which modules are active.
*
* @since n.e.x.t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the n.e.x.t convention here so far, but it's worth evaluating. Do you mind opening an issue where we can propose/discuss it? It would be important to document this somewhere eventually. We haven't published a release yet, but once we get to that, we'll need to have documentation anyway.

Maybe we could even have a npm script that replaces all n.e.x.t occurrences with a specific version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and added a new ticket: #90

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving for the additional (mini-)change.

@JustinyAhin
Copy link
Member

@eugene-manuilov could provide a snippet of how to test the filter, in a mu-plugin for instance? Thanks :)

@tillkruss
Copy link
Member

@eugene-manuilov could provide a snippet of how to test the filter, in a mu-plugin for instance? Thanks :)

add_filter( 'perflab_active_modules', function ( $modules ) {
    return array_diff( $modules, [ "foo", "bar" ] ); // modules you want to remove
} );

add_filter( 'perflab_active_modules', function ( $modules ) {
    return array_merge( $modules, [ "foo", "bar" ] ); // modules you want to add
} );

@JustinyAhin
Copy link
Member

Thanks, @tillkruss

@felixarntz felixarntz added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure labels Jan 18, 2022
@felixarntz felixarntz added this to the 1.0.0-beta.1 milestone Jan 18, 2022
@felixarntz felixarntz added Infrastructure Issues for the overall performance plugin infrastructure and removed Infrastructure Issues for the overall performance plugin infrastructure labels Jan 18, 2022
@felixarntz felixarntz merged commit a1ca4ff into trunk Jan 18, 2022
@felixarntz felixarntz changed the title Allow programmatic control of active modules via filter Introduce perflab_active_modules filter to control which modules are active Jan 18, 2022
@tillkruss tillkruss deleted the feature/modules-control-filter branch March 7, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall performance plugin infrastructure [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants