You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inlineCommonChunks: handle downstream execution order problems #13
When a chunk is inlined, it doesn't only produce execution order problems in that chunk itself, it can also have knock-on effects on all later chunks which are loaded statically.
If a.js is the module we want to duplicate, then we need a strict execution order-style workaround:
// entry.jsimport{b,$initB}from"./b.js";__shared("a",module=>{consta=()=>10;console.log("loaded a.js");module.exports={ a };});const{ helper }=__shared_require("a");// Only run `b.js`'s side effects now$initB();console.log("loaded entry.js",a(),b());// b.jsexportconstb=()=>20;exportconst$initB=()=>{console.log("loaded b.js");};
How to appraoch this
I think we need to clarify:
What's the intended output? (as above, or something else?)
I would say more that when strict execution order is enabled, we have the means to make it a non-issue. But we do still need to make sure we take this situation into account.
My point is that we don't just need to make sure that the inlined code executes in the right order, we also need to make sure all chunks which are imported after what was previously import blah from "./common-ABC.js" have their side-effects executed after the inline chunk's side-effects.
Previously those later chunks may not have required splitting into load-time / call-time sections. Once a chunk before them gets switched to being an inline chunk, now they do.
This may be quite simple to handle, or quite complex - I don't know enough about Rolldown's internals to say.
Activity
hyfdev commentedon Aug 27, 2026
With #14, I assume the situation described in this issue won't exist?
overlookmotel commentedon Aug 28, 2026
I would say more that when strict execution order is enabled, we have the means to make it a non-issue. But we do still need to make sure we take this situation into account.
My point is that we don't just need to make sure that the inlined code executes in the right order, we also need to make sure all chunks which are imported after what was previously
import blah from "./common-ABC.js"have their side-effects executed after the inline chunk's side-effects.Previously those later chunks may not have required splitting into load-time / call-time sections. Once a chunk before them gets switched to being an inline chunk, now they do.
This may be quite simple to handle, or quite complex - I don't know enough about Rolldown's internals to say.