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 Bun bundling playground server #1297

Draft
wants to merge 38 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
950d3ee
Try: PHPPool with just acquire(), release(), and grow() mechanics. Sp…
adamziel Apr 20, 2024
68fc634
Self-request prototype
adamziel Apr 20, 2024
b1ea077
Remvoe WebPHPEndpoint methods that wouldn't work anyway
adamziel Apr 21, 2024
01e095f
Replace PHPPool with PHPProcessManager
adamziel Apr 21, 2024
ead4e03
Adjust TypeScript types
adamziel Apr 21, 2024
1212345
Restore the serverOptions argument for PHP
adamziel Apr 21, 2024
648c3ed
EmscriptenDownloadMonitor: Restore the original WebAssembly.instantia…
adamziel Apr 21, 2024
713e030
Clean up PHPRequestHandler
adamziel Apr 21, 2024
038f2a1
Clean up worker-thread-utils
adamziel Apr 21, 2024
acbe5ce
Restore the original rotate-php-runtime.spec.ts
adamziel Apr 21, 2024
a07c05d
Only download the .wasm file once and then reuse the response on subs…
adamziel Apr 21, 2024
12b6730
Document setting the "url" property
adamziel Apr 21, 2024
3f9cbf4
Compose fetch middlewares
adamziel Apr 21, 2024
d56f881
Document why we need primary PHP and replicas instead of giving all P…
adamziel Apr 21, 2024
bbe673c
Move 502 error handling to WebPHPEndpoint for now
adamziel Apr 21, 2024
edbd99f
createCachedFetch: Write to cache synchronously to avoid duplicate re…
adamziel Apr 21, 2024
764c55e
Document memoizedFetch(), reorder functions in worker-utils.ts
adamziel Apr 21, 2024
ce117f2
Spawn new PHP instances for handling requests in PHPRequestHandler
adamziel Apr 22, 2024
ebc18fe
Resolve type errors
adamziel Apr 22, 2024
f299fb3
Remove php.request() calls from unit tests
adamziel Apr 22, 2024
87a1326
Adjust unit tests
adamziel Apr 22, 2024
6271d2b
Actually use PHPProcessManager constructor args :)
adamziel Apr 22, 2024
82eff10
Remove PHPBrowser class, manage cookies in PHPRequestHandler
adamziel Apr 22, 2024
9ab8a04
Fix typo
adamziel Apr 22, 2024
af8cd9d
Fix type errors
adamziel Apr 22, 2024
c63bbcb
Null check in rememberCookiesFromResponse
adamziel Apr 22, 2024
3250aec
Simplify WebPHPEndpoint
adamziel Apr 22, 2024
277974e
Provide DOCUMENT_ROOT in php.run() tests
adamziel Apr 22, 2024
0e28d97
Fix unit tests
adamziel Apr 22, 2024
bd5bde6
PHPProcessManager: Wait up to a timeout before giving up on spawning …
adamziel Apr 22, 2024
7c32081
Explore: PHP server
adamziel Apr 21, 2024
048ede5
Compat with the new PHPProcessManager API
adamziel Apr 22, 2024
8235d27
Fix ts lint errpr
adamziel Apr 22, 2024
4cd619d
Support --login option, add a bun-server.sh script for testing
adamziel Apr 22, 2024
a28a2ac
Download WordPress, SQLite plugin, pre-install WordPress, store it in…
adamziel Apr 22, 2024
d884281
Start cli.ts by inferring a Blueprint from CLi args
adamziel Apr 23, 2024
c4402da
Document the used bun extension
adamziel Apr 23, 2024
c49643a
Explore packaging Playground server and PHP CLI as a single bun execu…
adamziel Apr 23, 2024
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
4 changes: 4 additions & 0 deletions build-php-wasm-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

bun build ./packages/php-wasm/cli/src/main.js --compile --minify --outfile php-wasm-cli
mv ./packages/php-wasm/cli/src/php-wasm-cli ./
4 changes: 4 additions & 0 deletions build-playground-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

bun build ./packages/playground/cli/src/cli.ts --compile --minify --outfile playground
mv ./packages/playground/cli/src/playground ./
11 changes: 11 additions & 0 deletions build-playground-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// import { ImportFilesAsTextPlugin } from './packages/bun-extensions/src/import-files-as-text.ts';

await Bun.build({
entrypoints: [__dirname + '/packages/playground/cli/src/cli.ts'],
outdir: __dirname + '/out',
target: 'node',
root: '.',
// plugins: [ImportFilesAsTextPlugin],
});
console.log('built');
export {};
3 changes: 3 additions & 0 deletions bun-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

bun ./packages/playground/cli/src/cli.ts start --mount=my-plugin:/wordpress/wp-content/plugins/my-plugin --login --php=7.4 --wp=6.4
1 change: 1 addition & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preload = ["./packages/bun-extensions/src/import-files-as-text.ts"]
Loading
Loading