rules_ts icon indicating copy to clipboard operation
rules_ts copied to clipboard

support isolated declarations

Open MichaelMitchell-at opened this issue 1 year ago • 6 comments

Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: no
  • Breaking change (forces users to change their own code or config): yes
  • Suggested release notes appear below: no

Test plan

  • Manual testing; please provide instructions so we can reproduce: Used in the Airtable monorepo. Projects using isolated declarations pass isolated_declarations=True to ts_project. bazel build --build_tag_filters=typing --output_groups=types,typecheck <target>

MichaelMitchell-at avatar Jun 25 '24 19:06 MichaelMitchell-at

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 25 '24 19:06 CLAassistant

Test

All tests were cache hits

80 tests (100.0%) were fully cached saving 12s.


Buildifier      Format

aspect-workflows[bot] avatar Jun 25 '24 20:06 aspect-workflows[bot]

Rebased on the TS upgrade, so this example should be functional now. I'd still like to verify all the actions have expected inputs and outputs, and maybe add an analysis test showing that.

alexeagle avatar Jun 30 '24 20:06 alexeagle

Perhaps out of scope of this PR, but it would be interesting to consider an API similar to https://docs.aspect.build/rulesets/aspect_rules_ts/docs/rules#transpiler to allow specifying a non-tsc decleration emit tool (such as swc)

ericrafalovsky avatar Jul 01 '24 18:07 ericrafalovsky

TypeScript doesn't ship a release yet that calls the new transpileDeclaration API, and I don't know of another tool that does. Maybe we'll have to cut scope here to just support the part of the feature which verifies your code is ready for isolatedDeclarations semantics but doesn't actually give the speed improvement yet.

alexeagle avatar Jul 01 '24 21:07 alexeagle

Merged a PR on rules_swc to mirror the newest release that has the declaration emit feature, I'll give it a try...

alexeagle avatar Jul 01 '24 22:07 alexeagle

Completed in https://github.com/aspect-build/rules_ts/pull/679

jbedard avatar Sep 24 '24 01:09 jbedard