@wp-playground/remote 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/boot-playground-remote.d.ts +1 -2
- package/lib/playground-client.d.ts +1 -1
- package/lib/playground-worker-endpoint-blueprints-v1.d.ts +1 -0
- package/lib/playground-worker-endpoint-blueprints-v2.d.ts +1 -0
- package/lib/{worker-thread.d.ts → playground-worker-endpoint.d.ts} +29 -4
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { PlaygroundWorkerEndpoint, WorkerBootOptions, MountDescriptor } from './worker-
|
|
1
|
+
import type { PlaygroundWorkerEndpoint, WorkerBootOptions, MountDescriptor } from './playground-worker-endpoint';
|
|
2
2
|
export type { MountDescriptor, WorkerBootOptions };
|
|
3
3
|
import type { WebClientMixin } from './playground-client';
|
|
4
|
-
export declare const workerUrl: string;
|
|
5
4
|
export declare const serviceWorkerUrl: URL;
|
|
6
5
|
export declare function bootPlaygroundRemote(): Promise<import("@php-wasm/universal").PublicAPI<WebClientMixin, import("@php-wasm/universal").RemoteAPI<PlaygroundWorkerEndpoint>>>;
|
|
@@ -5,7 +5,7 @@ import type { ProgressReceiver } from '@php-wasm/progress';
|
|
|
5
5
|
import type { MessageListener, UniversalPHP } from '@php-wasm/universal';
|
|
6
6
|
import type { RemoteAPI, SyncProgressCallback } from '@php-wasm/web';
|
|
7
7
|
import type { ProgressBarOptions } from './progress-bar';
|
|
8
|
-
import type { PlaygroundWorkerEndpoint, MountDescriptor, WorkerBootOptions } from './worker-
|
|
8
|
+
import type { PlaygroundWorkerEndpoint, MountDescriptor, WorkerBootOptions } from './playground-worker-endpoint';
|
|
9
9
|
export interface WebClientMixin extends ProgressReceiver {
|
|
10
10
|
/**
|
|
11
11
|
* Sets the progress bar options.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { MountDevice, SyncProgressCallback } from '@php-wasm/web';
|
|
2
|
-
import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
|
|
3
1
|
import type { FilesystemOperation } from '@php-wasm/fs-journal';
|
|
2
|
+
import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';
|
|
3
|
+
import type { MountDevice, SyncProgressCallback } from '@php-wasm/web';
|
|
4
|
+
import { createMemoizedFetch } from '@wp-playground/common';
|
|
4
5
|
import type { SupportedPHPVersion } from '@php-wasm/universal';
|
|
5
6
|
import { PHPWorker } from '@php-wasm/universal';
|
|
7
|
+
import type { BlueprintDeclaration } from '@wp-playground/blueprints';
|
|
6
8
|
export interface MountDescriptor {
|
|
7
9
|
mountpoint: string;
|
|
8
10
|
device: MountDevice;
|
|
@@ -19,9 +21,13 @@ export type WorkerBootOptions = {
|
|
|
19
21
|
mounts?: Array<MountDescriptor>;
|
|
20
22
|
shouldInstallWordPress?: boolean;
|
|
21
23
|
corsProxyUrl?: string;
|
|
24
|
+
/** When true, skip default WP install and run Blueprints v2 in the worker */
|
|
25
|
+
experimentalBlueprintsV2Runner?: boolean;
|
|
26
|
+
/** Blueprint v2 declaration to run in the worker when experimental mode is on */
|
|
27
|
+
blueprint?: BlueprintDeclaration;
|
|
22
28
|
};
|
|
23
29
|
/** @inheritDoc PHPClient */
|
|
24
|
-
export declare class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
30
|
+
export declare abstract class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
25
31
|
booted: boolean;
|
|
26
32
|
/**
|
|
27
33
|
* A string representing the scope of the Playground instance.
|
|
@@ -35,9 +41,23 @@ export declare class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
|
35
41
|
* A string representing the version of WordPress that was loaded.
|
|
36
42
|
*/
|
|
37
43
|
loadedWordPressVersion: string | undefined;
|
|
44
|
+
blueprintMessageListeners: Array<(message: any) => void | Promise<void>>;
|
|
38
45
|
unmounts: Record<string, () => any>;
|
|
39
46
|
private networkTransport;
|
|
47
|
+
protected downloadMonitor: EmscriptenDownloadMonitor;
|
|
48
|
+
protected memoizedFetch: ReturnType<typeof createMemoizedFetch>;
|
|
40
49
|
constructor(monitor: EmscriptenDownloadMonitor);
|
|
50
|
+
protected computeSiteUrl(scope: string): string;
|
|
51
|
+
protected createRequestHandler({ siteUrl, sapiName, withICU, corsProxyUrl, knownRemoteAssetPaths, withNetworking, phpVersion, }: {
|
|
52
|
+
siteUrl: string;
|
|
53
|
+
sapiName: string;
|
|
54
|
+
withICU: boolean;
|
|
55
|
+
corsProxyUrl?: string;
|
|
56
|
+
knownRemoteAssetPaths: Set<string>;
|
|
57
|
+
withNetworking: boolean;
|
|
58
|
+
phpVersion: SupportedPHPVersion;
|
|
59
|
+
}): Promise<import("@php-wasm/universal").PHPRequestHandler>;
|
|
60
|
+
protected finalizeAfterBoot(requestHandler: any, withNetworking: boolean, knownRemoteAssetPaths: Set<string>): Promise<void>;
|
|
41
61
|
/**
|
|
42
62
|
* @returns WordPress module details, including the static assets directory and default theme.
|
|
43
63
|
*/
|
|
@@ -63,7 +83,12 @@ export declare class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
|
63
83
|
unmountOpfs(mountpoint: string): Promise<void>;
|
|
64
84
|
backfillStaticFilesRemovedFromMinifiedBuild(): Promise<void>;
|
|
65
85
|
hasCachedStaticFilesRemovedFromMinifiedBuild(): Promise<boolean>;
|
|
66
|
-
|
|
86
|
+
onBlueprintMessage(listener: (message: any) => void | Promise<void>): Promise<() => Promise<void>>;
|
|
87
|
+
abstract boot(_: any): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Pre-fetch the slow initial burst of wp_update_* requests to greatly
|
|
90
|
+
* improve the first wp-admin load time.
|
|
91
|
+
*/
|
|
67
92
|
prefetchUpdateChecks(): Promise<void>;
|
|
68
93
|
journalFSEvents(root: string, callback: (op: FilesystemOperation) => void): Promise<() => any>;
|
|
69
94
|
replayFSJournal(events: FilesystemOperation[]): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/remote",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "WordPress Playground remote host",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"access": "public",
|
|
26
26
|
"directory": "../../../dist/packages/playground/remote"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "238d05ffb780d420070b23384e0a906c71bd0611"
|
|
29
29
|
}
|