diff --git a/.github/workflows/test-ng.yml b/.github/workflows/test-ng.yml index 2b3e6c4a25a..1f06ae1bfa5 100644 --- a/.github/workflows/test-ng.yml +++ b/.github/workflows/test-ng.yml @@ -58,7 +58,8 @@ jobs: - name: Test new runner run: | - OUTPUT=$(pnpm run test:ng --no-colors --silent=true 2>&1) + set -e; + OUTPUT=$((pnpm run test:ng --no-colors --silent=true 2>&1 || true) | tail --bytes=50000) echo 'RESULT<> $GITHUB_ENV echo "$OUTPUT" >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV diff --git a/packages/rspack-test-tools/src/case/hot-step.ts b/packages/rspack-test-tools/src/case/hot-step.ts new file mode 100644 index 00000000000..e2057bdd151 --- /dev/null +++ b/packages/rspack-test-tools/src/case/hot-step.ts @@ -0,0 +1,42 @@ +import { RspackHotStepProcessor } from "../processor/hot-step"; +import { ECompilerType, TCompilerOptions } from "../type"; +import { BasicCaseCreator } from "../test/creator"; +import { HotStepRunnerFactory } from "../runner"; + +type TTarget = TCompilerOptions["target"]; + +const creators: Map< + TTarget, + BasicCaseCreator +> = new Map(); + +function getCreator(target: TTarget) { + if (!creators.has(target)) { + creators.set( + target, + new BasicCaseCreator({ + clean: true, + describe: true, + target, + steps: ({ name, target }) => [ + new RspackHotStepProcessor({ + name, + target: target as TTarget + }) + ], + runner: HotStepRunnerFactory + }) + ); + } + return creators.get(target)!; +} + +export function createHotStepCase( + name: string, + src: string, + dist: string, + target: TCompilerOptions["target"] +) { + const creator = getCreator(target); + creator.create(name, src, dist); +} diff --git a/packages/rspack-test-tools/src/case/index.ts b/packages/rspack-test-tools/src/case/index.ts index 8e622e68c99..d788a4a6ae7 100644 --- a/packages/rspack-test-tools/src/case/index.ts +++ b/packages/rspack-test-tools/src/case/index.ts @@ -9,3 +9,4 @@ export * from "./watch"; export * from "./treeshaking"; export * from "./defaults"; export * from "./builtin"; +export * from "./hot-step"; diff --git a/packages/rspack-test-tools/src/processor/hot-step.ts b/packages/rspack-test-tools/src/processor/hot-step.ts new file mode 100644 index 00000000000..486cffdbf48 --- /dev/null +++ b/packages/rspack-test-tools/src/processor/hot-step.ts @@ -0,0 +1,282 @@ +import { + ECompilerType, + ITestContext, + ITestEnv, + TCompilerOptions, + TCompilerStats +} from "../type"; +import path from "path"; +import { StatsCompilation } from "@rspack/core"; +import { + IRspackHotProcessorOptions, + RspackHotProcessor, + TUpdateOptions +} from "./hot"; +import fs from "fs-extra"; + +const escapeLocalName = (str: string) => str.split(/[-<>:"/|?*.]/).join("_"); + +declare var global: { + self?: { + [key: string]: (name: string, modules: Record) => void; + }; + updateSnapshot: boolean; +}; + +const SELF_HANDLER = ( + file: string, + options: TCompilerOptions +): string[] => { + let res: string[] = []; + const hotUpdateGlobal = (_: string, modules: Record) => { + res = Object.keys(modules); + }; + const hotUpdateGlobalKey = escapeLocalName( + `${options.output?.hotUpdateGlobal || "webpackHotUpdate"}${ + options.output?.uniqueName || "" + }` + ); + global["self"] ??= {}; + global["self"][hotUpdateGlobalKey] = hotUpdateGlobal; + require(file); + delete global["self"][hotUpdateGlobalKey]; + if (!Object.keys(global["self"]).length) { + delete global["self"]; + } + return res; +}; + +const GET_MODULE_HANDLER = { + web: SELF_HANDLER, + "async-node": (file: string): string[] => { + return Object.keys(require(file).modules) || []; + }, + webworker: SELF_HANDLER +}; + +type TSupportTarget = keyof typeof GET_MODULE_HANDLER; + +export interface IRspackHotStepProcessorOptions + extends IRspackHotProcessorOptions {} + +export class RspackHotStepProcessor extends RspackHotProcessor { + private hashes: string[] = []; + private entries: Record = {}; + + constructor(protected _hotOptions: IRspackHotProcessorOptions) { + super(_hotOptions); + } + + async run(env: ITestEnv, context: ITestContext) { + context.setValue( + this._options.name, + "hotUpdateStepChecker", + ( + hotUpdateContext: TUpdateOptions, + stats: TCompilerStats + ) => { + const statsJson = stats.toJson({ assets: true, chunks: true }); + for (let entry of (stats?.compilation.chunks || []).filter(i => + i.hasRuntime() + )) { + if (!this.entries[entry.id!]) { + this.entries[entry.id!] = entry.runtime!; + } + } + this.matchStepSnapshot( + context, + hotUpdateContext.updateIndex, + statsJson + ); + this.hashes.push(stats.hash!); + } + ); + context.setValue( + this._options.name, + "hotUpdateStepErrorChecker", + (_: TUpdateOptions, stats: TCompilerStats) => { + this.hashes.push(stats.hash!); + } + ); + await super.run(env, context); + } + + async check(env: ITestEnv, context: ITestContext) { + const compiler = this.getCompiler(context); + const stats = compiler.getStats(); + if (!stats || !stats.hash) { + expect(false); + return; + } + const statsJson = stats.toJson({ assets: true, chunks: true }); + for (let entry of (stats?.compilation.chunks || []).filter(i => + i.hasRuntime() + )) { + this.entries[entry.id!] = entry.runtime!; + } + this.matchStepSnapshot(context, 0, statsJson); + this.hashes.push(stats.hash!); + await super.check(env, context); + } + + protected matchStepSnapshot( + context: ITestContext, + step: number, + stats: StatsCompilation + ) { + const compiler = this.getCompiler(context); + const compilerOptions = compiler.getOptions(); + const getModuleHandler = + GET_MODULE_HANDLER[compilerOptions.target as TSupportTarget]; + expect(typeof getModuleHandler).toBe("function"); + + const lastHash = this.hashes[this.hashes.length - 1]; + const snapshotPath = context.getSource( + `snapshot/${compilerOptions.target}/${step}.snap.txt` + ); + const title = `Case ${this._options.name}: Step ${step}`; + const hotUpdateFile: Array<{ + name: string; + content: string; + modules: string[]; + runtime: string[]; + }> = []; + const hotUpdateManifest: Array<{ name: string; content: string }> = []; + const changedFiles: string[] = require( + context.getSource("changed-file.js") + ).map((i: string) => path.relative(context.getSource(), i)); + + const hashes: Record = { + [lastHash || "LAST_HASH"]: "LAST_HASH", + [stats.hash!]: "CURRENT_HASH" + }; + + // TODO: find a better way + // replace [runtime] to [runtime of id] to prevent worker hash + const runtimes: Record = {}; + for (let [id, runtime] of Object.entries(this.entries)) { + for (let r of runtime) { + if (r !== id) { + runtimes[r] = `[runtime of ${id}]`; + } + } + } + + const replaceContent = (str: string) => { + for (let [raw, replacement] of Object.entries(hashes)) { + str = str.split(raw).join(replacement); + } + return str; + }; + + const replaceFileName = (str: string) => { + for (let [raw, replacement] of Object.entries({ + ...hashes, + ...runtimes + })) { + str = str.split(raw).join(replacement); + } + return str; + }; + + const fileList = stats + .assets!.map(i => { + const fileName = i.name; + const renderName = replaceFileName(fileName); + const content = replaceContent( + fs.readFileSync(context.getDist(fileName), "utf-8") + ); + if (fileName.endsWith("hot-update.js")) { + const modules = getModuleHandler( + context.getDist(fileName), + compilerOptions + ); + const runtime: string[] = []; + for (let i of content.matchAll( + /\/\/ (webpack\/runtime\/[\w_-]+)\s*\n/g + )) { + runtime.push(i[1]); + } + modules.sort(); + runtime.sort(); + hotUpdateFile.push({ + name: renderName, + content, + modules, + runtime + }); + return `- Update: ${renderName}, size: ${i.size}`; + } else if (fileName.endsWith("hot-update.json")) { + hotUpdateManifest.push({ + name: renderName, + content + }); + return `- Manifest: ${renderName}, size: ${i.size}`; + } else if (fileName.endsWith(".js")) { + return `- Bundle: ${renderName}, size: ${i.size}`; + } + }) + .filter(Boolean); + + fileList.sort(); + hotUpdateManifest.sort(); + hotUpdateFile.sort(); + + let content = ` +# ${title} + +## Changed Files +${changedFiles.map(i => `- ${i}`).join("\n")} + +## Asset Files +${fileList.join("\n")} + +## Manifest +${hotUpdateManifest + .map( + i => ` +### ${i.name} + +\`\`\`json +${i.content} +\`\`\` +` + ) + .join("\n\n")} + +## Update + +${hotUpdateFile + .map( + i => ` +### ${i.name} + +#### Changed Modules +${i.modules.map(i => `- ${i}`).join("\n")} + +#### Changed Runtime Modules +${i.runtime.map(i => `- ${i}`).join("\n")} + +#### Changed Content +\`\`\`js +${i.content} +\`\`\` + +` + ) + .join("\n\n")} + + `.trim(); + + if (!fs.existsSync(snapshotPath) || global.updateSnapshot) { + fs.ensureDirSync(path.dirname(snapshotPath)); + fs.writeFileSync(snapshotPath, content, "utf-8"); + return; + } + const snapshotContent = fs + .readFileSync(snapshotPath, "utf-8") + .replace(/\r\n/g, "\n") + .trim(); + expect(content).toBe(snapshotContent); + } +} diff --git a/packages/rspack-test-tools/src/processor/hot.ts b/packages/rspack-test-tools/src/processor/hot.ts index 739d8702d08..e6b1acb85ed 100644 --- a/packages/rspack-test-tools/src/processor/hot.ts +++ b/packages/rspack-test-tools/src/processor/hot.ts @@ -14,7 +14,7 @@ export interface IRspackHotProcessorOptions { target: TCompilerOptions["target"]; } -type TUpdateOptions = { +export type TUpdateOptions = { updateIndex: number; }; diff --git a/packages/rspack-test-tools/src/processor/index.ts b/packages/rspack-test-tools/src/processor/index.ts index 76380686d4b..6ebfb54c79f 100644 --- a/packages/rspack-test-tools/src/processor/index.ts +++ b/packages/rspack-test-tools/src/processor/index.ts @@ -12,3 +12,4 @@ export * from "./defaults"; export * from "./stats-api"; export * from "./snapshot"; export * from "./builtin"; +export * from "./hot-step"; diff --git a/packages/rspack-test-tools/src/runner/hot-step.ts b/packages/rspack-test-tools/src/runner/hot-step.ts new file mode 100644 index 00000000000..816690bb296 --- /dev/null +++ b/packages/rspack-test-tools/src/runner/hot-step.ts @@ -0,0 +1,74 @@ +import { StatsCompilation } from "@rspack/core"; +import checkArrayExpectation from "../helper/legacy/checkArrayExpectation"; +import { + ECompilerType, + ITestEnv, + ITestRunner, + TCompilerOptions, + TCompilerStats +} from "../type"; +import { HotRunner } from "./runner/hot"; +import { HotRunnerFactory } from "./hot"; + +export class HotStepRunnerFactory< + T extends ECompilerType +> extends HotRunnerFactory { + protected createRunner( + file: string, + compilerOptions: TCompilerOptions, + env: ITestEnv + ): ITestRunner { + const compiler = this.context.getCompiler(this.name); + const testConfig = this.context.getTestConfig(); + const stats = compiler.getStats(); + const source = this.context.getSource(); + const dist = this.context.getDist(); + const hotUpdateContext = this.context.getValue( + this.name, + "hotUpdateContext" + ) as { updateIndex: number }; + + const next = ( + callback: (error: Error | null, stats?: StatsCompilation) => void + ) => { + hotUpdateContext.updateIndex++; + compiler + .build() + .then(stats => { + if (!stats) + return callback(new Error("Should generate stats during build")); + const jsonStats = stats.toJson({ + // errorDetails: true + }); + try { + const checker = this.context.getValue( + this.name, + jsonStats.errors?.length + ? "hotUpdateStepErrorChecker" + : "hotUpdateStepChecker" + ) as ( + context: { updateIndex: number }, + stats: TCompilerStats + ) => void; + checker(hotUpdateContext, stats as TCompilerStats); + callback(null, jsonStats as StatsCompilation); + } catch (e) { + callback(e as Error); + } + }) + .catch(callback); + }; + + return new HotRunner({ + env, + stats: stats!, + name: this.name, + runInNewContext: false, + testConfig, + source, + dist, + next, + compilerOptions + }); + } +} diff --git a/packages/rspack-test-tools/src/runner/index.ts b/packages/rspack-test-tools/src/runner/index.ts index 84ed0605a37..28b4235edb8 100644 --- a/packages/rspack-test-tools/src/runner/index.ts +++ b/packages/rspack-test-tools/src/runner/index.ts @@ -1,5 +1,6 @@ export * from "./basic"; export * from "./hot"; +export * from "./hot-step"; export * from "./normal"; export * from "./watch"; export * from "./type"; diff --git a/packages/rspack-test-tools/tests/HotTestStepWeb.test.js b/packages/rspack-test-tools/tests/HotTestStepWeb.test.js new file mode 100644 index 00000000000..cc5f741d2b2 --- /dev/null +++ b/packages/rspack-test-tools/tests/HotTestStepWeb.test.js @@ -0,0 +1,13 @@ +const path = require("path"); +const { describeByWalk, createHotStepCase } = require("../dist"); + +const NAME = "HotStepTestCasesNode"; +const caseDir = path.resolve(__dirname, "../../rspack/tests/hotCases"); +const distDir = path.resolve( + __dirname, + `../../rspack/tests/js/hot-step-cases-web` +); + +describeByWalk(NAME, caseDir, distDir, (name, src, dist) => { + createHotStepCase(name, src, dist, "web"); +}); diff --git a/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..72cb58000b9 --- /dev/null +++ b/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case parser-and-generator-states: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37773 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..25e2533a8a8 --- /dev/null +++ b/packages/rspack/tests/hotCases/asset/parser-and-generator-states/snapshot/web/1.snap.txt @@ -0,0 +1,53 @@ +# Case parser-and-generator-states: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37785 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 597 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */var _logo_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logo.svg */"./logo.svg"); + +/* harmony default export */ __webpack_exports__["default"] = (typeof _logo_svg__WEBPACK_IMPORTED_MODULE_0__ + ' result'); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..ce60ae84ccd --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case accept-system-import-webpackhot: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37757 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 745 +- Bundle: chunk_js.chunk.CURRENT_HASH.js, size: 743 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..6b0acc108ae --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/accept-system-import-webpackhot/snapshot/web/1.snap.txt @@ -0,0 +1,102 @@ +# Case accept-system-import-webpackhot: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37757 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 745 +- Bundle: chunk_js.chunk.CURRENT_HASH.js, size: 743 +- Manifest: main.LAST_HASH.hot-update.json, size: 51 +- Update: chunk2_js.LAST_HASH.hot-update.js, size: 301 +- Update: chunk_js.LAST_HASH.hot-update.js, size: 300 +- Update: main.LAST_HASH.hot-update.js, size: 201 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main","chunk2_js","chunk_js"],"r":[],"m":[]} +``` + + +## Update + + +### chunk2_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('chunk2_js', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +}); +``` + + + + +### chunk_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('chunk_js', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..d6ac5997fc1 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case accept-system-import: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37757 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 745 +- Bundle: chunk_js.chunk.CURRENT_HASH.js, size: 743 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..ba2c800e316 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/accept-system-import/snapshot/web/1.snap.txt @@ -0,0 +1,102 @@ +# Case accept-system-import: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37757 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 745 +- Bundle: chunk_js.chunk.CURRENT_HASH.js, size: 743 +- Manifest: main.LAST_HASH.hot-update.json, size: 51 +- Update: chunk2_js.LAST_HASH.hot-update.js, size: 301 +- Update: chunk_js.LAST_HASH.hot-update.js, size: 300 +- Update: main.LAST_HASH.hot-update.js, size: 201 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["chunk_js","main","chunk2_js"],"r":[],"m":[]} +``` + + +## Update + + +### chunk2_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('chunk2_js', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +}); +``` + + + + +### chunk_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('chunk_js', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..448500c4c24 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case asset: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33103 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..6cb1b8d742e --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case asset: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 +- Manifest: main.LAST_HASH.hot-update.json, size: 39 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./raw.png"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..769c9428441 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt @@ -0,0 +1,54 @@ +# Case asset: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33103 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 523 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js +- ./raw.png + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module, __unused_webpack_exports, __webpack_require__) { +__webpack_require__(/*! ./raw.png */"./raw.png"); +module.exports = 3; +}), +"./raw.png": (function (module, __unused_webpack_exports, __webpack_require__) { +"use strict"; +module.exports = __webpack_require__.p + "f7f4f00355f310234f70.png";}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..a9ebeb931fe --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/asset/snapshot/web/3.snap.txt @@ -0,0 +1,49 @@ +# Case asset: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 +- Manifest: main.LAST_HASH.hot-update.json, size: 39 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./raw.png"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 4; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..beb9a214929 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case ensure-chunk-change-to-promise-all: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37956 +- Bundle: file_js.chunk.CURRENT_HASH.js, size: 497 +- Bundle: vendors-node_modules_react_js.chunk.CURRENT_HASH.js, size: 374 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..686f5475bbc --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshot/web/1.snap.txt @@ -0,0 +1,86 @@ +# Case ensure-chunk-change-to-promise-all: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37937 +- Bundle: file_js.chunk.CURRENT_HASH.js, size: 485 +- Bundle: vendors-node_modules_vue_js.chunk.CURRENT_HASH.js, size: 364 +- Manifest: main.LAST_HASH.hot-update.json, size: 94 +- Update: file_js.LAST_HASH.hot-update.js, size: 449 +- Update: main.LAST_HASH.hot-update.js, size: 692 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main","file_js"],"r":["vendors-node_modules_react_js"],"m":["./node_modules/react.js"]} +``` + + +## Update + + +### file_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('file_js', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + Vue: function() { return /* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Vue; } +}); +/* harmony import */var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */"./node_modules/vue.js"); + +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./chunk.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./chunk.js": (function (module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + test: function() { return test; } +}); +function test(count) { + return Promise.all([__webpack_require__.e("vendors-node_modules_vue_js"), __webpack_require__.e("file_js")]).then(__webpack_require__.bind(__webpack_require__, /*! ./file */"./file.js")).then(({ React, Vue })=>count === 0 ? React : Vue); +} +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/issue-4476/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/issue-4476/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..63c6a295390 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/issue-4476/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case issue-4476: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 37846 +- Bundle: file_js.chunk.CURRENT_HASH.js, size: 146 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/multi-chunk-single-runtime/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/multi-chunk-single-runtime/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..340200cbcbf --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/multi-chunk-single-runtime/snapshot/web/0.snap.txt @@ -0,0 +1,16 @@ +# Case multi-chunk-single-runtime: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 900 +- Bundle: b.js, size: 900 +- Bundle: main.js, size: 1617 +- Bundle: main_async_js.chunk.CURRENT_HASH.js, size: 122 +- Bundle: runtime.js, size: 38850 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..dc636d54d6d --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case multi-chunk: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 33377 +- Bundle: b.js, size: 33377 +- Bundle: main.js, size: 32858 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..27a02acc0b0 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/1.snap.txt @@ -0,0 +1,133 @@ +# Case multi-chunk: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 33377 +- Bundle: b.js, size: 33377 +- Bundle: main.js, size: 32858 +- Manifest: a.LAST_HASH.hot-update.json, size: 35 +- Manifest: b.LAST_HASH.hot-update.json, size: 35 +- Manifest: main.LAST_HASH.hot-update.json, size: 35 +- Update: a.LAST_HASH.hot-update.js, size: 256 +- Update: b.LAST_HASH.hot-update.js, size: 256 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### a.LAST_HASH.hot-update.json + +```json +{"c":["a"],"r":["main","b"],"m":[]} +``` + + + +### b.LAST_HASH.hot-update.json + +```json +{"c":["b"],"r":["main","a"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["b","a"],"m":[]} +``` + + +## Update + + +### a.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('a', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### b.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('b', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..9f2315be937 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/2.snap.txt @@ -0,0 +1,133 @@ +# Case multi-chunk: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 33377 +- Bundle: b.js, size: 33377 +- Bundle: main.js, size: 32858 +- Manifest: a.LAST_HASH.hot-update.json, size: 35 +- Manifest: b.LAST_HASH.hot-update.json, size: 35 +- Manifest: main.LAST_HASH.hot-update.json, size: 35 +- Update: a.LAST_HASH.hot-update.js, size: 256 +- Update: b.LAST_HASH.hot-update.js, size: 256 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### a.LAST_HASH.hot-update.json + +```json +{"c":["a"],"r":["main","b"],"m":[]} +``` + + + +### b.LAST_HASH.hot-update.json + +```json +{"c":["b"],"r":["main","a"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["b","a"],"m":[]} +``` + + +## Update + + +### a.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('a', { +"./file.js": (function (module) { +module.exports = 3; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### b.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('b', { +"./file.js": (function (module) { +module.exports = 3; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 3; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..2cebde46133 --- /dev/null +++ b/packages/rspack/tests/hotCases/chunk/multi-chunk/snapshot/web/3.snap.txt @@ -0,0 +1,133 @@ +# Case multi-chunk: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 33377 +- Bundle: b.js, size: 33377 +- Bundle: main.js, size: 32858 +- Manifest: a.LAST_HASH.hot-update.json, size: 35 +- Manifest: b.LAST_HASH.hot-update.json, size: 35 +- Manifest: main.LAST_HASH.hot-update.json, size: 35 +- Update: a.LAST_HASH.hot-update.js, size: 256 +- Update: b.LAST_HASH.hot-update.js, size: 256 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### a.LAST_HASH.hot-update.json + +```json +{"c":["a"],"r":["main","b"],"m":[]} +``` + + + +### b.LAST_HASH.hot-update.json + +```json +{"c":["b"],"r":["main","a"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["b","a"],"m":[]} +``` + + +## Update + + +### a.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('a', { +"./file.js": (function (module) { +module.exports = 4; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### b.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('b', { +"./file.js": (function (module) { +module.exports = 4; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 4; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..4f215b846db --- /dev/null +++ b/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case this-in-accept-webpackhot: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 33703 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..d9e067e1ecc --- /dev/null +++ b/packages/rspack/tests/hotCases/code-generation/this-in-accept-webpackhot/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case this-in-accept-webpackhot: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 33703 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 429 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ("ok2"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..fa5e2cc02ef --- /dev/null +++ b/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case this-in-accept: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 33721 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..9576157a532 --- /dev/null +++ b/packages/rspack/tests/hotCases/code-generation/this-in-accept/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case this-in-accept: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 33721 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 429 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ("ok2"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/context/request-position/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/context/request-position/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..589a8daded5 --- /dev/null +++ b/packages/rspack/tests/hotCases/context/request-position/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case request-position: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 38805 +- Bundle: lib_a_js.chunk.CURRENT_HASH.js, size: 327 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/context/request-position/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/context/request-position/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..b6913656796 --- /dev/null +++ b/packages/rspack/tests/hotCases/context/request-position/snapshot/web/1.snap.txt @@ -0,0 +1,59 @@ +# Case request-position: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 38801 +- Bundle: lib_a_js.chunk.CURRENT_HASH.js, size: 327 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 660 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + fn: function() { return fn; } +}); +const fn = async function() { + const name = "a"; + const wrap = (v)=>v; + return wrap(await __webpack_require__(/*! ./lib */"./lib Lazy recursive ^\\.\\/.*\\.js$")((`./lib/${name}.js`).replace('./lib/', './'))); +}; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..3e78814fd65 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case css-loading-unique-name: Step 0 + +## Changed Files +- index.css + +## Asset Files +- Bundle: bundle.js, size: 33570 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..d08b2dc3590 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css-loading-unique-name/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case css-loading-unique-name: Step 1 + +## Changed Files +- index.css + +## Asset Files +- Bundle: bundle.js, size: 33570 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 375 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./index.css + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdatecss_test"]('main', { +"./index.css": (function (module, __unused_webpack_exports, __webpack_require__) { +"use strict"; +module.hot.accept(); +__webpack_require__.r(module.exports = {}); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..55f533da487 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case css-modules: Step 0 + +## Changed Files +- index.module.css + +## Asset Files +- Bundle: bundle.js, size: 33761 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..923c8dd1aa9 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css-modules/snapshot/web/1.snap.txt @@ -0,0 +1,52 @@ +# Case css-modules: Step 1 + +## Changed Files +- index.module.css + +## Asset Files +- Bundle: bundle.js, size: 33757 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 386 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./index.module.css + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./index.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { +"use strict"; +__webpack_require__.r(module.exports = { + "a": "-__index_module_css-a", +}); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/css/css/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..4f80bfd45b2 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case css: Step 0 + +## Changed Files +- index.css + +## Asset Files +- Bundle: bundle.js, size: 33268 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/css/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/css/css/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..bd5adb182c8 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/css/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case css: Step 1 + +## Changed Files +- index.css + +## Asset Files +- Bundle: bundle.js, size: 33268 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 367 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./index.css + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./index.css": (function (module, __unused_webpack_exports, __webpack_require__) { +"use strict"; +module.hot.accept(); +__webpack_require__.r(module.exports = {}); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..f7b07803f97 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case parser-and-generator-states: Step 0 + +## Changed Files +- index.module.css + +## Asset Files +- Bundle: bundle.js, size: 33785 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..8d03b70b5c1 --- /dev/null +++ b/packages/rspack/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt @@ -0,0 +1,53 @@ +# Case parser-and-generator-states: Step 1 + +## Changed Files +- index.module.css + +## Asset Files +- Bundle: bundle.js, size: 33785 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 487 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./index.module.css + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./index.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { +"use strict"; +__webpack_require__.r(module.exports = { + "btn-info_is-disabled": "index_module_css__btn-info_is-disabled", + "btnInfoIsDisabled": "index_module_css__btn-info_is-disabled", +}); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..3ea4d5f8707 --- /dev/null +++ b/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case issue-10174: Step 0 + +## Changed Files +- hot.js + +## Asset Files +- Bundle: bundle.js, size: 35373 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..429fd19a2ee --- /dev/null +++ b/packages/rspack/tests/hotCases/determinism/issue-10174/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case issue-10174: Step 1 + +## Changed Files +- hot.js + +## Asset Files +- Bundle: bundle.js, size: 35373 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 422 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./hot.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./hot.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..71a89e38b48 --- /dev/null +++ b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case remove-chunk-with-shared-in-other-runtime: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 37953 +- Bundle: chunk1_js.chunk.CURRENT_HASH.js, size: 953 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 26373 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..84f4515fd4b --- /dev/null +++ b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshot/web/1.snap.txt @@ -0,0 +1,659 @@ +# Case remove-chunk-with-shared-in-other-runtime: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 37764 +- Bundle: chunk1_js.chunk.CURRENT_HASH.js, size: 953 +- Manifest: [runtime of chunk2_js].LAST_HASH.hot-update.json, size: 65 +- Manifest: main.LAST_HASH.hot-update.json, size: 41 +- Update: main.LAST_HASH.hot-update.js, size: 17494 + +## Manifest + +### [runtime of chunk2_js].LAST_HASH.hot-update.json + +```json +{"c":[],"r":["main","chunk2_js","chunk1_js"],"m":["./chunk2.js"]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./chunk2.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash +- webpack/runtime/jsonp_chunk_loading + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (42); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); +// webpack/runtime/jsonp_chunk_loading +!function() { + + // object to store loaded and loading chunks + // undefined = chunk not loaded, null = chunk preloaded/prefetched + // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded + var installedChunks = __webpack_require__.hmrS_jsonp = __webpack_require__.hmrS_jsonp || {"main": 0,}; + + __webpack_require__.f.j = function (chunkId, promises) { + // JSONP chunk loading for javascript +var installedChunkData = __webpack_require__.o(installedChunks, chunkId) + ? installedChunks[chunkId] + : undefined; +if (installedChunkData !== 0) { + // 0 means "already installed". + + // a Promise means "currently loading". + if (installedChunkData) { + promises.push(installedChunkData[2]); + } else { + if (true) { + // setup Promise in chunk cache + var promise = new Promise(function (resolve, reject) { + installedChunkData = installedChunks[chunkId] = [resolve, reject]; + }); + promises.push((installedChunkData[2] = promise)); + + // start chunk loading + var url = __webpack_require__.p + __webpack_require__.u(chunkId); + // create error before stack unwound to get useful stacktrace later + var error = new Error(); + var loadingEnded = function (event) { + if (__webpack_require__.o(installedChunks, chunkId)) { + installedChunkData = installedChunks[chunkId]; + if (installedChunkData !== 0) installedChunks[chunkId] = undefined; + if (installedChunkData) { + var errorType = + event && (event.type === 'load' ? 'missing' : event.type); + var realSrc = event && event.target && event.target.src; + error.message = + 'Loading chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + installedChunkData[1](error); + } + } + }; + __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); + } + } +} + + } + var currentUpdatedModulesList; +var waitingUpdateResolves = {}; +function loadUpdateChunk(chunkId, updatedModulesList) { + currentUpdatedModulesList = updatedModulesList; + return new Promise(function (resolve, reject) { + waitingUpdateResolves[chunkId] = resolve; + // start update chunk loading + var url = __webpack_require__.p + __webpack_require__.hu(chunkId); + // create error before stack unwound to get useful stacktrace later + var error = new Error(); + var loadingEnded = function (event) { + if (waitingUpdateResolves[chunkId]) { + waitingUpdateResolves[chunkId] = undefined; + var errorType = + event && (event.type === 'load' ? 'missing' : event.type); + var realSrc = event && event.target && event.target.src; + error.message = + 'Loading hot update chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + reject(error); + } + }; + __webpack_require__.l(url, loadingEnded); + }); +} + +self["webpackHotUpdate"] = function (chunkId, moreModules, runtime) { + for (var moduleId in moreModules) { + if (__webpack_require__.o(moreModules, moduleId)) { + currentUpdate[moduleId] = moreModules[moduleId]; + if (currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId); + } + } + if (runtime) currentUpdateRuntime.push(runtime); + if (waitingUpdateResolves[chunkId]) { + waitingUpdateResolves[chunkId](); + waitingUpdateResolves[chunkId] = undefined; + } +}; +var currentUpdateChunks; +var currentUpdate; +var currentUpdateRemovedChunks; +var currentUpdateRuntime; +function applyHandler(options) { + if (__webpack_require__.f) delete __webpack_require__.f.jsonpHmr; + currentUpdateChunks = undefined; + function getAffectedModuleEffects(updateModuleId) { + var outdatedModules = [updateModuleId]; + var outdatedDependencies = {}; + var queue = outdatedModules.map(function (id) { + return { + chain: [id], + id: id + }; + }); + while (queue.length > 0) { + var queueItem = queue.pop(); + var moduleId = queueItem.id; + var chain = queueItem.chain; + var module = __webpack_require__.c[moduleId]; + if ( + !module || + (module.hot._selfAccepted && !module.hot._selfInvalidated) + ) { + continue; + } + + if (module.hot._selfDeclined) { + return { + type: "self-declined", + chain: chain, + moduleId: moduleId + }; + } + + if (module.hot._main) { + return { + type: "unaccepted", + chain: chain, + moduleId: moduleId + }; + } + + for (var i = 0; i < module.parents.length; i++) { + var parentId = module.parents[i]; + var parent = __webpack_require__.c[parentId]; + if (!parent) { + continue; + } + if (parent.hot._declinedDependencies[moduleId]) { + return { + type: "declined", + chain: chain.concat([parentId]), + moduleId: moduleId, + parentId: parentId + }; + } + if (outdatedModules.indexOf(parentId) !== -1) { + continue; + } + if (parent.hot._acceptedDependencies[moduleId]) { + if (!outdatedDependencies[parentId]) { + outdatedDependencies[parentId] = []; + } + addAllToSet(outdatedDependencies[parentId], [moduleId]); + continue; + } + delete outdatedDependencies[parentId]; + outdatedModules.push(parentId); + queue.push({ + chain: chain.concat([parentId]), + id: parentId + }); + } + } + + return { + type: "accepted", + moduleId: updateModuleId, + outdatedModules: outdatedModules, + outdatedDependencies: outdatedDependencies + }; + } + + function addAllToSet(a, b) { + for (var i = 0; i < b.length; i++) { + var item = b[i]; + if (a.indexOf(item) === -1) a.push(item); + } + } + + var outdatedDependencies = {}; + var outdatedModules = []; + var appliedUpdate = {}; + + var warnUnexpectedRequire = function warnUnexpectedRequire(module) { + console.warn( + "[HMR] unexpected require(" + module.id + ") to disposed module" + ); + }; + + for (var moduleId in currentUpdate) { + if (__webpack_require__.o(currentUpdate, moduleId)) { + var newModuleFactory = currentUpdate[moduleId]; + var result; + if (newModuleFactory) { + result = getAffectedModuleEffects(moduleId); + } else { + result = { + type: "disposed", + moduleId: moduleId + }; + } + var abortError = false; + var doApply = false; + var doDispose = false; + var chainInfo = ""; + if (result.chain) { + chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); + } + switch (result.type) { + case "self-declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of self decline: " + result.moduleId + chainInfo + ); + break; + case "declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of declined dependency: " + + result.moduleId + + " in " + + result.parentId + + chainInfo + ); + break; + case "unaccepted": + if (options.onUnaccepted) options.onUnaccepted(result); + if (!options.ignoreUnaccepted) + abortError = new Error( + "Aborted because " + moduleId + " is not accepted" + chainInfo + ); + break; + case "accepted": + if (options.onAccepted) options.onAccepted(result); + doApply = true; + break; + case "disposed": + if (options.onDisposed) options.onDisposed(result); + doDispose = true; + break; + default: + throw new Error("Unexception type " + result.type); + } + if (abortError) { + return { + error: abortError + }; + } + if (doApply) { + appliedUpdate[moduleId] = newModuleFactory; + addAllToSet(outdatedModules, result.outdatedModules); + for (moduleId in result.outdatedDependencies) { + if (__webpack_require__.o(result.outdatedDependencies, moduleId)) { + if (!outdatedDependencies[moduleId]) + outdatedDependencies[moduleId] = []; + addAllToSet( + outdatedDependencies[moduleId], + result.outdatedDependencies[moduleId] + ); + } + } + } + if (doDispose) { + addAllToSet(outdatedModules, [result.moduleId]); + appliedUpdate[moduleId] = warnUnexpectedRequire; + } + } + } + currentUpdate = undefined; + + var outdatedSelfAcceptedModules = []; + for (var j = 0; j < outdatedModules.length; j++) { + var outdatedModuleId = outdatedModules[j]; + var module = __webpack_require__.c[outdatedModuleId]; + if ( + module && + (module.hot._selfAccepted || module.hot._main) && + // removed self-accepted modules should not be required + appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire && + // when called invalidate self-accepting is not possible + !module.hot._selfInvalidated + ) { + outdatedSelfAcceptedModules.push({ + module: outdatedModuleId, + require: module.hot._requireSelf, + errorHandler: module.hot._selfAccepted + }); + } + } + + var moduleOutdatedDependencies; + return { + dispose: function () { + currentUpdateRemovedChunks.forEach(function (chunkId) { + delete installedChunks[chunkId]; + }); + currentUpdateRemovedChunks = undefined; + + var idx; + var queue = outdatedModules.slice(); + while (queue.length > 0) { + var moduleId = queue.pop(); + var module = __webpack_require__.c[moduleId]; + if (!module) continue; + + var data = {}; + + // Call dispose handlers + var disposeHandlers = module.hot._disposeHandlers; + for (j = 0; j < disposeHandlers.length; j++) { + disposeHandlers[j].call(null, data); + } + __webpack_require__.hmrD[moduleId] = data; + + module.hot.active = false; + + delete __webpack_require__.c[moduleId]; + + delete outdatedDependencies[moduleId]; + + for (j = 0; j < module.children.length; j++) { + var child = __webpack_require__.c[module.children[j]]; + if (!child) continue; + idx = child.parents.indexOf(moduleId); + if (idx >= 0) { + child.parents.splice(idx, 1); + } + } + } + + var dependency; + for (var outdatedModuleId in outdatedDependencies) { + if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) { + module = __webpack_require__.c[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = outdatedDependencies[outdatedModuleId]; + for (j = 0; j < moduleOutdatedDependencies.length; j++) { + dependency = moduleOutdatedDependencies[j]; + idx = module.children.indexOf(dependency); + if (idx >= 0) module.children.splice(idx, 1); + } + } + } + } + }, + apply: function (reportError) { + // insert new code + for (var updateModuleId in appliedUpdate) { + if (__webpack_require__.o(appliedUpdate, updateModuleId)) { + __webpack_require__.m[updateModuleId] = appliedUpdate[updateModuleId]; + } + } + + // run new runtime modules + for (var i = 0; i < currentUpdateRuntime.length; i++) { + currentUpdateRuntime[i](__webpack_require__); + } + + // call accept handlers + for (var outdatedModuleId in outdatedDependencies) { + if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) { + var module = __webpack_require__.c[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = outdatedDependencies[outdatedModuleId]; + var callbacks = []; + var errorHandlers = []; + var dependenciesForCallbacks = []; + for (var j = 0; j < moduleOutdatedDependencies.length; j++) { + var dependency = moduleOutdatedDependencies[j]; + var acceptCallback = module.hot._acceptedDependencies[dependency]; + var errorHandler = module.hot._acceptedErrorHandlers[dependency]; + if (acceptCallback) { + if (callbacks.indexOf(acceptCallback) !== -1) continue; + callbacks.push(acceptCallback); + errorHandlers.push(errorHandler); + dependenciesForCallbacks.push(dependency); + } + } + for (var k = 0; k < callbacks.length; k++) { + try { + callbacks[k].call(null, moduleOutdatedDependencies); + } catch (err) { + if (typeof errorHandlers[k] === "function") { + try { + errorHandlers[k](err, { + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k] + }); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "accept-error-handler-errored", + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k], + error: err2, + originalError: err + }); + } + if (!options.ignoreErrored) { + reportError(err2); + reportError(err); + } + } + } else { + if (options.onErrored) { + options.onErrored({ + type: "accept-errored", + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k], + error: err + }); + } + if (!options.ignoreErrored) { + reportError(err); + } + } + } + } + } + } + } + + // Load self accepted modules + for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { + var item = outdatedSelfAcceptedModules[o]; + var moduleId = item.module; + try { + item.require(moduleId); + } catch (err) { + if (typeof item.errorHandler === "function") { + try { + item.errorHandler(err, { + moduleId: moduleId, + module: __webpack_require__.c[moduleId] + }); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-error-handler-errored", + moduleId: moduleId, + error: err2, + originalError: err + }); + } + if (!options.ignoreErrored) { + reportError(err2); + reportError(err); + } + } + } else { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-errored", + moduleId: moduleId, + error: err + }); + } + if (!options.ignoreErrored) { + reportError(err); + } + } + } + } + + return outdatedModules; + } + }; +} + +__webpack_require__.hmrI.jsonp = function (moduleId, applyHandlers) { + if (!currentUpdate) { + currentUpdate = {}; + currentUpdateRuntime = []; + currentUpdateRemovedChunks = []; + applyHandlers.push(applyHandler); + } + if (!__webpack_require__.o(currentUpdate, moduleId)) { + currentUpdate[moduleId] = __webpack_require__.m[moduleId]; + } +}; + +__webpack_require__.hmrC.jsonp = function ( + chunkIds, + removedChunks, + removedModules, + promises, + applyHandlers, + updatedModulesList +) { + applyHandlers.push(applyHandler); + currentUpdateChunks = {}; + currentUpdateRemovedChunks = removedChunks; + currentUpdate = removedModules.reduce(function (obj, key) { + obj[key] = false; + return obj; + }, {}); + currentUpdateRuntime = []; + chunkIds.forEach(function (chunkId) { + if ( + __webpack_require__.o(installedChunks, chunkId) && + installedChunks[chunkId] !== undefined + ) { + promises.push(loadUpdateChunk(chunkId, updatedModulesList)); + currentUpdateChunks[chunkId] = true; + } else { + currentUpdateChunks[chunkId] = false; + } + }); + if (__webpack_require__.f) { + __webpack_require__.f.jsonpHmr = function (chunkId, promises) { + if ( + currentUpdateChunks && + __webpack_require__.o(currentUpdateChunks, chunkId) && + !currentUpdateChunks[chunkId] + ) { + promises.push(loadUpdateChunk(chunkId)); + currentUpdateChunks[chunkId] = true; + } + }; + } +}; +__webpack_require__.hmrM = function () { + if (typeof fetch === "undefined") + throw new Error("No browser support: need fetch API"); + return fetch(__webpack_require__.p + __webpack_require__.hmrF()).then( + function (response) { + if (response.status === 404) return; // no update available + if (!response.ok) + throw new Error( + "Failed to fetch update manifest " + response.statusText + ); + return response.json(); + } + ); +}; +// install a JSONP callback for chunk loading +var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { + var chunkIds = data[0]; + var moreModules = data[1]; + var runtime = data[2]; + // add "moreModules" to the modules object, + // then flag all "chunkIds" as loaded and fire callback + var moduleId, + chunkId, + i = 0; + if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { + for (moduleId in moreModules) { + if (__webpack_require__.o(moreModules, moduleId)) { + __webpack_require__.m[moduleId] = moreModules[moduleId]; + } + } + if (runtime) var result = runtime(__webpack_require__); + } + if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); + for (; i < chunkIds.length; i++) { + chunkId = chunkIds[i]; + if ( + __webpack_require__.o(installedChunks, chunkId) && + installedChunks[chunkId] + ) { + installedChunks[chunkId][0](); + } + installedChunks[chunkId] = 0; + } + +}; + +var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +chunkLoadingGlobal.push = webpackJsonpCallback.bind( + null, + chunkLoadingGlobal.push.bind(chunkLoadingGlobal) +); + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..9cdadbe910a --- /dev/null +++ b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/0.snap.txt @@ -0,0 +1,14 @@ +# Case remove-chunk-with-shared: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 37853 +- Bundle: chunk1_js.chunk.CURRENT_HASH.js, size: 953 +- Bundle: chunk2_js.chunk.CURRENT_HASH.js, size: 953 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..b6565d99d76 --- /dev/null +++ b/packages/rspack/tests/hotCases/disposing/remove-chunk-with-shared/snapshot/web/1.snap.txt @@ -0,0 +1,52 @@ +# Case remove-chunk-with-shared: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 37739 +- Bundle: chunk1_js.chunk.CURRENT_HASH.js, size: 953 +- Manifest: main.LAST_HASH.hot-update.json, size: 52 +- Update: main.LAST_HASH.hot-update.js, size: 426 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["chunk2_js"],"m":["./chunk2.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (42); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..d5f366a9b75 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case decline-webpackhot: Step 0 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34663 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..6fb0316ea60 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/decline-webpackhot/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case decline-webpackhot: Step 1 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34663 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/decline/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/decline/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..f345012cdff --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/decline/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case decline: Step 0 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34663 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/decline/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/decline/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..e4875e87080 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/decline/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case decline: Step 1 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34663 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/events/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/events/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..91e38834ac5 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/events/snapshot/web/0.snap.txt @@ -0,0 +1,18 @@ +# Case events: Step 0 + +## Changed Files +- a.js +- c.js +- e.js +- g.js +- i.js +- j.js +- l.js + +## Asset Files +- Bundle: bundle.js, size: 41858 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/events/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/events/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..154fea43387 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/events/snapshot/web/1.snap.txt @@ -0,0 +1,96 @@ +# Case events: Step 1 + +## Changed Files +- a.js +- c.js +- e.js +- g.js +- i.js +- j.js +- l.js + +## Asset Files +- Bundle: bundle.js, size: 41890 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 1881 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js +- ./c.js +- ./e.js +- ./g.js +- ./i.js +- ./j.js +- ./l.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./e.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./g.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./i.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +throw new Error("Error while loading module i"); +}), +"./j.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +throw new Error("Error while loading module j"); +}), +"./l.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +throw new Error("Error while loading module l"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..b5643e6c068 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case self-decline: Step 0 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34592 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c70bad8b1f7 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/self-decline/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case self-decline: Step 1 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34592 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..6ab0bb91b88 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case unaccepted-ignored: Step 0 + +## Changed Files +- a.js +- c.js + +## Asset Files +- Bundle: bundle.js, size: 35173 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..635a342cca2 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/1.snap.txt @@ -0,0 +1,52 @@ +# Case unaccepted-ignored: Step 1 + +## Changed Files +- a.js +- c.js + +## Asset Files +- Bundle: bundle.js, size: 35173 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..b454525824a --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/2.snap.txt @@ -0,0 +1,52 @@ +# Case unaccepted-ignored: Step 2 + +## Changed Files +- a.js +- c.js + +## Asset Files +- Bundle: bundle.js, size: 35173 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..0a7bf904521 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted-ignored/snapshot/web/3.snap.txt @@ -0,0 +1,58 @@ +# Case unaccepted-ignored: Step 3 + +## Changed Files +- a.js +- c.js + +## Asset Files +- Bundle: bundle.js, size: 35173 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 639 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (4); +}), +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..5cb7824e360 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case unaccepted: Step 0 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34597 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..78a56efdc69 --- /dev/null +++ b/packages/rspack/tests/hotCases/errors/unaccepted/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case unaccepted: Step 1 + +## Changed Files +- c.js + +## Asset Files +- Bundle: bundle.js, size: 34597 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 420 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./c.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./c.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..ec2cf71303e --- /dev/null +++ b/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case import-meta-webpack-hot: Step 0 + +## Changed Files +- node_modules/dep1/file.js + +## Asset Files +- Bundle: bundle.js, size: 34639 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..2768b4b3a9e --- /dev/null +++ b/packages/rspack/tests/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case import-meta-webpack-hot: Step 1 + +## Changed Files +- node_modules/dep1/file.js + +## Asset Files +- Bundle: bundle.js, size: 34639 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 476 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./node_modules/dep1/file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./node_modules/dep1/file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..0955991bf23 --- /dev/null +++ b/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case module-hot: Step 0 + +## Changed Files +- node_modules/dep1/file.js + +## Asset Files +- Bundle: bundle.js, size: 34879 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..ff977177205 --- /dev/null +++ b/packages/rspack/tests/hotCases/esm-dependency-import/module-hot/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case module-hot: Step 1 + +## Changed Files +- node_modules/dep1/file.js + +## Asset Files +- Bundle: bundle.js, size: 34879 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 476 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./node_modules/dep1/file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./node_modules/dep1/file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..a9ea7e015bd --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case auto-import-default: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34517 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..413ab87d6bf --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import-default/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case auto-import-default: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34517 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..442d38e02a5 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case auto-import-multiple: Step 0 + +## Changed Files +- file.js +- commonjs.js + +## Asset Files +- Bundle: bundle.js, size: 35270 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..188952951cc --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import-multiple/snapshot/web/1.snap.txt @@ -0,0 +1,59 @@ +# Case auto-import-multiple: Step 1 + +## Changed Files +- file.js +- commonjs.js + +## Asset Files +- Bundle: bundle.js, size: 35270 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 521 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./commonjs.js +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./commonjs.js": (function (module) { +module.exports = 20; +}), +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..c276c4fd439 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case auto-import: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34028 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..8164f56f3d6 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-import/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case auto-import: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34028 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 458 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..d0901cd9cd1 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case auto-reexport: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34272 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..dc5557c4695 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/auto-reexport/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case auto-reexport: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34272 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 460 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..7e70c9d0fc8 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case cjs-analyze-changed: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33843 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..884681f1c23 --- /dev/null +++ b/packages/rspack/tests/hotCases/harmony/cjs-analyze-changed/snapshot/web/1.snap.txt @@ -0,0 +1,60 @@ +# Case cjs-analyze-changed: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33906 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 720 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js +- ./reexport.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, exports) { +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = 1; +}), +"./reexport.js": (function (module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */var _file__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./file */"./file.js"); + +/* harmony default export */ __webpack_exports__["default"] = (_file__WEBPACK_IMPORTED_MODULE_0__["default"]); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..40cfbca2839 --- /dev/null +++ b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case hot-index: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33829 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c2ed4798721 --- /dev/null +++ b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case hot-index: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33829 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..b07f26921e9 --- /dev/null +++ b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/2.snap.txt @@ -0,0 +1,51 @@ +# Case hot-index: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33829 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..c22d880e916 --- /dev/null +++ b/packages/rspack/tests/hotCases/hash/hot-index/snapshot/web/3.snap.txt @@ -0,0 +1,51 @@ +# Case hot-index: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33829 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..40f554656fb --- /dev/null +++ b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case conditional-accept: Step 0 + +## Changed Files +- data.json + +## Asset Files +- Bundle: bundle.js, size: 38722 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..9942651ec78 --- /dev/null +++ b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case conditional-accept: Step 1 + +## Changed Files +- data.json + +## Asset Files +- Bundle: bundle.js, size: 38722 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 285 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./data.json + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./data.json": (function (module) { +"use strict"; +module.exports = {"a":2,"b":1}}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..36821cb9409 --- /dev/null +++ b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/2.snap.txt @@ -0,0 +1,49 @@ +# Case conditional-accept: Step 2 + +## Changed Files +- data.json + +## Asset Files +- Bundle: bundle.js, size: 38722 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 285 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./data.json + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./data.json": (function (module) { +"use strict"; +module.exports = {"a":2,"b":2}}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..a18e3425da1 --- /dev/null +++ b/packages/rspack/tests/hotCases/invalidate/conditional-accept/snapshot/web/3.snap.txt @@ -0,0 +1,49 @@ +# Case conditional-accept: Step 3 + +## Changed Files +- data.json + +## Asset Files +- Bundle: bundle.js, size: 38722 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 285 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./data.json + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./data.json": (function (module) { +"use strict"; +module.exports = {"a":3,"b":3}}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..a5afdc103e7 --- /dev/null +++ b/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case auto-reexport: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34292 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..e6d91a6356c --- /dev/null +++ b/packages/rspack/tests/hotCases/newTreeshaking/auto-reexport/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case auto-reexport: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34292 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 460 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/newTreeshaking/multi-chunk-single-runtime/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/newTreeshaking/multi-chunk-single-runtime/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..90923dbe231 --- /dev/null +++ b/packages/rspack/tests/hotCases/newTreeshaking/multi-chunk-single-runtime/snapshot/web/0.snap.txt @@ -0,0 +1,16 @@ +# Case multi-chunk-single-runtime: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: a.js, size: 900 +- Bundle: b.js, size: 900 +- Bundle: main.js, size: 1637 +- Bundle: main_async_js.chunk.CURRENT_HASH.js, size: 122 +- Bundle: runtime.js, size: 38850 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..6b2baed6167 --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case banner: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34751 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..d4b6503e92e --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/1.snap.txt @@ -0,0 +1,55 @@ +# Case banner: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34751 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 550 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +global.bannerIndex = typeof global.bannerIndex === 'number' ? global.bannerIndex + 1 : 0; +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 1; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..40fbb3bf624 --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/2.snap.txt @@ -0,0 +1,55 @@ +# Case banner: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34751 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 550 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +global.bannerIndex = typeof global.bannerIndex === 'number' ? global.bannerIndex + 1 : 0; +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..3df7872623f --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/banner/snapshot/web/3.snap.txt @@ -0,0 +1,55 @@ +# Case banner: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34751 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 550 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +global.bannerIndex = typeof global.bannerIndex === 'number' ? global.bannerIndex + 1 : 0; +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 3; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/html/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/plugins/html/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..e92cb759a4b --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/html/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case html: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34137 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/plugins/html/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/plugins/html/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c3121c311cf --- /dev/null +++ b/packages/rspack/tests/hotCases/plugins/html/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case html: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 34137 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 460 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +const value = 1; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..3ebc6b150df --- /dev/null +++ b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case recover-after-self-error: Step 0 + +## Changed Files +- a.js + +## Asset Files +- Bundle: bundle.js, size: 35117 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..4bfffcf2173 --- /dev/null +++ b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/1.snap.txt @@ -0,0 +1,64 @@ +# Case recover-after-self-error: Step 1 + +## Changed Files +- a.js + +## Asset Files +- Bundle: bundle.js, size: 34882 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 766 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + getError: function() { return getError; }, + id: function() { return id; } +}); +module.hot.data.store.error = false; +module.hot.data.store.value = 2; +/* harmony default export */ __webpack_exports__["default"] = ((()=>{ + throw new Error("should not happen"); +})); +const getError = ()=>{ + throw new Error("should not happen"); +}; +const id = module.id; +throw new Error("Failed"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..39d40a90a7c --- /dev/null +++ b/packages/rspack/tests/hotCases/recover/recover-after-self-error/snapshot/web/3.snap.txt @@ -0,0 +1,74 @@ +# Case recover-after-self-error: Step 3 + +## Changed Files +- a.js + +## Asset Files +- Bundle: bundle.js, size: 34855 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 1092 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js + +#### Changed Runtime Modules +- webpack/runtime/define_property_getters +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + getError: function() { return getError; }, + id: function() { return id; } +}); +module.hot.data.store.error = false; +module.hot.data.store.value = 4; +/* harmony default export */ __webpack_exports__["default"] = ((()=>{ + throw new Error("should not happen"); +})); +const getError = ()=>{ + throw new Error("should not happen"); +}; +const id = module.id; +}), + +},function(__webpack_require__) { +// webpack/runtime/define_property_getters +!function() { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +}(); +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..e8bfe0c4ab4 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case accept: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32777 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..274ebe2336a --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/accept/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case accept: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32777 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..4900b08fa45 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case bubble-async: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 39875 +- Bundle: file_js.chunk.CURRENT_HASH.js, size: 136 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c948ee710db --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/bubble-async/snapshot/web/1.snap.txt @@ -0,0 +1,69 @@ +# Case bubble-async: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 39875 +- Bundle: file_js.chunk.CURRENT_HASH.js, size: 136 +- Manifest: main.LAST_HASH.hot-update.json, size: 38 +- Update: file_js.LAST_HASH.hot-update.js, size: 100 +- Update: main.LAST_HASH.hot-update.js, size: 201 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main","file_js"],"r":[],"m":[]} +``` + + +## Update + + +### file_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('file_js', { +"./file.js": (function (module) { +module.exports = 2; +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..66873c1d755 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case bubble-update: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32899 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c7a231462dd --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/bubble-update/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case bubble-update: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32899 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..16b28b73678 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case circular: Step 0 + +## Changed Files +- a.js +- b.js + +## Asset Files +- Bundle: bundle.js, size: 34144 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..25b534eedbb --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/circular/snapshot/web/1.snap.txt @@ -0,0 +1,62 @@ +# Case circular: Step 1 + +## Changed Files +- a.js +- b.js + +## Asset Files +- Bundle: bundle.js, size: 33911 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 841 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js +- ./b.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ */"./index.js"); +/* harmony import */var _b__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./b */"./b.js"); + + +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./b.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..c1c3cb25605 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/0.snap.txt @@ -0,0 +1,15 @@ +# Case dispose-removed-chunk: Step 0 + +## Changed Files +- module.js +- a.js +- b.js + +## Asset Files +- Bundle: a_js.CURRENT_HASH.js, size: 305 +- Bundle: bundle.js, size: 37954 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..1cb636731bb --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case dispose-removed-chunk: Step 1 + +## Changed Files +- module.js +- a.js +- b.js + +## Asset Files +- Bundle: b_js.CURRENT_HASH.js, size: 305 +- Bundle: bundle.js, size: 37937 +- Manifest: main.LAST_HASH.hot-update.json, size: 42 +- Update: main.LAST_HASH.hot-update.js, size: 525 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["a_js"],"m":["./a.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.e("b_js").then(__webpack_require__.bind(__webpack_require__, /*! ./b */"./b.js"))); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..ce182b69801 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/2.snap.txt @@ -0,0 +1,73 @@ +# Case dispose-removed-chunk: Step 2 + +## Changed Files +- module.js +- a.js +- b.js + +## Asset Files +- Bundle: b_js.CURRENT_HASH.js, size: 305 +- Bundle: bundle.js, size: 37937 +- Manifest: main.LAST_HASH.hot-update.json, size: 35 +- Update: b_js.LAST_HASH.hot-update.js, size: 269 +- Update: main.LAST_HASH.hot-update.js, size: 201 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main","b_js"],"r":[],"m":[]} +``` + + +## Update + + +### b_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./b.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('b_js', { +"./b.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ("version b2"); +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..97e8e6e344a --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-chunk/snapshot/web/3.snap.txt @@ -0,0 +1,54 @@ +# Case dispose-removed-chunk: Step 3 + +## Changed Files +- module.js +- a.js +- b.js + +## Asset Files +- Bundle: a_js.CURRENT_HASH.js, size: 305 +- Bundle: bundle.js, size: 37954 +- Manifest: main.LAST_HASH.hot-update.json, size: 42 +- Update: main.LAST_HASH.hot-update.js, size: 525 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["b_js"],"m":["./b.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.e("a_js").then(__webpack_require__.bind(__webpack_require__, /*! ./a */"./a.js"))); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..d2bfc52fe3a --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case dispose-removed-module: Step 0 + +## Changed Files +- module.js +- a.js + +## Asset Files +- Bundle: bundle.js, size: 34424 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..b0d85730c71 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/1.snap.txt @@ -0,0 +1,59 @@ +# Case dispose-removed-module: Step 1 + +## Changed Files +- module.js +- a.js + +## Asset Files +- Bundle: bundle.js, size: 33761 +- Manifest: main.LAST_HASH.hot-update.json, size: 36 +- Update: main.LAST_HASH.hot-update.js, size: 677 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./a.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./b.js +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./b.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */var _b__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./b */"./b.js"); + +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..0fad9d351a1 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/dispose-removed-module/snapshot/web/2.snap.txt @@ -0,0 +1,73 @@ +# Case dispose-removed-module: Step 2 + +## Changed Files +- module.js +- a.js + +## Asset Files +- Bundle: bundle.js, size: 34253 +- Manifest: main.LAST_HASH.hot-update.json, size: 36 +- Update: main.LAST_HASH.hot-update.js, size: 1169 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./b.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/define_property_getters +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (module.id); +}), +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* reexport safe */ _a__WEBPACK_IMPORTED_MODULE_0__["default"]; } +}); +/* harmony import */var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */"./a.js"); + +}), + +},function(__webpack_require__) { +// webpack/runtime/define_property_getters +!function() { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +}(); +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..21032a5a8de --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case hmr-circular: Step 0 + +## Changed Files +- entry.js + +## Asset Files +- Bundle: bundle.js, size: 34332 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..6654d503a90 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/hmr-circular/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case hmr-circular: Step 1 + +## Changed Files +- entry.js + +## Asset Files +- Bundle: bundle.js, size: 33588 +- Manifest: main.LAST_HASH.hot-update.json, size: 45 +- Update: main.LAST_HASH.hot-update.js, size: 437 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./a.js","./b.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./entry.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./entry.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ("new_entry.js"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..f5e359424ac --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/0.snap.txt @@ -0,0 +1,15 @@ +# Case import-after-download: Step 0 + +## Changed Files +- file.js +- inner.js + +## Asset Files +- Bundle: bundle.js, size: 37950 +- Bundle: chunk_js.CURRENT_HASH.js, size: 877 +- Bundle: unaffected-chunk_js.CURRENT_HASH.js, size: 1009 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..ca53ec959fd --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/import-after-download/snapshot/web/1.snap.txt @@ -0,0 +1,78 @@ +# Case import-after-download: Step 1 + +## Changed Files +- file.js +- inner.js + +## Asset Files +- Bundle: bundle.js, size: 37950 +- Bundle: chunk_js.CURRENT_HASH.js, size: 877 +- Bundle: unaffected-chunk_js.CURRENT_HASH.js, size: 1009 +- Manifest: main.LAST_HASH.hot-update.json, size: 39 +- Update: chunk_js.LAST_HASH.hot-update.js, size: 267 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main","chunk_js"],"r":[],"m":[]} +``` + + +## Update + + +### chunk_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./inner.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('chunk_js', { +"./inner.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (20); +}), + +}); +``` + + + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..912841d541f --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case replace-runtime-module: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: a.chunk.CURRENT_HASH.js, size: 293 +- Bundle: bundle.js, size: 37355 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..fae30c7c4ce --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/replace-runtime-module/snapshot/web/1.snap.txt @@ -0,0 +1,52 @@ +# Case replace-runtime-module: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: b.chunk.CURRENT_HASH.js, size: 293 +- Bundle: bundle.js, size: 37355 +- Manifest: main.LAST_HASH.hot-update.json, size: 39 +- Update: main.LAST_HASH.hot-update.js, size: 522 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["a"],"m":["./a.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.e("b").then(__webpack_require__.bind(__webpack_require__, /*! ./b */"./b.js"))); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..7acf52bb857 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case require-disposed-module-warning: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 34868 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..fe464a60a5b --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/require-disposed-module-warning/snapshot/web/1.snap.txt @@ -0,0 +1,55 @@ +# Case require-disposed-module-warning: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 34284 +- Manifest: main.LAST_HASH.hot-update.json, size: 36 +- Update: main.LAST_HASH.hot-update.js, size: 571 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":["./a.js"]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./b.js +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./b.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ("b"); +}), +"./module.js": (function (module, __unused_webpack_exports, __webpack_require__) { +module.exports = ()=>__webpack_require__(/*! ./b */"./b.js"); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..b6e860e20b0 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case self-accept-and-dispose: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32645 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..e3844496593 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/self-accept-and-dispose/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case self-accept-and-dispose: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32514 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 267 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.hot.data.callback(); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..2d598b10b7e --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case self-accept-factory: Step 0 + +## Changed Files +- a.js + +## Asset Files +- Bundle: bundle.js, size: 33139 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..f2e6f6047e5 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/self-accept-factory/snapshot/web/1.snap.txt @@ -0,0 +1,56 @@ +# Case self-accept-factory: Step 1 + +## Changed Files +- a.js + +## Asset Files +- Bundle: bundle.js, size: 33157 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 525 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./a.js +- ./b.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./a.js": (function (module, __unused_webpack_exports, __webpack_require__) { +/* module decorator */ module = __webpack_require__.nmd(module); +__webpack_require__(/*! ./hot */"./hot.js")(module); +__webpack_require__(/*! ./b */"./b.js"); +module.hot.data.callback(); +}), +"./b.js": (function (module) { +module.exports = 1; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..1db0ae4edd9 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/0.snap.txt @@ -0,0 +1,13 @@ +# Case update-multiple-modules: Step 0 + +## Changed Files +- fileA.js +- fileB.js + +## Asset Files +- Bundle: bundle.js, size: 33013 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..e47ce9a8dcb --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-modules/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case update-multiple-modules: Step 1 + +## Changed Files +- fileA.js +- fileB.js + +## Asset Files +- Bundle: bundle.js, size: 33013 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 319 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./fileA.js +- ./fileB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./fileA.js": (function (module) { +module.exports = 2; +}), +"./fileB.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..d8f8f7c729d --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case update-multiple-times: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..52066387bb4 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case update-multiple-times: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..ca8680492b9 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/2.snap.txt @@ -0,0 +1,49 @@ +# Case update-multiple-times: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 3; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..0293f0fcda4 --- /dev/null +++ b/packages/rspack/tests/hotCases/runtime/update-multiple-times/snapshot/web/3.snap.txt @@ -0,0 +1,49 @@ +# Case update-multiple-times: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 32839 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 4; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..b2b6230cdda --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case disable: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35293 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..5ecf0c5ca1d --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/1.snap.txt @@ -0,0 +1,51 @@ +# Case disable: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35293 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..994982270f3 --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/2.snap.txt @@ -0,0 +1,51 @@ +# Case disable: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35293 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..4817351acf7 --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/disable/snapshot/web/3.snap.txt @@ -0,0 +1,51 @@ +# Case disable: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35293 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 423 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..356f610c6ff --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case enable: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35323 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c089571d04d --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/1.snap.txt @@ -0,0 +1,52 @@ +# Case enable: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35323 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 488 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +//# sourceMappingURL=main.LAST_HASH.hot-update.js.map +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..64c75581373 --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/2.snap.txt @@ -0,0 +1,52 @@ +# Case enable: Step 2 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35323 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 488 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +//# sourceMappingURL=main.LAST_HASH.hot-update.js.map +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..c27c6a219b4 --- /dev/null +++ b/packages/rspack/tests/hotCases/source-map/enable/snapshot/web/3.snap.txt @@ -0,0 +1,52 @@ +# Case enable: Step 3 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 35323 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 488 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +//# sourceMappingURL=main.LAST_HASH.hot-update.js.map +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/status/accept/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/status/accept/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..7076534b4bf --- /dev/null +++ b/packages/rspack/tests/hotCases/status/accept/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case accept: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33494 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/status/accept/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/status/accept/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c7f936de35c --- /dev/null +++ b/packages/rspack/tests/hotCases/status/accept/snapshot/web/1.snap.txt @@ -0,0 +1,49 @@ +# Case accept: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33494 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 259 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (module) { +module.exports = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/status/check/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/status/check/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..1641fdb041f --- /dev/null +++ b/packages/rspack/tests/hotCases/status/check/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case check: Step 0 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33605 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/status/check/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/status/check/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..f0f7fa1585f --- /dev/null +++ b/packages/rspack/tests/hotCases/status/check/snapshot/web/1.snap.txt @@ -0,0 +1,54 @@ +# Case check: Step 1 + +## Changed Files +- file.js + +## Asset Files +- Bundle: bundle.js, size: 33605 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 458 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./file.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./file.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + value: function() { return value; } +}); +var value = 2; +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..3318b3f4515 --- /dev/null +++ b/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/0.snap.txt @@ -0,0 +1,12 @@ +# Case used-exports: Step 0 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 34718 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..c0f2b5ddba0 --- /dev/null +++ b/packages/rspack/tests/hotCases/unexpected-invalidation/used-exports/snapshot/web/1.snap.txt @@ -0,0 +1,55 @@ +# Case used-exports: Step 1 + +## Changed Files +- module.js + +## Asset Files +- Bundle: bundle.js, size: 34718 +- Manifest: main.LAST_HASH.hot-update.json, size: 28 +- Update: main.LAST_HASH.hot-update.js, size: 623 + +## Manifest + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":[],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules +- ./module.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { +"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* reexport safe */ _subject__WEBPACK_IMPORTED_MODULE_0__.def; } +}); +/* harmony import */var _subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subject */"./subject.js"); + +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/0.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/0.snap.txt new file mode 100644 index 00000000000..a6cdbac2856 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/0.snap.txt @@ -0,0 +1,18 @@ +# Case issue-5597: Step 0 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 + +## Manifest + + +## Update \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/1.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/1.snap.txt new file mode 100644 index 00000000000..6084648abd9 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/1.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 1 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["workerA_js","main"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","workerA_js","shared"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (1); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/2.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/2.snap.txt new file mode 100644 index 00000000000..8269f82944f --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/2.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 2 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (2); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/3.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/3.snap.txt new file mode 100644 index 00000000000..d3364345154 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/3.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 3 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (3); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/4.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/4.snap.txt new file mode 100644 index 00000000000..abee26612ec --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/4.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 4 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (4); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (4); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (4); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (4); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/5.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/5.snap.txt new file mode 100644 index 00000000000..798b0fa59e5 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/5.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 5 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (5); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (5); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (5); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (5); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/6.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/6.snap.txt new file mode 100644 index 00000000000..b88353da2b8 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/6.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 6 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (6); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (6); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (6); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (6); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file diff --git a/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/7.snap.txt b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/7.snap.txt new file mode 100644 index 00000000000..56a77ecb1d2 --- /dev/null +++ b/packages/rspack/tests/hotCases/worker/issue-5597/snapshot/web/7.snap.txt @@ -0,0 +1,168 @@ +# Case issue-5597: Step 7 + +## Changed Files +- moduleA.js +- moduleAs.js +- moduleB.js +- moduleBs.js + +## Asset Files +- Bundle: main.CURRENT_HASH.js, size: 33255 +- Bundle: shared.chunk.CURRENT_HASH.js, size: 529 +- Bundle: workerA_js.chunk.CURRENT_HASH.js, size: 28670 +- Bundle: workerB_js.chunk.CURRENT_HASH.js, size: 28670 +- Manifest: [runtime of workerA_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: [runtime of workerB_js].LAST_HASH.hot-update.json, size: 62 +- Manifest: main.LAST_HASH.hot-update.json, size: 62 +- Update: main.LAST_HASH.hot-update.js, size: 201 +- Update: shared.LAST_HASH.hot-update.js, size: 493 +- Update: workerA_js.LAST_HASH.hot-update.js, size: 432 +- Update: workerB_js.LAST_HASH.hot-update.js, size: 432 + +## Manifest + +### [runtime of workerA_js].LAST_HASH.hot-update.json + +```json +{"c":["workerA_js","shared"],"r":["workerB_js","main"],"m":[]} +``` + + + +### [runtime of workerB_js].LAST_HASH.hot-update.json + +```json +{"c":["workerB_js","shared"],"r":["main","workerA_js"],"m":[]} +``` + + + +### main.LAST_HASH.hot-update.json + +```json +{"c":["main"],"r":["workerB_js","shared","workerA_js"],"m":[]} +``` + + +## Update + + +### main.LAST_HASH.hot-update.js + +#### Changed Modules + + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('main', { + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### shared.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleAs.js +- ./moduleBs.js + +#### Changed Runtime Modules + + +#### Changed Content +```js +self["webpackHotUpdate"]('shared', { +"./moduleAs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (7); +}), +"./moduleBs.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (7); +}), + +}); +``` + + + + +### workerA_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleA.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerA_js', { +"./moduleA.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (7); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` + + + + +### workerB_js.LAST_HASH.hot-update.js + +#### Changed Modules +- ./moduleB.js + +#### Changed Runtime Modules +- webpack/runtime/get_full_hash + +#### Changed Content +```js +self["webpackHotUpdate"]('workerB_js', { +"./moduleB.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (7); +}), + +},function(__webpack_require__) { +// webpack/runtime/get_full_hash +!function() { +__webpack_require__.h = function () { + return "CURRENT_HASH"; +}; + +}(); + +} +); +``` \ No newline at end of file