Skip to content

[Feature]: skip call js side pitch loader-runner if loader doesn't implement pitch #10140

@hardfist

Description

@hardfist
Contributor

It seems rspack will call js side pitch loaderRunner even js loader doesn't implement pitch method which will cause extra tsfn call cost, so it would be better if rspack can skip call loaderRunner if no pitch is implemented

Activity

added theissue type on Apr 23, 2025
added
teamThe issue/pr is created by the member of Rspack.
on Apr 23, 2025
changed the title [-][Feature]: skip call js side pitch loader-runner if loader doesn't pitch[/-] [+][Feature]: skip call js side pitch loader-runner if loader doesn't implement pitch[/+] on Apr 23, 2025
removed theissue type on Apr 23, 2025
added and removed
pending triageThe issue/PR is currently untouched.
on Apr 23, 2025
h-a-n-a

h-a-n-a commented on Apr 23, 2025

@h-a-n-a
Contributor

PR is welcome. Calculating whether a loader contains a pitching loader in rspack option initialization is hard. This requires rspack to create a loader resolver before that, however, currently rspack creates its loader resolver on the Rust side. Instead, we could calculate the result in the first call to a JS loader, if pitching loader is an undefined, then we can skip the following pitching execution. This result is shared between modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PR welcometeamThe issue/pr is created by the member of Rspack.

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @hardfist@h-a-n-a

    Issue actions

      [Feature]: skip call js side pitch loader-runner if loader doesn't implement pitch · Issue #10140 · web-infra-dev/rspack