Skip to content

Automate JS->JS dependencies #19098

@sbc100

Description

@sbc100

While working on #19097 I had an idea on how to automate JS->JS dependencies. Similiar to what I did for __sig attributes in #19028.

The basic idea is that rather than manual specifying __deps for a given JS function we could use acorn to tokenize it and then figure out which other JS symbols it depends on.

This dependency extraction process could either be done eagerly at the same time that we extract the JS symbol list prior to calling wasm-ld, or it would be done lazily, on-demand, such that we would only need to tokenize function that we actually use.

Obviously we wouldn't want to slow down the linking process too much so we would need to measure the impact.

Either way the result would be that almost all the __deps entries could be removed and we would end up with cleaner and easier to maintain JS codebase, with fewer dependency bugs.

If it works very well we might even be able to completely remove the need to explicit deps, but that would be stretch goal.

Metadata

Metadata

Assignees

No one assigned

    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