Dependency definitions to include inputs
and outputs
keys
#9535
brokenmass
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This might be a hot take but I find things like I'll ask a question: If Turborepo's caching was module based (per-file) rather than package-based (per-package), would you still feel as strongly about this proposal? Particularly when comparing against |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
The objective of this document is to propose a solution for dependency definition that empowers the users with the tools required to express their own task pipelines.
Previous discussions
Shallow dependsOn / after
Background
There are 4 different type of tasks that turborepo manage (or will manage soon)
Default dependency:
This is achieved using the standard 'dependsOn' field and is used to indicate that the task being evaluated must be run IF it's dependencies inputs have changed AFTER those dependencies have been evaluated and eventually executed.
Parallel dependency (virtual):
This is achieved using intermediate transit tasks is used to indicate that the task being evaluated must be run IF it's dependencies inputs have changed without waiting for the dependency execution to have completed.
Sibling dependency (internal only ):
This is currently not publicly achievable but is used to indicate that the task being evaluated must also evaluate and eventually execute it's siblings without caring about their inputs or waiting for their completion.
After dependency (proposed):
This is currently not achievable but is used to indicate that the task being evaluated must be executed after another task ignoring it's actual hash. Typical use case is for when the input of the evaluated task depends on the output of the after task but not of it's inputs , usually when different inputs might lead to identical outputs.
Proposal
The proposal it to stop the proliferation of different configuration fields and normalise the above requirements into a standard, but flexible structure:
The previously defined depency types can be represented as:
Default dependency
or the equivalent
Parallel dependency
No longer needs a transit task:
Sibling dependency
After dependency
This clarifies that:
outputs: false
(instead of current design where you cannot depend on them at all).In short this mean that a task execution no longer has a unique hash like now, but that it just holds hashes over its inputs and outputs and the final hash calculation is driven by the dependant requirements.
Other example
Other examples:
Efficient ts compilation
Beta Was this translation helpful? Give feedback.
All reactions