Repository navigation
wp-now: download wordpress and sqlite in parallel - #417
Conversation
There was a problem hiding this comment.
It's a short and sweet PR so let's get this in, but this recreates a feature Blueprints already have. Let's just migrate wp-now setup to Blueprints instead. Async retrieval and progress reporting are already supported there. No need to build two competing implementations.
For example, this Blueprint would download three files in parallel, unzip them, and provide progress details on the entire operation so that you could render a CLI progress bar:
const blueprint = {
steps: [
{
"step": "writeFile",
"path": "/wordpress.zip",
"data": {
"resource": "url",
"url": "... zip url ..."
}
},
{
"step": "writeFile",
"path": "/sqlite-plugin.zip",
"data": {
"resource": "url",
"url": "... zip url ..."
}
},
{
"step": "writeFile",
"path": "/mu-plugins.zip",
"data": {
"resource": "url",
"url": "... zip url ..."
}
},
{
"step": "unzip",
"zipPath": "/wordpress.zip",
"extractToPath": "/path/to/extract"
},
// ... unzip the rest ...
]
};
const progressTracker = new ProgressTracker();
const compiled = compileBlueprint(blueprint, {
progress: progressTracker
});
await runBlueprintSteps(compiled, php); Now, it could require an additional PR or two. For example, I'm not sure if fetch works out of the box in Node.js, but there's a good chance it would. Also, unzipping could be optimized to use the same Node.js stream-based library we use now.
|
@adamziel , thanks for creating the issue 🙌 |
What?
Optimize WordPress and SQLite downloads to be in parallel.
Optimization for wp-now and its tests.
Why?
An easy optimization to improve the developer experience.
Testing Instructions
~/.wp-nowfoldernpx nx test wp-now