Skip to content

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Dec 17, 2025

Related issues

Proposed Changes

Remove PHP-WASM packages (~1.1 GB) from the desktop app's ASAR bundle. The desktop app now uses CLI for all WordPress operations, making these dependencies redundant.

  • Create local type definitions (common/types/php-versions.ts) to replace @php-wasm/universal imports
  • Remove WordPress provider abstraction layer (src/lib/wordpress-provider/)
  • Remove child process entry points from desktop build
  • Remove getProviderConstants IPC/Redux layer - components import directly from common/constants
  • Move download utilities from wp-now to src/lib/download-utils.ts
  • Remove vendor/wp-now/ directory
  • Move PHP-WASM packages from dependencies to devDependencies (for type checking only)
  • Keep forge.config.ts ignore patterns to exclude PHP-WASM from bundle

Size reduction:

Component Before After Reduction
app.asar 1.4 GB 295 MB ~1.1 GB
Total App ~3 GB 1.8 GB ~1.2 GB

Testing Instructions

  1. npm install
  2. npm start
  3. Create a new site - verify it works
  4. Start/stop sites - verify server operations work
  5. Import/export a site - verify backup/restore works
  6. Run tests: npm test
  7. Build installer: npm run package - verify app.asar is ~295 MB

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Dec 17, 2025
@bcotrim bcotrim changed the title remove php-wasm from Studio Remove PHP-WASM dependencies from Studio Dec 18, 2025
@bcotrim bcotrim requested review from a team and fredrikekelund December 18, 2025 09:32
@bcotrim bcotrim marked this pull request as ready for review December 18, 2025 10:33
@fredrikekelund
Copy link
Contributor

Let's remove the unzipper dependency from package.json as part of this PR. #2348 removed it from scripts/download-wp-server-files.ts, and the only remaining place it was used was in vendor/wp-now (which we'll remove with this PR).

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks @bcotrim for this huge reduction in size 🙌

I have done some initial testing, and I have identified that creating a site does not start it for me. Also, when deleting it, an error is displayed, although the deletion completes. Please see a video below.

CleanShot.2026-01-08.at.17.08.23.mp4

Please let me know if you need the logs.

@bcotrim
Copy link
Contributor Author

bcotrim commented Jan 9, 2026

@epeicher
I couldn't replicate the issue, do you see anything in the Studio logs?
Can you share a bit more detail about your test? (npm start or bundled Studio from npm run package, etc)
Thanks testing and sharing the results!

@epeicher
Copy link
Contributor

epeicher commented Jan 9, 2026

@epeicher I couldn't replicate the issue, do you see anything in the Studio logs? Can you share a bit more detail about your test? (npm start or bundled Studio from npm run package, etc) Thanks testing and sharing the results!

@bcotrim, I have been investigating more, and I have done the following that fix my issues:

  1. Delete node_modules and cli/node_modules, I have also deleted the dist folder
  2. Run npm install on the root folder to install npm packages
  3. Run cd cli && npm install to install npm packages on the cli folder
  4. On the root folder, run npm start

That fixes all the issues I was having, I am going to do some additional testing, but this looks good so far 🥳

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks again @bcotrim for these massive changes. I have done a round of testing, and these are my findings.

  1. Create a new site - verify it works - ✅
    This works fine, I have identified a minor issue that I am not able to reproduce in trunk but it is not a blocker, and it could be tackled as a follow-up if required. When creating a site, there is a moment where the list of sites displays the new one duplicated, please see screenshot: Image
  2. Start/stop sites - verify server operations work - ✅
  3. Export a site - verify backup works - ✅
  4. Import a site - verify restore works - ❌
    Importing a recently exported backup fails with the error Database import failed - Please find error logs here 3a0e9-pb
  5. Run tests: npm test - ✅
  6. Build installer: npm run package - verify app.asar is ~295 MB - ✅ - 294M Jan 9 13:15 app.asar (in trunk it occupies 1.4G 🤯 )

I have measured the time it takes to create a site (approximately), and I have observed that on my Mac, it takes around 16 seconds on trunk (using npm startand having a few sites) and it takes around 8 seconds on this branch, so this is a great improvement 🙌

All in all, I would like to have another pair of eyes to review the changes, but this is looking great, amazing work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants