Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preload marker duplicate deps #14955

Merged
merged 1 commit into from
Nov 12, 2023

Conversation

sapphi-red
Copy link
Member

Description

There was duplicate deps in the preload file map. I found this while playing around with https://github.com/sveltejs/realworld.

Before this PR (aboslute paths and relative paths are both included)

// dynamic import part
const me = [
  () => h(() => import("../nodes/0.peO1MZqH.js"), __vite__mapDeps([6, 7, 8, 9, 10, 11]), import.meta.url),
  () => h(() => import("../nodes/1.yj2RaMOm.js"), __vite__mapDeps([14, 7, 8, 9, 10, 15]), import.meta.url),
  () => h(() => import("../nodes/2.mfK819Jq.js"), __vite__mapDeps([19, 7, 8, 20, 21, 10, 9]), import.meta.url),
  () => h(() => import("../nodes/3.gILlYQ84.js"), __vite__mapDeps([25, 7, 8, 26, 9, 10, 27, 20, 21]), import.meta.url),
  () => h(() => import("../nodes/4.cffNQBmV.js"), __vite__mapDeps([30, 7, 8, 26, 20, 21, 10, 31]), import.meta.url),
  () => h(() => import("../nodes/5.rZzXnlgv.js"), __vite__mapDeps([36, 7, 8, 37, 26, 20, 21, 10, 38, 39]), import.meta.url),
  () => h(() => import("../nodes/6.8WmZqfo5.js"), __vite__mapDeps([41, 7, 8, 37, 26, 20, 21, 10, 38, 39]), import.meta.url),
  () => h(() => import("../nodes/7.3QlByPOI.js"), __vite__mapDeps([43, 7, 8, 20, 21, 10, 38, 26]), import.meta.url),
  () => h(() => import("../nodes/8.XIVZlf1k.js"), __vite__mapDeps([46, 47, 7, 8]), import.meta.url),
  () => h(() => import("../nodes/9.sEE7yWoc.js"), __vite__mapDeps([49, 7, 8, 27, 26, 9, 10, 20, 21]), import.meta.url),
  () => h(() => import("../nodes/10.sEE7yWoc.js"), __vite__mapDeps([51, 7, 8, 27, 26, 9, 10, 20, 21]), import.meta.url),
  () => h(() => import("../nodes/11.YrP9Gsnh.js"), __vite__mapDeps([53, 7, 8, 20, 21, 10, 38, 26]), import.meta.url),
  () => h(() => import("../nodes/12.Mq-T7hyV.js"), __vite__mapDeps([55, 7, 8, 20, 21, 10, 38, 26]), import.meta.url),
];

// `__vite__mapDeps` file map
[
  "_app/immutable/nodes/0.peO1MZqH.js",
  "_app/immutable/chunks/scheduler.NGrPFcO6.js",
  "_app/immutable/chunks/index.7XI06WsH.js",
  "_app/immutable/chunks/stores.Jvx6wfk2.js",
  "_app/immutable/chunks/singletons.YrYVt0PW.js",
  "_app/immutable/assets/nodes/0.7WPj3p_i.css",
  "..\\nodes\\0.peO1MZqH.js",
  "..\\chunks\\scheduler.NGrPFcO6.js",
  "..\\chunks\\index.7XI06WsH.js",
  "..\\chunks\\stores.Jvx6wfk2.js",
  "..\\chunks\\singletons.YrYVt0PW.js",
  "..\\assets\\nodes\\0.7WPj3p_i.css",
  "_app/immutable/nodes/1.yj2RaMOm.js",
  "_app/immutable/assets/nodes/1.6h4Hr9rg.css",
  "..\\nodes\\1.yj2RaMOm.js",
  "..\\assets\\nodes\\1.6h4Hr9rg.css",
  "_app/immutable/nodes/2.mfK819Jq.js",
  "_app/immutable/chunks/forms.Jw4xgZaT.js",
  "_app/immutable/chunks/parse.ubpsR57U.js",
  "..\\nodes\\2.mfK819Jq.js",
  "..\\chunks\\forms.Jw4xgZaT.js",
  "..\\chunks\\parse.ubpsR57U.js",
  "_app/immutable/nodes/3.gILlYQ84.js",
  "_app/immutable/chunks/each.nITJrLU4.js",
  "_app/immutable/chunks/index.jao9IRKz.js",
  "..\\nodes\\3.gILlYQ84.js",
  "..\\chunks\\each.nITJrLU4.js",
  "..\\chunks\\index.jao9IRKz.js",
  "_app/immutable/nodes/4.cffNQBmV.js",
  "_app/immutable/assets/nodes/4.rG2QiUXL.css",
  "..\\nodes\\4.cffNQBmV.js",
  "..\\assets\\nodes\\4.rG2QiUXL.css",
  "_app/immutable/nodes/5.rZzXnlgv.js",
  "_app/immutable/chunks/Editor.WECZbbDt.js",
  "_app/immutable/chunks/ListErrors.AND7KfDv.js",
  "_app/immutable/assets/Editor.N1UQREJG.css",
  "..\\nodes\\5.rZzXnlgv.js",
  "..\\chunks\\Editor.WECZbbDt.js",
  "..\\chunks\\ListErrors.AND7KfDv.js",
  "..\\assets\\Editor.N1UQREJG.css",
  "_app/immutable/nodes/6.8WmZqfo5.js",
  "..\\nodes\\6.8WmZqfo5.js",
  "_app/immutable/nodes/7.3QlByPOI.js",
  "..\\nodes\\7.3QlByPOI.js",
  "_app/immutable/nodes/8.XIVZlf1k.js",
  "_app/immutable/chunks/control.7lqj1LT_.js",
  "..\\nodes\\8.XIVZlf1k.js",
  "..\\chunks\\control.7lqj1LT_.js",
  "_app/immutable/nodes/9.sEE7yWoc.js",
  "..\\nodes\\9.sEE7yWoc.js",
  "_app/immutable/nodes/10.sEE7yWoc.js",
  "..\\nodes\\10.sEE7yWoc.js",
  "_app/immutable/nodes/11.YrP9Gsnh.js",
  "..\\nodes\\11.YrP9Gsnh.js",
  "_app/immutable/nodes/12.Mq-T7hyV.js",
  "..\\nodes\\12.Mq-T7hyV.js",
]

After this PR

// dynamic import part
const me = [
  () => h(() => import("../nodes/0.9ZE9sozF.js"), __vite__mapDeps([0, 1, 2, 3, 4, 5]), import.meta.url),
  () => h(() => import("../nodes/1.qJs48rvb.js"), __vite__mapDeps([6, 1, 2, 3, 4, 7]), import.meta.url),
  () => h(() => import("../nodes/2.cgAcGTPu.js"), __vite__mapDeps([8, 1, 2, 9, 10, 4, 3]), import.meta.url),
  () => h(() => import("../nodes/3.WG-pTFHJ.js"), __vite__mapDeps([11, 1, 2, 12, 3, 4, 13, 9, 10]), import.meta.url),
  () => h(() => import("../nodes/4.WIfFvBdq.js"), __vite__mapDeps([14, 1, 2, 12, 9, 10, 4, 15]), import.meta.url),
  () => h(() => import("../nodes/5.TyeeZTS0.js"), __vite__mapDeps([16, 1, 2, 17, 12, 9, 10, 4, 18, 19]), import.meta.url),
  () => h(() => import("../nodes/6.auXf1cjj.js"), __vite__mapDeps([20, 1, 2, 17, 12, 9, 10, 4, 18, 19]), import.meta.url),
  () => h(() => import("../nodes/7.2WIrrzxk.js"), __vite__mapDeps([21, 1, 2, 9, 10, 4, 18, 12]), import.meta.url),
  () => h(() => import("../nodes/8.XIVZlf1k.js"), __vite__mapDeps([22, 23, 1, 2]), import.meta.url),
  () => h(() => import("../nodes/9.6SLpv1Hj.js"), __vite__mapDeps([24, 1, 2, 13, 12, 3, 4, 9, 10]), import.meta.url),
  () => h(() => import("../nodes/10.6SLpv1Hj.js"), __vite__mapDeps([25, 1, 2, 13, 12, 3, 4, 9, 10]), import.meta.url),
  () => h(() => import("../nodes/11.NlHZf1wu.js"), __vite__mapDeps([26, 1, 2, 9, 10, 4, 18, 12]), import.meta.url),
  () => h(() => import("../nodes/12.Jyiup-0x.js"), __vite__mapDeps([27, 1, 2, 9, 10, 4, 18, 12]), import.meta.url),
]

// `__vite__mapDeps` file map
[
  "../nodes/0.9ZE9sozF.js",
  "../chunks/scheduler.NGrPFcO6.js",
  "../chunks/index.7XI06WsH.js",
  "../chunks/stores.E69LkMbP.js",
  "../chunks/singletons.Qi39KF0v.js",
  "../assets/nodes/0.7WPj3p_i.css",
  "../nodes/1.qJs48rvb.js",
  "../assets/nodes/1.6h4Hr9rg.css",
  "../nodes/2.cgAcGTPu.js",
  "../chunks/forms.AE2ZHtac.js",
  "../chunks/parse.ubpsR57U.js",
  "../nodes/3.WG-pTFHJ.js",
  "../chunks/each.nITJrLU4.js",
  "../chunks/index.cv5LmFKo.js",
  "../nodes/4.WIfFvBdq.js",
  "../assets/nodes/4.rG2QiUXL.css",
  "../nodes/5.TyeeZTS0.js",
  "../chunks/Editor.T26WS3fy.js",
  "../chunks/ListErrors.AND7KfDv.js",
  "../assets/Editor.N1UQREJG.css",
  "../nodes/6.auXf1cjj.js",
  "../nodes/7.2WIrrzxk.js",
  "../nodes/8.XIVZlf1k.js",
  "../chunks/control.7lqj1LT_.js",
  "../nodes/9.6SLpv1Hj.js",
  "../nodes/10.6SLpv1Hj.js",
  "../nodes/11.NlHZf1wu.js",
  "../nodes/12.Jyiup-0x.js",
]

refs #14550

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added bug p2-nice-to-have Not breaking anything but nice to have (priority) labels Nov 12, 2023
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Looks like we mixed up tracking deps and renderedDeps/fileDeps.

@patak-dev patak-dev merged commit 55335cc into vitejs:main Nov 12, 2023
10 checks passed
@sapphi-red sapphi-red deleted the fix/preload-marker-duplicate-deps branch November 12, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants