Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Distinguish between build-signature declarations and for-publication declarations #44047

Open
amcasey opened this issue May 11, 2021 · 2 comments
Labels
Domain: Performance Reports of unusually slow behavior

Comments

@amcasey
Copy link
Member

amcasey commented May 11, 2021

Some declaration files are intended for publication and they need to be readable and "work" (e.g. no imports from node_modules). Others are, from a user's perspective, basically temporary files produced by the build to make subsequent builds more incremental (i.e. faster). Right now, we produce both sets of declaration files in the same way, but maybe we don't need to? As far as I can tell, the characteristics we require from "build" declarations are:

  1. They change if-and-only-if the API of the underlying code changes
  2. A source map can get you back from the declaration file to the input file

We can satisfy these requirements without, e.g.

  1. Pretty-printing
  2. Adding imports (as in Idea: Can declaration emit synthesize imports? #44044)
  3. Confirming that referenced types are actually accessible (simplifying Idea: Can declaration emit synthesize type aliases? #44045)
  4. Complaining about node_modules imports

One likely snag is how users will opt in to this behavior (Is it enough to be composite/incremental without having declarations? Is yet another switch required?).

@amcasey amcasey added the Domain: Performance Reports of unusually slow behavior label May 11, 2021
@amcasey
Copy link
Member Author

amcasey commented May 11, 2021

I think @andrewbranch has thought about some of this in the context of pnpm.

@amcasey
Copy link
Member Author

amcasey commented May 11, 2021

This definitely overlaps with @sheetalkamat's recent work on signatures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Performance Reports of unusually slow behavior
Projects
None yet
Development

No branches or pull requests

1 participant