Skip to content

Commit

Permalink
Add list item in docs about errors in internal TypeScript dependenci…
Browse files Browse the repository at this point in the history
…es. (#9315)

### Description

A few folks have asked about this. Good to add to our tradeoffs notes!

### Testing Instructions

👀
  • Loading branch information
anthonyshew authored Oct 22, 2024
1 parent 5c45126 commit e54d017
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/repo-docs/core-concepts/internal-packages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ There are a few important things to notice in this `package.json`:
- **Only applicable when consumers do transpiling**: This strategy can only be used when the package is going to be used in tooling that uses a bundler or natively understands TypeScript. The consumer's bundler is responsible for transpiling the TypeScript packages to JavaScript. If your builds or other usages of the package are not able to consume TypeScript, you will need to move to the [Compiled Packages](#compiled-packages) strategy.
- **No TypeScript `paths`**: A library that is being transpiled by its consumer cannot use the `compilerOptions.paths` configuration because TypeScript assumes that source code is being transpiled in the package where it is written. If you're using TypeScript 5.4 or later, we recommend [using Node.js subpath imports](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#auto-import-support-for-subpath-imports). To learn how, visit [our TypeScript page](/repo/docs/guides/tools/typescript#use-nodejs-subpath-imports-instead-of-typescript-compiler-paths).
- **Turborepo cannot cache a build for a Just-in-Time Package**: Because the package doesn't have its own `build` step, it can't be cached by Turborepo. This tradeoff may make sense for you if you want to keep configuration to a minimum and are okay with the build times for your applications.
- **Errors in internal dependencies will be reported**: When directly exporting TypeScript, type-checking in a dependent package will fail if code in an internal dependency has TypeScript errors. You may find this confusing or problematic in some situations.

### Compiled Packages

Expand Down

0 comments on commit e54d017

Please sign in to comment.