Skip to content

Support multiple workers for NODEFS /wordpress mounts #2231

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

Merged
merged 230 commits into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
fc589cb
Begin shared/writer file locking implementation
brandonpayton Mar 7, 2025
edf4ed9
Implement F_SETLK using cross-platform flock()
brandonpayton Mar 10, 2025
203b1ec
Call builtin fcntl implementation from php_wasm.c
brandonpayton Mar 13, 2025
968aaaa
Simplify async syscall
brandonpayton Mar 14, 2025
8601c32
Remove unnecessary stdarg.h include
brandonpayton Mar 14, 2025
071115b
[Website] return true selectSitesLoaded() only when a site is active
adamziel Mar 12, 2025
5088480
Fix changelog workflow and backfill changelog entries from recent ver…
brandonpayton Mar 18, 2025
d00072a
Support quickly testing php-wasm CLI changes with bun (#85)
brandonpayton Mar 18, 2025
87238a3
WIP: Stub a FileLockManager that will later be shared among workers
brandonpayton Mar 19, 2025
e00e617
Fix system call varargs reading
brandonpayton Mar 20, 2025
f485a8a
Avoid type error with default switch case
brandonpayton Mar 20, 2025
1288e81
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Mar 25, 2025
feff197
Move comlink API helpers from php-wasm web to universal
brandonpayton Mar 26, 2025
72bb46c
Fix comlink API helpers to work for both node and web
brandonpayton Mar 27, 2025
1de9f84
Fix php-wasm/web exports of comlink API helpers
brandonpayton Mar 27, 2025
2448d15
Move to PHP worker thread
brandonpayton Mar 27, 2025
24c9112
Remove unused import
brandonpayton Mar 27, 2025
7fc9c9f
Adjust consumeAPI signature to support exposing API from parent to wo…
brandonpayton Mar 27, 2025
334a6c5
Make file lock manager node-specific for now
brandonpayton Mar 27, 2025
1d9f94a
Bump comlink dep to try to resolve apparent listener leak
brandonpayton Mar 27, 2025
ad26310
Allow exposing API to specific endpoint
brandonpayton Mar 27, 2025
13b040a
Stop exporting non-existing types from php-wasm/universal
brandonpayton Mar 27, 2025
0daddcc
Include package-lock.json from comlink upgrade
brandonpayton Mar 27, 2025
38f4455
Expose file lock manager to worker
brandonpayton Mar 27, 2025
f4e6f18
Hack together a boot method for secondary workers
brandonpayton Mar 27, 2025
9319e9b
Load balance requests between multiple workers
brandonpayton Mar 27, 2025
6a3d9cf
Add note about broken secondary worker request routing
brandonpayton Mar 27, 2025
d1e82d2
Remove import of nonexistent type
brandonpayton Mar 28, 2025
433bcc3
Remove some cruft and a pointless comment
brandonpayton Mar 28, 2025
80ebb33
Add a couple of notes
brandonpayton Mar 28, 2025
7965bbb
Respect bootWordPress() dataSqlPath option
brandonpayton Mar 28, 2025
efe764b
Fix secondary worker setup
brandonpayton Mar 28, 2025
1292042
Isolate emscripten constant replacement to allow editor syntax checking
brandonpayton Mar 31, 2025
e6913a0
Explicitly throw not-implemented error on F_SETLKW
brandonpayton Apr 1, 2025
3ca558d
Support upgrade/downgrading locks owned by same pid
brandonpayton Apr 1, 2025
3809809
Read/write full flock struct
brandonpayton Apr 2, 2025
114884c
Support resolving address for flock struct whence field
brandonpayton Apr 3, 2025
61541c9
Implement file byte range locking
brandonpayton Apr 4, 2025
6b200b8
Add TODO about locks and fd access mode
brandonpayton Apr 4, 2025
c40e8e8
Debug: Log what request a worker is selected for
brandonpayton Apr 4, 2025
6dc495e
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Apr 7, 2025
4969242
Fix openssl library paths in php-wasm build
brandonpayton Apr 7, 2025
9065ac3
Add TODO about sharing same constants
brandonpayton Apr 8, 2025
9f73091
Update PHP 8.3 build for testing
brandonpayton Apr 8, 2025
3ed7a4b
Add note about merging worker management with PHPProcessManager
brandonpayton Apr 16, 2025
126e176
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Apr 17, 2025
e65f362
Fix some lint errors
brandonpayton Apr 17, 2025
6a458fe
WIP: Mirror /internal directory in secondary workers
brandonpayton Apr 17, 2025
839d73f
Mark worker_threads as external for Vite build
brandonpayton Apr 18, 2025
bda5510
Fix incorrect import of with-networking.js
brandonpayton Apr 18, 2025
52283a4
Stop requiring Playground CLI to manually use comlink import
brandonpayton Apr 18, 2025
2169320
Mark Node.js url module as Vite external
brandonpayton Apr 18, 2025
d09b92b
Finish renaming to more generic FileLockManager
brandonpayton Apr 18, 2025
aebdbd2
Stop forcing bundler moduleResolution on entire project
brandonpayton Apr 18, 2025
6e26825
Fix nested comlink import from unbuilt TS
brandonpayton Apr 21, 2025
cddf59e
Avoid caching VFS nodes for NODEFS
brandonpayton Apr 21, 2025
2a67f77
Fix crash related to F_GETLK debug statement
brandonpayton Apr 21, 2025
4a4e2c7
Add launch.json entry for attaching to existing Playground CLI
brandonpayton Apr 21, 2025
47dd7aa
Fix worker boot issue
brandonpayton Apr 21, 2025
2fa91a7
Remove unused import
brandonpayton Apr 21, 2025
0df08cc
Adjustments for worker URL resolution and debugging
brandonpayton Apr 21, 2025
826b5d3
Update PHP 8.3 build
brandonpayton Apr 21, 2025
ccab4e7
Improve readability and info for file locking logging
brandonpayton Apr 21, 2025
f14b8a7
Fix worker URL for both dev and production
brandonpayton Apr 22, 2025
822e906
Back out unnecessary tsconfig changes
brandonpayton Apr 22, 2025
34b9bbf
Revert unintentional change
brandonpayton Apr 22, 2025
3ea3d2e
Override hashAddNode without copying original implementation
brandonpayton Apr 23, 2025
79db9f8
Separate processId from runtimeId
brandonpayton Apr 23, 2025
b9b4ceb
Release file locks when a PHP request is shutdown
brandonpayton Apr 23, 2025
1188738
Replace flock() with an async stub
brandonpayton Apr 24, 2025
f5a0557
Implement local flock() support
brandonpayton Apr 25, 2025
64342fe
Note that we can only lock NODEFS paths and add TODO
brandonpayton Apr 29, 2025
2df81fb
Address more TODOs and add more error handling
brandonpayton Apr 30, 2025
b2fd96f
Adjust file lock manager API to be sync
brandonpayton Apr 30, 2025
b77b264
Lock with respect to file descriptors and unlock on fd_close
brandonpayton Apr 30, 2025
8274390
Remove unused override from esm-suffix.js
brandonpayton May 1, 2025
77c5ec5
Multiple changes listed in commit message body
brandonpayton May 1, 2025
e95af95
Make logging show mem addrs as hex
brandonpayton May 1, 2025
a0decdd
Add temp timestamps to logging for troubleshooting
brandonpayton May 3, 2025
875a0d9
WIP: Native flock support
brandonpayton May 5, 2025
b37ef9f
Add fx-ext types
brandonpayton May 18, 2025
26ce568
WIP cleanup
brandonpayton May 18, 2025
21ce6d1
WIP test updates
brandonpayton May 18, 2025
a435e48
Continue cleanup and fixes
brandonpayton May 18, 2025
060186e
Merge byte-range lock/unlock methods
brandonpayton May 18, 2025
9bf76b0
Fix BitInt zero comparison
brandonpayton May 18, 2025
ee10918
Update PHP version used for test
brandonpayton May 18, 2025
42bf085
Add TODO for F_GETLK bug
brandonpayton May 19, 2025
427f645
Fix range unlock to be able to split existing locked range.
brandonpayton May 19, 2025
fd4beda
Fix bug that led to zero-width locked ranges
brandonpayton May 20, 2025
a6a9e82
Move move to whole-file unlocked once all shared locks are gone
brandonpayton May 20, 2025
566f497
Fix tests
brandonpayton May 20, 2025
f9d0efc
Fix treatment of special zero-length ranges
brandonpayton May 20, 2025
b78955a
Fix no-unlock-error test
brandonpayton May 20, 2025
127d40e
Add naming TODO
brandonpayton May 20, 2025
e79de39
Recognize whole file locks in findFirstConflictingLock
brandonpayton May 20, 2025
3a547be
Make sure file is closed before releasing locks on close
brandonpayton May 21, 2025
4d85c78
Actually apply NODEFS caching workaround
brandonpayton May 21, 2025
dbc822c
Temporary logging
brandonpayton May 23, 2025
cba4ee8
Fix fcntl syscall to use asyncify
brandonpayton May 24, 2025
edc46eb
Fix NODEFS file lookups and locking by native path
brandonpayton May 28, 2025
5f8b7be
Fix how errno is relayed by __syscall_fcntl64
brandonpayton May 28, 2025
3e04008
Test native whole-file locking
brandonpayton May 29, 2025
517b2d1
Fix native lock creation to hold onto native fd
brandonpayton May 29, 2025
62f1866
Add temporary logging of request routing to workers
brandonpayton May 29, 2025
785a884
Mark PHPLoaderOptions.fileLockManager as a RemoteAPI
brandonpayton May 29, 2025
2134497
Merge branch 'trunk' into add-fcntl-for-nodejs (from private trunk)
brandonpayton Jun 4, 2025
c16ae62
Avoid duplicated boot logging
brandonpayton Jun 4, 2025
24b5b5c
Add workaround for missing wp-config while booting additional CLI wor…
brandonpayton Jun 4, 2025
2d60a70
Allow __dirname and __filename refs in unbuilt modules
brandonpayton Jun 4, 2025
c6c65e1
Update sqlite asyncify functions and remove other duplicates
brandonpayton Jun 5, 2025
bec0b6e
Fix post-merge issues
brandonpayton Jun 5, 2025
31eb0ba
Add more asyncify functions for sqlite
brandonpayton Jun 5, 2025
38dc446
More sqlite functions for asyncify
brandonpayton Jun 5, 2025
29fa83c
WIP
brandonpayton Jun 6, 2025
c04e108
Comment out redundant function names in php_wasm.c
brandonpayton Jun 7, 2025
2998294
Sufficient asyncify functions to run fcntl
adamziel Jun 7, 2025
17594ba
Add more functions to ASYNCIFY list after re-enabling default PHP ext…
brandonpayton Jun 9, 2025
142bd22
Re-enable lock releases on fd_close
brandonpayton Jun 9, 2025
5a08ceb
Revert: Re-enable lock releases on fd_close
brandonpayton Jun 10, 2025
2d45021
Resume using actual lock manager
brandonpayton Jun 10, 2025
2b7ba6f
Resume use of js_release_file_locks
brandonpayton Jun 10, 2025
b4280a8
Re-enable fd_close
brandonpayton Jun 10, 2025
2452009
Add temp workaround to avoid WP install in additional workers
brandonpayton Jun 10, 2025
e9ce309
Exploratory changes for restoring JSPI functionality
brandonpayton Jun 10, 2025
626550a
Adjust fcntl library for JSPI
brandonpayton Jun 11, 2025
780d1b0
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Jun 11, 2025
2e380ec
Some cleanup for Dockerfile and esm suffix
brandonpayton Jun 11, 2025
1e2b4af
Fix flock() for non-NodeFS files
brandonpayton Jun 11, 2025
6280c4c
Restore fd_close() override
brandonpayton Jun 11, 2025
5275760
Remote WP install workaround during boot
brandonpayton Jun 11, 2025
3296f62
Move LoadBalancer to dedicated file
brandonpayton Jun 11, 2025
0992a68
Clarify comment about merging load-balancer with PHPProcessManager
brandonpayton Jun 11, 2025
8135767
Put multi-worker support behind --experimentalMultiWorker flag
brandonpayton Jun 11, 2025
1d35a22
Add --experimentalMultiWorker TODO
brandonpayton Jun 11, 2025
e089d83
Remove unused constants declaration
brandonpayton Jun 11, 2025
c7736a9
Leave flock override disabled until further fix
brandonpayton Jun 11, 2025
e078e55
Restore actual locking
brandonpayton Jun 11, 2025
7a7c5ed
Address some lock manager types and TODOs
brandonpayton Jun 11, 2025
4f68496
Remove some unused imports and types
brandonpayton Jun 11, 2025
2b17e69
Fix tests from specifying now-unused property. Add unrelated TODO.
brandonpayton Jun 11, 2025
7761fe7
Use max 64-bit address when byte-range lock length is zero
brandonpayton Jun 11, 2025
eedd825
Stop unnecessarily passing fd for byte range locking
brandonpayton Jun 11, 2025
d2aa4cf
Add more docs and address TODOs
brandonpayton Jun 12, 2025
7d25ca3
Address more TODOs
brandonpayton Jun 12, 2025
0305fde
Address more TODOs for Node.js lock manager
brandonpayton Jun 12, 2025
ed4f495
Try to improve readability of file-lock-manager-for-node module
brandonpayton Jun 12, 2025
42bb243
Allow specifying num workers via experimentalMultiWorker
brandonpayton Jun 12, 2025
1c45f34
Update some TODOs
brandonpayton Jun 12, 2025
a4847ab
Fix flock to return zero instead of boolean true
brandonpayton Jun 13, 2025
7a4278e
Use more consistent naming convention
brandonpayton Jun 13, 2025
637304b
Remove file op tracing used for debugging
brandonpayton Jun 13, 2025
a61787d
Remove debug logging from load balancer
brandonpayton Jun 13, 2025
59f0bfc
Clarify name of new Emscripten library
brandonpayton Jun 13, 2025
b65849b
Move toward making tracing optional
brandonpayton Jun 16, 2025
6b28b63
Only call js_release_file_locks() in php-wasm/node builds
brandonpayton Jun 16, 2025
9619bed
Clarify some naming and trace messages
brandonpayton Jun 16, 2025
1db53fc
Clarify more names
brandonpayton Jun 16, 2025
5056fb6
Add more docs and address TODOs
brandonpayton Jun 16, 2025
4d5f22a
Make tracing optional
brandonpayton Jun 16, 2025
6f25be8
More docs and TODOs
brandonpayton Jun 16, 2025
6c5804c
Some run-cli cleanup and TODOs
brandonpayton Jun 17, 2025
9f8fe5d
Add minor doc TODOs
brandonpayton Jun 17, 2025
194015d
Minor clarification
brandonpayton Jun 17, 2025
013375a
Remove console logging from file-lock-manager-for-node
brandonpayton Jun 17, 2025
4d4a812
Address remaining TODOs in run-cli
brandonpayton Jun 17, 2025
019ab9c
Fix variable-width trace timestamp
brandonpayton Jun 17, 2025
d9087d9
Address TODO and lint error
brandonpayton Jun 17, 2025
d14673e
Address more lint errors
brandonpayton Jun 17, 2025
2401ae8
Finish fixing lint errors
brandonpayton Jun 17, 2025
06ace3b
Remove logger dependency from PHP instance module
brandonpayton Jun 18, 2025
607cb31
Temporarily disable run-cli tests due to conflicts with Worker
brandonpayton Jun 18, 2025
2d81ecf
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Jun 18, 2025
e470c40
Fix php_wasm.c compilation bug due to late extern declaration
brandonpayton Jun 19, 2025
cbe70b4
Update php-wasm/node builds
brandonpayton Jun 19, 2025
2dcad60
Remove troubleshooting code that was committed by accident
brandonpayton Jun 19, 2025
86695ca
Fix type error
brandonpayton Jun 19, 2025
7a800c0
Address type errors in cli-run tests
brandonpayton Jun 19, 2025
255a96e
Update php-wasm-node build to be able to deal with native Node modules
brandonpayton Jun 19, 2025
11fc6f6
Restore worker URL approach that worked for dev and prod builds
brandonpayton Jun 19, 2025
04c79db
Clarify name of test worker
brandonpayton Jun 19, 2025
8b8620f
Address esm-suffix TODOs
brandonpayton Jun 19, 2025
7264edb
Wrap long comment
brandonpayton Jun 19, 2025
ad2ab97
Always use plain Docker output when building php-wasm
brandonpayton Jun 19, 2025
e52b4c3
Em library cleanup
brandonpayton Jun 19, 2025
40bd596
Only define lock-related C functions when locking is enabled for the …
brandonpayton Jun 19, 2025
c57bb9b
Fix js_getpid() to return default value when no pid provided to php-wasm
brandonpayton Jun 19, 2025
a309444
Add inline comment for js_wasm_trace()
brandonpayton Jun 19, 2025
27b9a2a
Remove Playground CLI attach target that is little used and not 100% …
brandonpayton Jun 19, 2025
37526b1
Address php-wasm Dockerfile TODO
brandonpayton Jun 19, 2025
846574c
Revert path resolution regression in Dockerfile
brandonpayton Jun 19, 2025
3b76c6c
Add trailing space
brandonpayton Jun 19, 2025
425f597
Document changes to load-runtime
brandonpayton Jun 19, 2025
7ef15d0
Remove unimportant TODO
brandonpayton Jun 19, 2025
ae61316
Revert debug changes to Playground CLI project.json
brandonpayton Jun 19, 2025
e806a2d
Remove CLI TODOs
brandonpayton Jun 19, 2025
15f04bd
Temporarily skip the cli-run tests
brandonpayton Jun 19, 2025
646d7d2
Remove unnecessary changes to load-php-runtime
brandonpayton Jun 19, 2025
2ca09e9
Rename ambiguous new var in api.ts
brandonpayton Jun 19, 2025
c227163
Fix FS node lookup bug caused by cleanup
brandonpayton Jun 19, 2025
21e6aa3
Remove some cruft from worker-thread
brandonpayton Jun 19, 2025
009057a
Disable fcntl and flock overrides for aysncify until we fully support it
brandonpayton Jun 20, 2025
cc3f2cc
Refresh JSPI builds after Dockerfile updates today
brandonpayton Jun 20, 2025
b7e2054
Fix locking-related conditional in hashAddNode
brandonpayton Jun 20, 2025
d98a8c6
Rebuild php-wasm after esm-suffix fix
brandonpayton Jun 20, 2025
eec72b4
Fix docs link
brandonpayton Jun 20, 2025
210ed66
Address native dependency mismatch
brandonpayton Jun 20, 2025
0610f7c
Attempt to fix the test-built-npm-packages error
brandonpayton Jun 20, 2025
78175d6
Fix the fix to test-built-npm-packages
brandonpayton Jun 20, 2025
6fac4ca
Fix prepare-playground to include Node.js version in cached-modules key
brandonpayton Jun 20, 2025
255c314
Try forcing dependency reinstall for test-built-npm-packages
brandonpayton Jun 20, 2025
86f7ab3
Revert "Try forcing dependency reinstall for test-built-npm-packages"
brandonpayton Jun 20, 2025
6bb8744
Switch from fs-ext to os-lock library for Bun compatibility
brandonpayton Jun 20, 2025
12dc402
Revert "Switch from fs-ext to os-lock library for Bun compatibility"
brandonpayton Jun 20, 2025
1f61e62
Fix undefined obj in tracing
brandonpayton Jun 20, 2025
5dc537a
Avoid Bun-specific issues in test-built-npm-packages
brandonpayton Jun 21, 2025
90a0e91
Fix missing nvm in CI step
brandonpayton Jun 21, 2025
a7514d8
Adjust test-built-npm-packages test for changed RunCLIServer interface
brandonpayton Jun 21, 2025
dabf3da
Make PHPWorker asyncDisposable and use in testing built npm packages
brandonpayton Jun 21, 2025
5214b63
Fix remote Playground disposal
brandonpayton Jun 21, 2025
666c2c8
Fix let-should-be-const lint error
brandonpayton Jun 21, 2025
a4a116d
Avoid undefined-null-to-object error in PHP.exit
brandonpayton Jun 21, 2025
d8a75c3
Terminate all workers when CLI disposed
brandonpayton Jun 21, 2025
8d515dc
Fix test-built-npm-packages tests
brandonpayton Jun 21, 2025
e948fd1
Only log resolved WP release if downloading WP
brandonpayton Jun 22, 2025
a886826
Test unbuilt multi-worker
brandonpayton Jun 22, 2025
04fd547
Skip the sqlite-asyncify tests until we solve unexpected GH Actions t…
brandonpayton Jun 22, 2025
26dc841
Fix Node version check in unbuilt-jspi target
brandonpayton Jun 22, 2025
f51eb69
Restore package install in unbuilt CLI test
brandonpayton Jun 22, 2025
463f820
Merge branch 'trunk' into add-fcntl-for-nodejs
brandonpayton Jun 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/prepare-playground/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
with:
# caching node_modules
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
Expand Down
48 changes: 31 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,36 @@ jobs:
fail-fast: false
matrix:
include:
- name: test-unit-asyncify (1/14)
- name: test-unit-asyncify (1/15)
target: test
- name: test-unit-asyncify (2/14)
- name: test-unit-asyncify (2/15)
target: test-php
- name: test-unit-asyncify (3/14)
- name: test-unit-asyncify (3/15)
target: test-php-request-handler-files
- name: test-unit-asyncify (4/14)
- name: test-unit-asyncify (4/15)
target: test-php-request-handler-requests
- name: test-unit-asyncify (5/14)
- name: test-unit-asyncify (5/15)
target: test-php-asyncify-file-get-contents-http
- name: test-unit-asyncify (6/14)
- name: test-unit-asyncify (6/15)
target: test-php-asyncify-file-get-contents-https
- name: test-unit-asyncify (7/14)
- name: test-unit-asyncify (7/15)
target: test-php-asyncify-fopen-http
- name: test-unit-asyncify (8/14)
- name: test-unit-asyncify (8/15)
target: test-php-asyncify-fopen-https
- name: test-unit-asyncify (9/14)
- name: test-unit-asyncify (9/15)
target: test-php-asyncify-fsockopen-http
- name: test-unit-asyncify (10/14)
- name: test-unit-asyncify (10/15)
target: test-php-asyncify-fsockopen-https
- name: test-unit-asyncify (11/14)
- name: test-unit-asyncify (11/15)
target: test-php-asyncify-gethostbyname-http
- name: test-unit-asyncify (12/14)
- name: test-unit-asyncify (12/15)
target: test-php-asyncify-gethostbyname-https
- name: test-unit-asyncify (13/14)
- name: test-unit-asyncify (13/15)
target: test-php-asyncify-mysqli-http
- name: test-unit-asyncify (14/14)
- name: test-unit-asyncify (14/15)
target: test-php-asyncify-mysqli-https
- name: test-unit-sqlite3 (15/15)
target: test-php-asyncify-sqlite3
name: ${{ matrix.name }}
services:
mysql:
Expand Down Expand Up @@ -189,6 +191,8 @@ jobs:
with:
submodules: true
- uses: ./.github/actions/prepare-playground
with:
node-version: 22
- name: Generate a mock version number (for releasing the packages in a local registry) and store it as a global variable
run: |
VERSION=$(date +%s)
Expand All @@ -209,10 +213,20 @@ jobs:
- name: Package repository
run: |
npx nx run-many --all --target=package-for-self-hosting -- --hostingBaseUrl="$PACKAGE_BASE_URL"
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Start a local node package registry server
run: RUNNER_TRACKING_ID="" && (nohup bun ./packages/playground/cli/src/cli.ts server --port=$PORT --mount="$HOST_PATH:/wordpress/$VERSION" --quiet&)
run: |
source ~/.nvm/nvm.sh;
nvm install 22;
RUNNER_TRACKING_ID="" && ( \
nohup node \
--experimental-strip-types \
--experimental-transform-types \
--import ./packages/meta/src/node-es-module-loader/register.mts \
./packages/playground/cli/src/cli.ts server \
--port=$PORT \
--mount="$HOST_PATH:/wordpress/$VERSION" \
--quiet& \
)
- name: Wait for the package server to be ready
run: |
for i in {1..60}; do
Expand Down
19 changes: 9 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v1.0.38] (2025-05-22)
## [v1.0.38] (2025-05-22)

### Various

- Revert "[ php-wasm ] add Intl support (#150)". ([#154](https://github.com/Automattic/wordpress-playground-private/pull/154))
- Use the new SQLite driver. ([#144](https://github.com/Automattic/wordpress-playground-private/pull/144))
- [ php-wasm ] Add intl support. ([#155](https://github.com/Automattic/wordpress-playground-private/pull/155))
- [ php-wasm ] Intl : Improve integration. ([#159](https://github.com/Automattic/wordpress-playground-private/pull/159))
- [ php-wasm ] add Intl support. ([#150](https://github.com/Automattic/wordpress-playground-private/pull/150))
- [CLI] Enable users to automatically mount their current working directory into Playground. ([#39](https://github.com/Automattic/wordpress-playground-private/pull/39))
- [PHP-wasm Node] Fix Identifier '__filename' has already been declared. ([#143](https://github.com/Automattic/wordpress-playground-private/pull/143))
- [Website] Support data URLs in blueprint-url query parameter. ([#158](https://github.com/Automattic/wordpress-playground-private/pull/158))
- Revert "[ php-wasm ] add Intl support (#150)". ([#154](https://github.com/Automattic/wordpress-playground-private/pull/154))
- Use the new SQLite driver. ([#144](https://github.com/Automattic/wordpress-playground-private/pull/144))
- [ php-wasm ] Add intl support. ([#155](https://github.com/Automattic/wordpress-playground-private/pull/155))
- [ php-wasm ] Intl : Improve integration. ([#159](https://github.com/Automattic/wordpress-playground-private/pull/159))
- [ php-wasm ] add Intl support. ([#150](https://github.com/Automattic/wordpress-playground-private/pull/150))
- [CLI] Enable users to automatically mount their current working directory into Playground. ([#39](https://github.com/Automattic/wordpress-playground-private/pull/39))
- [PHP-wasm Node] Fix Identifier '\_\_filename' has already been declared. ([#143](https://github.com/Automattic/wordpress-playground-private/pull/143))
- [Website] Support data URLs in blueprint-url query parameter. ([#158](https://github.com/Automattic/wordpress-playground-private/pull/158))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @JanJakes @mho22


## [v1.0.37] (2025-05-15)

### Various
Expand Down
32 changes: 31 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@
"ajv": "8.12.0",
"async-lock": "1.4.1",
"classnames": "^2.3.2",
"comlink": "^4.4.1",
"comlink": "^4.4.2",
"crc-32": "1.2.2",
"diff3": "0.0.4",
"express": "4.21.2",
"file-saver": "^2.0.5",
"fs-ext": "2.1.1",
"fs-extra": "11.1.1",
"ini": "4.1.2",
"octokit": "3.1.2",
Expand Down Expand Up @@ -109,6 +110,7 @@
"@playwright/test": "1.47.1",
"@types/ajv": "1.0.0",
"@types/file-saver": "^2.0.5",
"@types/fs-ext": "2.0.3",
"@types/fs-extra": "11.0.4",
"@types/ini": "4.1.0",
"@types/jest": "29.5.14",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ try {
initialSyncDirection: hasWordPressSiteInOPFS ? 'opfs-to-memfs' : 'memfs-to-opfs',
};

const client = await startPlaygroundWeb( {
const client = await startPlaygroundWeb({
iframe: document.getElementById('wp'),
remoteUrl: 'https://playground.wordpress.net/remote.html',
blueprint: blueprint,
shouldInstallWordPress: ! hasWordPressSiteInOPFS,
mounts: hasWordPressSiteInOPFS ? [ mountDescriptor ] : [],
} );
shouldInstallWordPress: !hasWordPressSiteInOPFS,
mounts: hasWordPressSiteInOPFS ? [mountDescriptor] : [],
});

if ( ! hasWordPressSiteInOPFS ) {
await client.mountOpfs( mountDescriptor );
if (!hasWordPressSiteInOPFS) {
await client.mountOpfs(mountDescriptor);
}

await client.isReady();
return client;
} catch ( error ) {
} catch (error) {
// handle error here
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ await phpClient.run({ code: `<?php echo "Hello from the thread!";` });

Exchanging messages is the only way to control web workers. The main application has no access to functions or variables inside of a web worker. It can only send and receive messages using `worker.postMessage` and `worker.onmessage = function(msg) { }`.

This can be tedious, which is why Playground provides a convenient [consumeAPI](/api/web/function/consumeAPI) function that abstracts the message exchange and exposes specific functions from the web worker. This is why we can call `phpClient.run` in the example above.
This can be tedious, which is why Playground provides a convenient [consumeAPI](/api/universal/function/consumeAPI) function that abstracts the message exchange and exposes specific functions from the web worker. This is why we can call `phpClient.run` in the example above.
19 changes: 9 additions & 10 deletions packages/docs/site/docs/main/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v1.0.38] (2025-05-22)
## [v1.0.38] (2025-05-22)

### Various

- Revert "[ php-wasm ] add Intl support (#150)". ([#154](https://github.com/Automattic/wordpress-playground-private/pull/154))
- Use the new SQLite driver. ([#144](https://github.com/Automattic/wordpress-playground-private/pull/144))
- [ php-wasm ] Add intl support. ([#155](https://github.com/Automattic/wordpress-playground-private/pull/155))
- [ php-wasm ] Intl : Improve integration. ([#159](https://github.com/Automattic/wordpress-playground-private/pull/159))
- [ php-wasm ] add Intl support. ([#150](https://github.com/Automattic/wordpress-playground-private/pull/150))
- [CLI] Enable users to automatically mount their current working directory into Playground. ([#39](https://github.com/Automattic/wordpress-playground-private/pull/39))
- [PHP-wasm Node] Fix Identifier '__filename' has already been declared. ([#143](https://github.com/Automattic/wordpress-playground-private/pull/143))
- [Website] Support data URLs in blueprint-url query parameter. ([#158](https://github.com/Automattic/wordpress-playground-private/pull/158))
- Revert "[ php-wasm ] add Intl support (#150)". ([#154](https://github.com/Automattic/wordpress-playground-private/pull/154))
- Use the new SQLite driver. ([#144](https://github.com/Automattic/wordpress-playground-private/pull/144))
- [ php-wasm ] Add intl support. ([#155](https://github.com/Automattic/wordpress-playground-private/pull/155))
- [ php-wasm ] Intl : Improve integration. ([#159](https://github.com/Automattic/wordpress-playground-private/pull/159))
- [ php-wasm ] add Intl support. ([#150](https://github.com/Automattic/wordpress-playground-private/pull/150))
- [CLI] Enable users to automatically mount their current working directory into Playground. ([#39](https://github.com/Automattic/wordpress-playground-private/pull/39))
- [PHP-wasm Node] Fix Identifier '\_\_filename' has already been declared. ([#143](https://github.com/Automattic/wordpress-playground-private/pull/143))
- [Website] Support data URLs in blueprint-url query parameter. ([#158](https://github.com/Automattic/wordpress-playground-private/pull/158))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @JanJakes @mho22


## [v1.0.37] (2025-05-15)

### Various
Expand Down
Loading