Repository navigation
Description
Feature Description
Once #656 is complete, the intention was that new modules would be initially released as standalone plugins, and not bundled with the main Performance Lab plugin. This creates a situation where new plugin modules can not easily be tested or used prior to them being available on the plugin repo. Given the current long wait times for new plugins to be approved on the repo, this would create a significant problem for efficiently developing and testing out new features and no clear way of testing the feature prior to an initial release.
Currently, a new module can be activated from the Performance Lab settings screen before it has been removed as a standalone plugin, so a new module can be tested by checking out a feature branch of this repo that includes the new module and activating it in the settings screen.
Initial ideas to consider
As originally discussed in #904 (comment), there are a few ways to address this issue:
- Allow new modules to initially be included as experimental features that can be activated in the Performance Lab plugin prior to being released as a standalone plugin. This would require maintaining the migration logic developed in Overview: Creating standalone plugins #656 in the plugin indefinitely, as it will be needed as new plugins are released.
- Update the release process for this repo so that we can publish zip files of standalone modules here, before they are available on the plugin repo. This is probably worth looking into regardless, so we can test pre-release zips prior to publishing a new release of a standalone plugin. However, this is still less convenient than being able to test updates from a single repo.
Currently effected modules in development
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone 😃
Activity
felixarntz commentedon Dec 21, 2023
I think I would prefer option 1, as it allows automatic updates easily (simply via Performance Lab). It's also not a lot of additional work required since most of the necessary infrastructure is implemented already.
Any code could start as a module, and once it's approved as standalone plugin, it can be deployed that way. Users would then see the migration notice as needed, and 1-2 releases later the module would be removed from PL.
The main difference that doing this long-term would potentially require is to adjust the standalone plugin build process slightly:
modulesdirectory.plugins).modulesandpluginsdirectories for the standalone plugins we have and depending on where the plugin code comes from use either the "module to plugin deployment" or the "plugin deployment" logic.joemcgill commentedon Dec 21, 2023
I put a bit of time into investigating what we would need to do to publish zips of standalone plugins to the releases page of this repo and if we did want to do this, we would need to update a few parts of our current workflow automation.
Currently, publishing a new release triggers both the main Deploy to WordPress.org workflow as well as the Deploy standalone plugins to WordPress.org workflow.
Both of these workflows would need to be altered so that we could publish a standalone plugin release (or pre-release) that would automate the creation of a new release tag without triggering additional deployment workflows. We could probably use tag filtering (
step.if) to accomplish this, but we may want to rethink the whole automation flow so that the published release on the repo is the final result of the release workflow, rather than the trigger to initiate the workflow. We could also consider automating the creation of standalone plugin specific branches, from which each plugin could be tagged and deployed.All this to say, I do think that option 1 will be less effort initially, though I would like for us to have a better long-term way of offering downloads of standalone plugins—including pre-release versions—for testing purposes outside of the official plugins repo. I do like the idea of moving standalone plugins to a separate folder that is organized as plugin folders rather than needing and think that if we make that change, then keeping a separation between what is a "plugin" and what is a "module" would simplify things a bit.
felixarntz commentedon Jan 3, 2024
How about we start with the following workflow for modules that graduate into standalone plugins:
modulesfolder, the same way as today.npm run build-plugins(after temporarily adding the module toplugins.json, without actually committing) to get the plugin version of the module, then submit to .org for review.perflab_get_standalone_plugins_constants()function to include the module/plugin.plugins.jsonto include the module/plugin.perflab_get_standalone_plugins()function to include the plugin.modulesto thepluginsfolder (that would be a new top-level folder in the repository).plugins.jsonand in theperflab_get_standalone_plugins_constants()function.This would pretty much be the workflow.
To make that happen, only a few infrastructure changes would need to be implemented:
pluginsfolder.plugins.jsonstructure to allow managing both modules that are also deployed as plugins (i.e. frommodulesfolder), as well as plugins that are purely standalone plugins (i.e. frompluginsfolder).php-test-standalone-plugins.ymlanddeploy-standalone-plugins.ymlcommands to also cover plugins from thepluginsfolder. That should be quite straightforward, since, if anything, it involves less work, since those are already plugins, i.e. they don't need to be "built" from modules into plugins.Once all of this infrastructure exists, we would document the workflow in the Performance Team Handbook, similar to the other documentation that already exists on writing a module. A few points in that existing documentation should probably be updated then as well.
LMKWYT.
joemcgill commentedon Jan 3, 2024
TLGTM! 😜
For now I think we should separate discussion about moving standalone plugins to a separate built plugins directory from the problem this issue is trying to solve. For now, manually building a plugin before it's released seems like a fine workaround to get the review process started. We could even upload those zips manually to the GH release page if we wanted to make it easier for folks to test pre-releases before they're on the .org repo.
Until a module is available on the .org repo, keeping it available as an option to enable seems sensible. Once it's available, we can migrate it to whatever the current process is for managing the standalone plugins. Let's start a new issue for reorganizing published modules within the codebase in the meantime.
felixarntz commentedon Jan 4, 2024
Happy to break this apart, but I think the separate built plugins directory is a given anyway. We can't have those continue to live in the
modulesdirectory when they shouldn't be modules in PL anymore.I agree though that the infrastructural change related to having both
modulesandpluginsdirectories should be implemented regardless of what we decide for this issue here. Even if we end up deciding that we won't start new standalone plugins as a module first, that'll be needed. In that case, we would probably start a new standalone plugin in thepluginsdirectory right away, but then there would need to be another approach if we wanted to make it available before .org approval.westonruter commentedon Jan 8, 2024
Sorry if this was already discussed...
What if they actually are kept in
modulesand all of the standalone plugins continue to get shipped as part of the PL plugin as modules? This would make migration to standalone plugins much easier, as a site owner could switch over to the standalone plugin at any time. There would be no back-compat breakage. In this wayAs soon as someone installs a standalone plugin for a PL module, the module code would then short-circuit so that only one copy of the functionality is active at a time. The PL module could get deactivated (in the plugin DB option) when the standalone plugin is activated, ensuring that when a site owner deactivates the module it doesn't result in the module's behavior (from the PL plugin) from continuing to run unexpectedly. This would be the essence of the migration logic.
This would also solve the problem of the plugin review queue taking so long to approve new plugins. The long wait would not hold up immediate testing of the new module bundled with the PL plugin: it's just that the module wouldn't be able to be tested standalone until the standalone plugin is published on the directory.
felixarntz commentedon Jan 12, 2024
@westonruter Having the features as modules and plugins was ruled out during the initial project definition as an option. See the conversation starting in #618 (comment) for context.
felixarntz commentedon Mar 2, 2024
@joemcgill Given that we won't use modules anymore, we may want to close this issue. Or at the very least rename it to maybe use "features" instead of "modules".
Personally, I'm not sure there's realistically a need for this in terms of making those features available at scale, as the plugin reviews have become much faster again, so I don't envision us being blocked from that anymore.
What is worth thinking about as you were mentioning the other day is how to make pre-release versions of features easier to test, but that's probably mostly a DX issue to improve for the contributors to the project rather than at scale (as in the 100k+ Performance Lab end users). It may fit better into a new dedicated issue that explains that goal.
[-]Making new modules usable before they're released to the plugin repo[/-][+]Making standalone plugins usable before they're released to the plugin repo[/+]joemcgill commentedon Mar 5, 2024
Thanks @felixarntz. I would like to keep this issue open until we have a documented process for testing standalone plugins in development prior to being released on the .org repo. I've renamed the issue to no longer refer to "modules" in order to be more clear. There are two main reasons this is still needed:
As I've thought more about this, the easiest way for us to solve all of these issues is to make sure all of our standalone plugins are loaded automatically as part of the
.wp-env.jsonconfig, like this:{ "plugins": [ ".", "./plugins/auto-sizes/auto-sizes.php", "./plugins/speculation-rules/load.php" ] }That way the standalone plugins are auto-installed locally without additional workarounds.
Somewhat related, I think it would be nice to update our release workflows so that each plugin gets included individually in our releases page, with zip files attached for each standalone plugin release, along with changelogs, etc. This could also allow us to generate pre-releases if needed.
felixarntz commentedon Mar 5, 2024
@joemcgill I like your
wp-envproposal, that would be a very straightforward start that would already improve DX a lot.joemcgill commentedon Mar 5, 2024
👍🏻 PR incoming for that shortly.
felixarntz commentedon Mar 20, 2024
Removing this from the 3.0.0 milestone as it is not really relevant for end users of the plugin and thus doesn't have to be solved by that release.
westonruter commentedon May 20, 2024
@joemcgill I think this is done now, right?
joemcgill commentedon May 20, 2024
Yes, I think we can close this. The standalone plugin folders are automatically loaded into the wp-env container since #1028. We can also build production versions locally using
npm run build-pluginssince #1033.