Skip to content

move chunk optimizer out of code_splitting.rs #7282

@IWANABETHATGUY

Description

@IWANABETHATGUY

I felt like the code_splitting​ stage now is doing too much of work.

The logic of splitting modules into chunks and optimizing them based on some assumptions are hard -coded and don't have a clear boundary.

The ideal abstraction layer would be:

- Code splitting generate chunks by following simple and intuitive rules described in https://rolldown.rs/in-depth/code-splitting
- Have a Chunk Optimizer​ abstraction to optimize optimizable patterns.

This will make us easy to locate the issue code when the output is not expected

This allows us to opt-in the chunk optimizer​ behavior, which also makes debugging easier.

Originally posted by @hyf0 in #7261 (review)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions