Skip to content

fix(builtin): add transitive typings to runfiles provider produced by js_library#2547

Merged
alexeagle merged 1 commit into
bazel-contrib:stablefrom
mattem:fix/nodejs_binary_declaration_info
Mar 24, 2021
Merged

fix(builtin): add transitive typings to runfiles provider produced by js_library#2547
alexeagle merged 1 commit into
bazel-contrib:stablefrom
mattem:fix/nodejs_binary_declaration_info

Conversation

@mattem

@mattem mattem commented Mar 22, 2021

Copy link
Copy Markdown
Collaborator

Add transitive typings to runfiles provider produced by js_library. Allows downstream consumers that require the .d.ts files at runtime (eg typechecking) to access the files via the runfiles tree.

@alexeagle

Copy link
Copy Markdown
Collaborator

I'm surprised this is useful, what's the use case? a typescript program deps on a binary and wants to typecheck against some library code contained in that binary?

@mattem

mattem commented Mar 22, 2021

Copy link
Copy Markdown
Collaborator Author

Yeah, internally running tsc_test to perform typechecking, where one of the dependencies is via a js_library which outputs the required .d.ts files. There is an alternative method, js_library outputs types to an output group types, so it's possible to do:

filegroup(
    name = "types_dts",
    srcs = [
        "//some:js_library"
    ],
    output_group = "types",
)

tsc_test(
    name = "typecheck",
    args = [
        "--noEmit",
        "--incremental",
        "false",
    ],
    chdir = package_name(),
    data = [
        ":types_dts",
        ...
    ],
)

@mattem
mattem force-pushed the fix/nodejs_binary_declaration_info branch from 4fed67f to 3daba63 Compare March 24, 2021 12:52
@mattem mattem changed the title fix(builtin): pass though declarations from DeclarationInfo provider in nodejs_binary fix(builtin): add transitive typings to runfiles provider produced by js_library Mar 24, 2021
@mattem

mattem commented Mar 24, 2021

Copy link
Copy Markdown
Collaborator Author

//examples:examples_protobufjs flake

@alexeagle
alexeagle merged commit 41117fa into bazel-contrib:stable Mar 24, 2021
@mattem
mattem deleted the fix/nodejs_binary_declaration_info branch March 24, 2021 21:09
alexeagle added a commit that referenced this pull request Jan 6, 2022
…duced by js_library (#2547)"

This wasn't actually a fix - it causes type-checking to happen eagerly
when a js_library target is built, even if the typings aren't needed.

This prevents a transpile-only dev workflow.

As noted in the PR #2547
this is easily accomplished in tsc_test by explicitly gathering typings
inputs with output_group = types

This reverts commit 41117fa.
alexeagle added a commit that referenced this pull request Jan 6, 2022
…duced by js_library (#2547)"

This wasn't actually a fix - it causes type-checking to happen eagerly
when a js_library target is built, even if the typings aren't needed.

This prevents a transpile-only dev workflow.

As noted in the PR #2547
this is easily accomplished in tsc_test by explicitly gathering typings
inputs with output_group = types

This reverts commit 41117fa.
alexeagle added a commit that referenced this pull request Jan 6, 2022
…duced by js_library (#2547)" (#3189)

This wasn't actually a fix - it causes type-checking to happen eagerly
when a js_library target is built, even if the typings aren't needed.

This prevents a transpile-only dev workflow.

As noted in the PR #2547
this is easily accomplished in tsc_test by explicitly gathering typings
inputs with output_group = types

This reverts commit 41117fa.
alexeagle added a commit that referenced this pull request Jan 7, 2022
…duced by js_library (#2547)" (#3189)

This wasn't actually a fix - it causes type-checking to happen eagerly
when a js_library target is built, even if the typings aren't needed.

This prevents a transpile-only dev workflow.

As noted in the PR #2547
this is easily accomplished in tsc_test by explicitly gathering typings
inputs with output_group = types

This reverts commit 41117fa.
alexeagle added a commit that referenced this pull request Jan 8, 2022
…duced by js_library (#2547)" (#3189)

This wasn't actually a fix - it causes type-checking to happen eagerly
when a js_library target is built, even if the typings aren't needed.

This prevents a transpile-only dev workflow.

As noted in the PR #2547
this is easily accomplished in tsc_test by explicitly gathering typings
inputs with output_group = types

This reverts commit 41117fa.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants