Skip to main content

Module trace_usage

Module trace_usage 

Source
Expand description

Per-specifier dependency usage contracts (fallow trace --dependency). Per-specifier usage of a dependency: the usage object of fallow trace --dependency <package>.

The object counts how the code uses each imported name of a package. It follows one hop through a project wrapper, for example export const useAppSelector = useSelector.withTypes<RootState>(), and it counts each use that it cannot resolve. The answer is syntactic: it reads import bindings and call sites, not types.

Structs§

ClosureFile
One file of a ConsumerClosure.
ConsumerClosure
The files that import the users of the dependency, found by a reverse walk of the import graph.
DependencyUsage
How the code uses each imported name of a dependency.
DependencyUsageQuery
What a dependency usage trace reports.
FileLevelUnresolved
Uses that hide which names a file reads. The key set is closed in schema version 1.
SitePageRequest
A request for one page of usage sites.
SpecifierUnresolved
Uses of one imported name that the trace cannot resolve to a call. The key set is closed in schema version 1.
SpecifierUsage
The usage of one imported name.
UsageSite
One use of the dependency in the code.
UsageSitePage
One page of usage sites.
UsageWrapper
A top-level exported declarator that wraps an imported name. The trace follows one hop from the wrapper to its consumers.

Enums§

DependencyUsageSchemaVersion
Wire-shape version of the DependencyUsage object.
UsageConfidence
How the usage was found.
UsageQueryError
An invalid DependencyUsageQuery.
UsageSiteKind
How the code uses the dependency at a site.
WrapperShape
The shape of a project wrapper.

Constants§

DEFAULT_USAGE_SITE_LIMIT
The default number of sites on a page.
MAX_USAGE_CLOSURE_DEPTH
The largest closure depth.
MAX_USAGE_SITE_LIMIT
The largest number of sites on a page.