Skip to content

Mount mu-plugin polyfills to the Playground filesystem - #845

Merged
bgrgicak merged 2 commits into
trunkfrom
update/move-mu-plugin-ployfills-to-internals
Jan 29, 2025
Merged

Mount mu-plugin polyfills to the Playground filesystem#845
bgrgicak merged 2 commits into
trunkfrom
update/move-mu-plugin-ployfills-to-internals

Conversation

@bgrgicak

@bgrgicak bgrgicak commented Jan 27, 2025

Copy link
Copy Markdown
Contributor

Related issues

To complete #9235 we also need to mount the SQLite plugin to the Playground FS instead of adding it to the site folder.

Proposed Changes

  • Mount mu-plugin polyfills to the Playground FS instead of adding them to the site's mu-plugins folder.
  • Remove mu-plugin polyfills from the site folder when the server starts.
  • Add a CLI mode to prepareWordPress, so all Playground modes can be configured from one place to avoid code duplication.
  • Add constants for internal imports.

Testing Instructions

  • Start the production version of Studio
  • Create a new site
  • Confirm that the site has polyfills inside the mu-plugins folder (e.g. 0-32bit-integer-warnings.php)
  • Close Studio
  • Checkout this branch
  • Open the dev version of Studio
  • Start the site you previously created
  • Confirm that the site works
  • Confirm that the site doesn't have polyfills inside the mu-plugins folder (e.g. 0-32bit-integer-warnings.php)
  • Create a new site
  • Confirm that it works

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
createNodeFsMountHandler(
`${ vfsDocumentRoot }/wp-content/mu-plugins`
) as unknown as MountHandler
async function mountInternalMuPlugins( php: PHP ) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm considering moving this function to a mount.ts file where we could later also add other mounts like the SQLite plugin.

@bgrgicak
bgrgicak requested a review from a team January 27, 2025 09:21
@bgrgicak bgrgicak self-assigned this Jan 27, 2025
@bgrgicak bgrgicak mentioned this pull request Jan 27, 2025
6 tasks

@wojtekn wojtekn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, works as expected.

Comment thread vendor/wp-now/src/download.ts Outdated
Co-authored-by: Wojtek Naruniec <wojtek.naruniec@automattic.com>
@bgrgicak
bgrgicak merged commit 13b522e into trunk Jan 29, 2025
@bgrgicak
bgrgicak deleted the update/move-mu-plugin-ployfills-to-internals branch January 29, 2025 06:02
bgrgicak added a commit that referenced this pull request Jan 29, 2025
* Mount mu-plugin polyfills to the Playground filesystem

* Update vendor/wp-now/src/download.ts

Co-authored-by: Wojtek Naruniec <wojtek.naruniec@automattic.com>

---------

Co-authored-by: Wojtek Naruniec <wojtek.naruniec@automattic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants