Motivation
#7 needs to transform chunks, which makes "chunks" not someting fixex but managed. The mindset of generating chunks are used to be considerd as the start of rendering output. Now it's a bit of different, generating draft chunks is a process before "generating finalized chunks", drafts chunks are designed for transform/mutating.
History
Previously the intuitive feeling about chunks is once they're generated, they're sealed. The current codebase is written with such implict mindset. But the problem is that chunks are not sealed. Multiple features show the need to mutate/transform chunks in various ways.
All these things show the need of mutating chunks, but the current struct isn't deisnged specially for this purpose, which brings up many issues.
We need a languague that's only for the purpose of "transfoming chunks" and then pass the result to the lower passes instead of mixing up them together.
Actions
This issue is about two things:
- Advance the timing of generating chunks to link stage
- Generate chunks are called as "DraftChunk" that has multiple properties:
- If its export signature is
sealed, extended or free to be managed
- If loading it has side effects
- etc
Rrefs
Motivation
#7 needs to transform chunks, which makes "chunks" not someting fixex but managed. The mindset of generating chunks are used to be considerd as the start of rendering output. Now it's a bit of different, generating draft chunks is a process before "generating finalized chunks", drafts chunks are designed for transform/mutating.
History
Previously the intuitive feeling about chunks is once they're generated, they're sealed. The current codebase is written with such implict mindset. But the problem is that chunks are not sealed. Multiple features show the need to mutate/transform chunks in various ways.
chunkOptimization(this feature contains various optimization passes) will move modules from chunks to chunk and remove unnecessary onesinlineCommonChunks: it's the chunks that get inlined not the modules #7 takes the chunks as input, select chunks that are small, and then remove(inline) them.All these things show the need of mutating chunks, but the current struct isn't deisnged specially for this purpose, which brings up many issues.
We need a languague that's only for the purpose of "transfoming chunks" and then pass the result to the lower passes instead of mixing up them together.
Actions
This issue is about two things:
sealed,extendedorfree to be managedRrefs