Skip to content

chore: add chunk order test#1011

Closed
underfin wants to merge 1 commit intomainfrom
add-chunk-order-test
Closed

chore: add chunk order test#1011
underfin wants to merge 1 commit intomainfrom
add-chunk-order-test

Conversation

@underfin
Copy link
Copy Markdown
Contributor

Description


```js
import "./c.mjs";
import "./b.mjs";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here should be

import "./b.mjs";
import "./c.mjs";

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 30, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 0db3e79
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/6630a51b32a34900089586de

Copy link
Copy Markdown
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

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

It's known by me and that's why #122 remains open. I'm still solving it with considering the stability of hash and correctness of execution order rather than only one aspect. Leave it to me. #1002 (comment)

I will record this test in #122.

@hyf0
Copy link
Copy Markdown
Member

hyf0 commented May 15, 2024

It's interesting that I found esbuild only ensure chunk order is deterministic, the order is calculated by some deterministic keys rather execution order.

Rollup calculated the imported chunk order per module rather than follow the global module execution order calculated by sortModules.

Example

esbuild

image

rollup

image

Notices:

  • Rollup emit more proper import ... order than esbuild in entry chunk main2.js than esbuild's b.js.
  • esbuild doesn't use possible execution order to generate import ... statements. esbuild has it's own logic, the logic isn't related to possible execution order and it only ensure deterministic.

@hyf0 hyf0 mentioned this pull request May 15, 2024
@hyf0 hyf0 closed this in #1135 May 15, 2024
@Brooooooklyn Brooooooklyn deleted the add-chunk-order-test branch January 17, 2025 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants