aspect-build / aspect-build/rules_ts

[FR]: allow setting `incremental` via a `select` statement in ts_project_rule

Open
#386 0 comments 0 reactions 0 assignees View on GitHub
enhancement need: funding
Dominant language
Starlark
Stars
138
Forks
87
Avg merge
2d 8h
Merged PRs (30d)
3

Description

### What is the current behavior?

If you try to use a `select` statement, e.g.
```
ts_project(
name = name + "_typecheck",
incremental = select({
"//some/setting": True,
"//conditions:default": False,
}),
...
)
```

when the `select` statement evaluates to False, you get this error:
`error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'.`

this [line](https://github.com/aspect-build/rules_ts/blob/dc5f4549cffae844166620e81bbff9acf7e66428/ts/defs.bzl#L430) that sets buildinfo_out evaluates to tsbuildinfo_path because incremental has a value (the select statement), and so ts_project runs a command that looks like `tsc_for_ts_project.sh --project tsconfig_project_name.json ... --tsBuildInfoFile project_name.tsbuildinfo`

### Describe the feature

We want to be able to turn on incremental for some builds to test performance without affecting our current CI performance

Contributor guide

Open the contributing guide

Research direction

Start at ts/defs.bzl around line 430, where ts_project determines buildinfo_out from incremental, and trace how the ts_project rule handles select values. Reproduce the example with incremental enabled and disabled; done means the disabled branch no longer passes --tsBuildInfoFile while the enabled branch still supports incremental builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.