Skip to content

Clarify performance impact of project references on ts-server, and recommended usage of 'disableSourceOfProjectReferenceRedirect' or alternatives #3332

Open
@jroitgrund

Description

@jroitgrund

From the docs (https://www.typescriptlang.org/tsconfig/#disableSourceOfProjectReferenceRedirect, https://www.typescriptlang.org/docs/handbook/project-references.html), it's clear that:

  • project references enable tsc -b for improved type-checking performance
  • they can also improve tsserver (and therefore IDE) performance if declaration files are 'pre-emitted' and you enable disableSourceOfProjectReferenceRedirect

In a monorepo, where most change units touch multiple projects, you want the behaviour of disableSourceOfProjectReferenceRedirect: false, ie you don't want to have to manually re-generate declaration files if you're changing a leaf project. Here's what's unclear: how is tsserver (and therefore IDE) performance affected by project references in this case? The docs should clarify:

  • whether tsserver performance is expected to improve with project references and disableSourceOfProjectReferenceRedirect: false, compared to without project references?
  • if not, whether there is a recommended setup to let tsserver benefit from project references without having to manually regenerate declaration files?

See also https://stackoverflow.com/questions/67093879/are-typescript-project-references-helpful-with-noemit (no real answer) and microsoft/TypeScript#42607 (where according to the last benchmark by the submitter, project references actually slightly worsen performance, even after the patch).

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