Skip to content

Design: advance the timing of generating chunks and introduce draft chunks concepts #8

Description

@hyfdev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions