@rsbuild/core 2.0.7 → 2.0.9
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/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/dist/1~rslib-runtime.js +8 -5
- package/dist/{753.js → 756.js} +157 -128
- package/dist/client/hmr.js +1 -1
- package/dist/client/overlay.js +1 -1
- package/dist/http-proxy-middleware.js +2 -5
- package/dist/index.js +1 -1
- package/dist/launch-editor-middleware.js +1 -1
- package/dist/manifest-plugin.js +7 -7
- package/dist/memfs.js +5 -5
- package/dist/ws.js +45 -31
- package/dist-types/build.d.ts +1 -1
- package/dist-types/cli/init.d.ts +1 -1
- package/dist-types/configChain.d.ts +59 -118
- package/dist-types/constants.d.ts +35 -31
- package/dist-types/createContext.d.ts +1 -2
- package/dist-types/createRsbuild.d.ts +1 -2
- package/dist-types/defaultConfig.d.ts +2 -4
- package/dist-types/helpers/exitHook.d.ts +1 -1
- package/dist-types/helpers/format.d.ts +2 -1
- package/dist-types/helpers/fs.d.ts +2 -4
- package/dist-types/helpers/index.d.ts +1 -2
- package/dist-types/helpers/packageJson.d.ts +1 -1
- package/dist-types/helpers/path.d.ts +4 -8
- package/dist-types/helpers/stats.d.ts +3 -5
- package/dist-types/helpers/url.d.ts +1 -0
- package/dist-types/helpers/vendors.d.ts +2 -3
- package/dist-types/helpers/version.d.ts +2 -3
- package/dist-types/hooks.d.ts +6 -8
- package/dist-types/index.d.ts +10 -5
- package/dist-types/initConfigs.d.ts +2 -3
- package/dist-types/initPlugins.d.ts +1 -1
- package/dist-types/inspectConfig.d.ts +1 -1
- package/dist-types/loadConfig.d.ts +24 -32
- package/dist-types/loadEnv.d.ts +48 -57
- package/dist-types/loader/transformRawLoader.d.ts +1 -0
- package/dist-types/logger.d.ts +1 -2
- package/dist-types/mergeConfig.d.ts +1 -2
- package/dist-types/pluginHelper.d.ts +1 -2
- package/dist-types/pluginManager.d.ts +4 -7
- package/dist-types/plugins/basic.d.ts +1 -2
- package/dist-types/plugins/css.d.ts +5 -1
- package/dist-types/plugins/externals.d.ts +1 -1
- package/dist-types/plugins/fileSize.d.ts +6 -5
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +1 -0
- package/dist-types/plugins/swc.d.ts +1 -2
- package/dist-types/restart.d.ts +4 -5
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +2 -3
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +2 -3
- package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +3 -4
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +1 -2
- package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +2 -3
- package/dist-types/rspackConfig.d.ts +1 -1
- package/dist-types/server/ansiHTML.d.ts +1 -2
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +1 -2
- package/dist-types/server/assets-middleware/index.d.ts +3 -5
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +1 -2
- package/dist-types/server/browserLogs.d.ts +1 -2
- package/dist-types/server/buildManager.d.ts +4 -6
- package/dist-types/server/cliShortcuts.d.ts +3 -1
- package/dist-types/server/devMiddlewares.d.ts +2 -3
- package/dist-types/server/devServer.d.ts +18 -23
- package/dist-types/server/gracefulShutdown.d.ts +2 -4
- package/dist-types/server/gzipMiddleware.d.ts +1 -1
- package/dist-types/server/helper.d.ts +39 -47
- package/dist-types/server/historyApiFallback.d.ts +8 -1
- package/dist-types/server/httpServer.d.ts +1 -1
- package/dist-types/server/middlewares.d.ts +4 -8
- package/dist-types/server/open.d.ts +1 -1
- package/dist-types/server/runner/basic.d.ts +4 -5
- package/dist-types/server/runner/index.d.ts +3 -1
- package/dist-types/server/socketServer.d.ts +24 -18
- package/dist-types/server/watchFiles.d.ts +1 -1
- package/dist-types/types/config.d.ts +1197 -1457
- package/dist-types/types/context.d.ts +63 -92
- package/dist-types/types/hooks.d.ts +106 -150
- package/dist-types/types/plugin.d.ts +359 -444
- package/dist-types/types/rsbuild.d.ts +156 -191
- package/dist-types/types/thirdParty.d.ts +101 -132
- package/dist-types/types/utils.d.ts +2 -5
- package/package.json +10 -10
- package/dist-types/client/hmr.d.ts +0 -3
- package/dist-types/client/log.d.ts +0 -13
- package/dist-types/client/overlay.d.ts +0 -1
- /package/dist/{753.js.LICENSE.txt → 756.js.LICENSE.txt} +0 -0
- /package/dist/client/{797.js → 60.js} +0 -0
|
@@ -5,12 +5,11 @@ export type ServerMessageFullReload = {
|
|
|
5
5
|
type: 'full-reload';
|
|
6
6
|
data?: {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
path?: string;
|
|
8
|
+
* If `path` ends with `.html`, only the matching page will reload.
|
|
9
|
+
* The HTML path should be relative to the dev server root and should not
|
|
10
|
+
* include `server.base`. Use `'*'` to reload all pages.
|
|
11
|
+
* @example `/foo.html`
|
|
12
|
+
*/ path?: string;
|
|
14
13
|
};
|
|
15
14
|
};
|
|
16
15
|
export type ServerMessageStaticChanged = {
|
|
@@ -73,32 +72,39 @@ export declare class SocketServer {
|
|
|
73
72
|
private reportedBrowserLogs;
|
|
74
73
|
private currentHash;
|
|
75
74
|
constructor(context: InternalContext, options: DevConfig, getOutputFileSystem: () => Rspack.OutputFileSystem);
|
|
75
|
+
// subscribe upgrade event to handle socket
|
|
76
76
|
upgrade: (req: IncomingMessage, socket: Socket, head: Buffer) => void;
|
|
77
|
+
// detect and close broken connections
|
|
78
|
+
// https://github.com/websockets/ws/blob/8.18.0/README.md#how-to-detect-and-close-broken-connections
|
|
77
79
|
private checkSockets;
|
|
78
80
|
private clearHeartbeatTimer;
|
|
81
|
+
// create socket, install socket handler, bind socket event
|
|
79
82
|
prepare(): Promise<void>;
|
|
80
83
|
onBuildDone(): void;
|
|
81
84
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
sendError(errors: Rspack.StatsError[], token: string): void;
|
|
85
|
+
* Send error messages to the client.
|
|
86
|
+
*/ sendError(errors: Rspack.StatsError[], token: string): void;
|
|
85
87
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
sendWarning(warnings: Rspack.StatsError[], token: string): void;
|
|
88
|
+
* Send warning messages to the client
|
|
89
|
+
*/ sendWarning(warnings: Rspack.StatsError[], token: string): void;
|
|
89
90
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
sendMessage(message: ServerMessage, token?: string): void;
|
|
91
|
+
* Send a server message to matching client sockets.
|
|
92
|
+
* @param message - The message to send
|
|
93
|
+
* @param token - The token of the socket to send the message to,
|
|
94
|
+
* if not provided, the message will be sent to all sockets
|
|
95
|
+
*/ sendMessage(message: ServerMessage, token?: string): void;
|
|
96
96
|
close(): Promise<void>;
|
|
97
97
|
private onConnect;
|
|
98
98
|
private getEnvironmentByToken;
|
|
99
99
|
private getInitialChunks;
|
|
100
|
+
// Cache initial chunks for environments that have no baseline yet.
|
|
101
|
+
// This keeps comparison stable even when no client socket is connected
|
|
102
|
+
// during the first completed build.
|
|
100
103
|
private ensureInitialChunks;
|
|
104
|
+
// Only use stats when environment is matched
|
|
101
105
|
private getStats;
|
|
106
|
+
// determine what message should send by stats
|
|
102
107
|
private sendStats;
|
|
108
|
+
// send a serialized message to a specific socket
|
|
103
109
|
private sendRawMessage;
|
|
104
110
|
}
|
|
@@ -11,4 +11,4 @@ export type WatchFilesResult = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function setupWatchFiles(options: WatchFilesOptions): Promise<WatchFilesResult | undefined>;
|
|
13
13
|
export declare function createChokidar(pathOrGlobs: string[], root: string, options: ChokidarOptions): Promise<FSWatcher>;
|
|
14
|
-
export {};
|
|
14
|
+
export { };
|