-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
I am writing somewhat large app with Qwik and when I tried to update it, the pnpm run build.client generates about 500-600 chunks but they have almost different hash from the previous output.
When I would take a rolling update of the app, the existing app running in the browser experiences failure of dynamic import against the previous chunks, because they are no longer exist at that place after the update.
I wanted to make the experience seamless during the app update.
How can I include the previous chunks into the newly generated ones and merge the newer and older q-manifest?
[Updated] I added a reproduction.
Reproduction
https://github.com/genki/qwik-test/tree/fragile_hash_test
Steps to reproduce
Please clone the repo above and install packages then run many times (I expect 10〜20 times)
pnpm run build.client
Please looking into the hash of the last chunk, the largest file.
Because of this reproduction is very smaller than the real case, the result is mostly same hash.
But sometimes it changes, even if no code change has included.
I have attached the case of generated different bundle at under the ./tmp
https://github.com/genki/qwik-test/tree/fragile_hash_test/tmp
Those 2 files are the largest chunks from different 2 builds that are from the same source without any modification.
They are mostly same, but there are small diff like this:
4934c4934
< const Layout = () => __vitePreload(() => import("./q-VBnW36aw.js"), true ? [] : void 0);
---
> const Layout = () => __vitePreload(() => import("./q-ywWxxcYW.js"), true ? [] : void 0);
4939c4939
< const e = () => __vitePreload(() => import("./q-BNyqOpV5.js"), true ? [] : void 0);
---
> const e = () => __vitePreload(() => import("./q-C0bxF2sP.js"), true ? [] : void 0);
5311,5313d5310
< };
< const s_VKFlAWJuVm8 = () => {
< return /* @__PURE__ */ _jsxC(Slot, null, 3, "yB_0");
5350a5348,5350
> const s_VKFlAWJuVm8 = () => {
> return /* @__PURE__ */ _jsxC(Slot, null, 3, "yB_0");
> };
5377,5378c5377,5378
< s_VKFlAWJuVm8 as x,
< s_B0lqk5IDDy4 as y,
---
> s_B0lqk5IDDy4 as x,
> s_VKFlAWJuVm8 as y,System Info
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M2
Memory: 75.95 MB / 24.00 GB
Shell: 3.6.1 - /opt/homebrew/bin/fish
Binaries:
Node: 20.18.1 - /opt/homebrew/opt/node@20/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.9.4 - ~/project/jotter/node_modules/.bin/npm
pnpm: 9.11.0 - /opt/homebrew/bin/pnpm
bun: 1.1.26 - ~/.bun/bin/bun
Browsers:
Chrome: 131.0.6778.205
Safari: 17.6
npmPackages:
@builder.io/qwik: file:../clone/qwik/packages/qwik => 1.10.0
@builder.io/qwik-city: file:../clone/qwik/packages/qwik-city => 1.10.0
typescript: ^5.4.5 => 5.4.5
undici: ^5.28.4 => 5.28.4
vite: ^5.4.11 => 5.4.11Additional Information
In addition, when the app size is larger, the pnpm run build.client generates almost different hashes even if there's no changes in the source code. Is this expected behaviour?