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

Explore creating pure PHP dev server for Playground #1294

Open
brandonpayton opened this issue Apr 23, 2024 · 2 comments
Open

Explore creating pure PHP dev server for Playground #1294

brandonpayton opened this issue Apr 23, 2024 · 2 comments
Labels
[Focus] Developer Tools [Type] Developer Experience [Type] Enhancement New feature or request [Type] Exploration An exploration that may or may not result in mergable code

Comments

@brandonpayton
Copy link
Member

In #1197, we ported existing htaccess rules to PHP in order to serve from an nginx-based host where we do not actual control nginx config. (In that case, all files are served via PHP, and edge caching is enabled so that PHP only needs to run when the cache is being primed.)

This work led to an idea by @adamziel that maybe we could leverage a similar approach to provide a standalone dev server for Playground or within Playground.

@bgrgicak
Copy link
Collaborator

In case it helps, I like to use this Docker command to start a local dev server. This won't load Playground, but it will load pages like the PR preview and allow you to test PHP scripts (proxy, logger).

I assume that we could get everything running, by mounting the correct public folders.

docker run -d -p 8787:80 -v "$PWD/packages/playground/website/public":/var/www/html php:8.0-apache

@adamziel
Copy link
Collaborator

A local dev server still needs a JS bundler to bundle all the JS code, and with Vite we need to use its dev server.

What I had in mind was taking the build and bundled output, so the same set of files as we'd deploy on playground.wordpress.net, and serving that using the CLI Playground. The PHP server package could help us with that.

At first, it would be just a cool gimmick – you can run the in-browser Playground locally without a million node packages. Then it could potentially make it easy to host Playground on most PHP hostings. Then, we could bundle that server as a single executable and you no longer need node to work with Playground locally. Finally, and I'm not sure what's the application of that, but we could explore running the same PHP code on the server and in the browser as in we'd have an isomorphic PHP app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Developer Tools [Type] Developer Experience [Type] Enhancement New feature or request [Type] Exploration An exploration that may or may not result in mergable code
Projects
None yet
Development

No branches or pull requests

3 participants