-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Clarification on Transit Nodes docs #9181
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -326,30 +326,30 @@ Some tasks should always be ran no matter what, like a deployment script after a | |||||
|
||||||
Some tasks can be ran in parallel despite being dependent on other packages. An example of tasks that fit this description are linters, since a linter doesn't need to wait for outputs in dependencies to run successfully. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Technically, TypeScript as a type checker is a linter. But I can see how that would be confusing. Would this change be clearer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that works! But I guess it feels like a more confusing example given my comment above:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, missed that. You're right, let's swap the example to being |
||||||
|
||||||
Because of this, you may be tempted to define your `check-types` task like this: | ||||||
Because of this, you may be tempted to define your `lint` task like this: | ||||||
|
||||||
```json title="./turbo.json" | ||||||
{ | ||||||
"tasks": { | ||||||
"check-types": {} // Incorrect! // [!code highlight] | ||||||
"lint": {} // Incorrect! // [!code highlight] | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
This runs your tasks in parallel - but doesn't account for source code changes in dependencies. This means you can: | ||||||
|
||||||
1. Make a breaking change to the interface of your `ui` package. | ||||||
2. Run `turbo check-types`, hitting cache in an application package that depends on `ui`. | ||||||
2. Run `turbo lint`, hitting cache in an application package that depends on `ui`. | ||||||
|
||||||
This is incorrect, since the application package will show a successful cache hit, despite not being updated to use the new interface. Checking for TypeScript errors in your application package manually in your editor is likely to reveal errors. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess if I change to |
||||||
|
||||||
Because of this, you make a small change to your `check-types` task definition: | ||||||
Because of this, you make a small change to your `lint` task definition: | ||||||
|
||||||
```json title="./turbo.json" | ||||||
{ | ||||||
"tasks": { | ||||||
"check-types": { | ||||||
"dependsOn": ["^check-types"] // This works...but could be faster! // [!code highlight] | ||||||
"lint": { | ||||||
"dependsOn": ["^lint"] // This works...but could be faster! // [!code highlight] | ||||||
} | ||||||
} | ||||||
} | ||||||
|
@@ -365,10 +365,10 @@ To meet both requirements (correctness and parallelism), you can introduce [Tran | |||||
"transit": { | ||||||
"dependsOn": ["^transit"] | ||||||
}, | ||||||
"check-types": { | ||||||
"lint": { | ||||||
"dependsOn": ["transit"] | ||||||
}, | ||||||
}, | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could change the above example to be typechecking instead, but based on this dissonance I'm actually a little confused by your example. Using Internal Packages™
could be true. Not using Internal Packages, where the output is
.d.ts
files, it would seem like you definetly can't typecheck package A if package B could be changing.d.ts
files.