You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial install size of @wp-playground/cli is quite big because it depends on both @php-wasm/node and @php-wasm/web. They include all available PHP versions (10) in 2 variants (asyncify and jspi) for 2 targets (node and web).
For example, in an empty project:
$ mkdir example &&cd example
$ bun init -y
$ du -sh .
27M
$ bun add @wp-playground/cli && du -sh .
606M
$ du -sh node_modules/@php-wasm/*| sort -hr | head -n2
293M node_modules/@php-wasm/node
249M node_modules/@php-wasm/web
I think I found a way to remove dependency on the web target, and reduce the install size by half.
In @php-wasm/web, the function fetchWithCorsProxy (here) and type MountDevice (here) are very small and self-contained. They don't depend on anything in the rest of the package.
If these could be moved to a target-agnostic package like @php-wasm/universal, then blueprints and storage can import from there and avoid having to depend on the entire web target.
The text was updated successfully, but these errors were encountered:
The initial install size of
@wp-playground/cli
is quite big because it depends on both@php-wasm/node
and@php-wasm/web
. They include all available PHP versions (10) in 2 variants (asyncify
andjspi
) for 2 targets (node
andweb
).For example, in an empty project:
I think I found a way to remove dependency on the
web
target, and reduce the install size by half.Searching for where it's being used:
I grepped for
@php-wasm/web
in thecli
,blueprints
, andstorage
packages - and found only two lines.wordpress-playground/packages/playground/blueprints/src/lib/resources.ts
Line 14 in 5b1e18c
wordpress-playground/packages/playground/storage/src/lib/browser-fs.ts
Line 1 in 5b1e18c
In
@php-wasm/web
, the functionfetchWithCorsProxy
(here) and typeMountDevice
(here) are very small and self-contained. They don't depend on anything in the rest of the package.If these could be moved to a target-agnostic package like
@php-wasm/universal
, thenblueprints
andstorage
can import from there and avoid having to depend on the entireweb
target.The text was updated successfully, but these errors were encountered: