Repository navigation
[Demo] Run the demo application in the browser with PHP WebAssembly - #420
Merged
Merged
Conversation
The test application runs on SQLite since Sylius#417: with lyrixx/php-wasm-builder, PHP compiled to WebAssembly runs it in a service worker, so the demo can be served by GitHub Pages, with no PHP server. - wasm-demo/castor.php prepares the application (fixtures in a SQLite database, no dev dependencies, compiled assets and local icons) and builds PHP with it, with ShadcnAdminUi and the rose theme by default. - wasm-demo/check.mjs logs in and checks every page of the admin panel in PHP WebAssembly, in node. - The Demo workflow builds, checks and deploys it to GitHub Pages.
…rs under the base path - The home page of the test application rendered an empty template: it now redirects to the dashboard, as anyone opening the demo expects. - vich_uploader_asset() gives /avatars/speakers/..., without the base path of the demo: on GitHub Pages, it is under /<repository>/. The build gives the base path to the uri_prefix of the mapping. - demo:check checks the redirection.
As on demo.sylius.com: an info alert, after the header of the login page, with a hookable and its priority. Only with ShadcnAdminUi, whose components it uses.
loic425
force-pushed
the
demo/php-wasm
branch
from
November 25, 2026 08:36
15d1571 to
da96883
Compare
loic425
added a commit
that referenced
this pull request
Nov 25, 2026
The Demo workflow added in #420 builds and checks the demo on `main`, then fails at the last step: `deploy-pages` reports "Found 0 artifact(s)" right after `upload-pages-artifact` uploaded `github-pages` (see [this run](https://github.com/Sylius/Stack/actions/runs/45588385862)). So https://sylius.github.io/Stack/ is still not published. The build exposes the runtime token of GitHub Actions to all its following steps (`crazy-max/ghaction-github-runtime`, needed for the buildx cache), and `deploy-pages` lists the artifacts with that token in the same job. → The workflow is split into a `build` job and a `deploy` job (`needs: build`) that only runs `deploy-pages`, as in GitHub's Pages starter workflow, with a clean environment. Tried on my fork: [both jobs pass](https://github.com/loic425/SyliusStack/actions/runs/45589224361). The fork already deployed with one job, though, so the proof for this repository is the first run on `main` after the merge. **BC**: none, only the Demo workflow changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying the Stack today means cloning the monorepo and running a database and a PHP server. Since #417 the test application runs on SQLite, so PHP compiled to WebAssembly (lyrixx/php-wasm-builder) can run it in a service worker: the demo becomes a static site on GitHub Pages, with no PHP server.
Live on my fork: https://loic425.github.io/SyliusStack/ (
admin@example.com/admin)wasm-demo/castor.phpbuilds the application in prod without dev dependencies, with the fixtures in a SQLite database and ShadcnAdminUi with the rose theme (--uiand--themechange them). Data lives in the browser (IndexedDB) and is reset at each deploy./Stack/).castor demo:checklogs in and follows every link of the admin panel in PHP WebAssembly under node (61 pages). The workflow only deploys when it passes./now redirects to the dashboard, for the dev application too.The login page also shows the test credentials, as on demo.sylius.com.
Before merging: a maintainer needs to set Settings › Pages › Source to "GitHub Actions". The demo is then deployed on each push to
mainat https://sylius.github.io/Stack/ (~10 min the first time, ~4 min with the cache).BC: none, only the
/route of the test application changes; the packages are untouched.