Skip to content

feat: demonstrate rules_js proto support#894

Open
alexeagle wants to merge 7 commits intomainfrom
redo_proto
Open

feat: demonstrate rules_js proto support#894
alexeagle wants to merge 7 commits intomainfrom
redo_proto

Conversation

@alexeagle
Copy link
Copy Markdown
Contributor

@alexeagle alexeagle commented Feb 11, 2026

If this works, we can delete ts_proto_library from this repo, is it's no longer used.
Note, it was marked EXPERIMENTAL so technically, we could remove it before 4.0

@alexeagle alexeagle requested a review from thesayyn February 11, 2026 01:31
@alexeagle alexeagle marked this pull request as ready for review February 11, 2026 02:01
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Feb 11, 2026

Bazel 7 (Test)

⚠️ Buildkite build #507 failed.

//ts:defs.doc_extract failed to build

in src attribute of starlark_doc_extract rule //ts:defs.doc_extract: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/defs.bzl:11:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_lib.bzl:4:6: cannot load
'@@aspect_rules_js~//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build //ts:defs.doc_extract

Bazel 8 (Test)

⚠️ Buildkite build #507 failed.

//ts:defs.doc_extract failed to build

in src attribute of starlark_doc_extract rule //ts:defs.doc_extract: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/defs.bzl:11:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_lib.bzl:4:6: cannot load
'@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build //ts:defs.doc_extract

Bazel 9 (Test)

⚠️ Buildkite build #507 failed.

//ts:defs.doc_extract failed to build

in src attribute of starlark_doc_extract rule //ts:defs.doc_extract: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/defs.bzl:11:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/workdir/aspect-build/rules_ts/ts/private/ts_lib.bzl:4:6: cannot load
'@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build //ts:defs.doc_extract

Bazel-7

e2e/bzlmodules

⚠️ Buildkite build #507 failed.

@@module_a~//:content failed to build

error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file
error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file
error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@module_a~//:content

Bazel-8

e2e/bzlmodules

⚠️ Buildkite build #507 failed.

@@module_a+//:content failed to build

error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file
error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file
error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@module_a+//:content

Bazel-9

e2e/bzlmodules

⚠️ Buildkite build #507 failed.

@@module_a+//:content failed to build

error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file
error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file
error loading package '@@module_a+//': at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_bzlmodules/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@module_a+//:content

Bazel-7

e2e/external_dep

⚠️ Buildkite build #507 failed.


Bazel-7-wksp

e2e/external_dep

⚠️ Buildkite build #507 failed.


Bazel-8

e2e/external_dep

⚠️ Buildkite build #507 failed.


Bazel-9

e2e/external_dep

Buildkite build #507 is running...


Bazel-7

e2e/external_dep/app

⚠️ Buildkite build #507 failed.

@@e2e_external_dep~//:lib failed to build

error loading package '@@e2e_external_dep~//': at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6:
at /mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6:
cannot load '@@aspect_rules_js~//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@e2e_external_dep~//:lib

Bazel-7-wksp

e2e/external_dep/app

⚠️ Buildkite build #507 failed.

@@lib_wksp//:lib failed to build

error loading package '@@lib_wksp//': at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts/ts/private/ts_config.bzl:21:6:
at /mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts/ts/private/ts_lib.bzl:4:6:
cannot load '@@aspect_rules_js//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@lib_wksp//:lib

Bazel-8

e2e/external_dep/app

⚠️ Buildkite build #507 failed.

@@e2e_external_dep+//:lib failed to build

error loading package '@@e2e_external_dep+//': at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6:
at /mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6:
cannot load '@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@e2e_external_dep+//:lib

Bazel-9

e2e/external_dep/app

⚠️ Buildkite build #507 failed.

@@e2e_external_dep+//:lib failed to build

error loading package '@@e2e_external_dep+//': at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/private/ts_config.bzl:21:6:
at /mnt/ephemeral/output/rules_ts/e2e_external_dep_app/external/aspect_rules_ts+/ts/private/ts_lib.bzl:4:6:
cannot load '@@aspect_rules_js+//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@e2e_external_dep+//:lib

Bazel-7

e2e/nested_repos

⚠️ Buildkite build #507 failed.

@@module_b~//:consumer failed to build

error loading package '@@module_b~//': at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file

@@module_a~//:content failed to build

error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file
error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file
error loading package '@@module_a~//': at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/defs.bzl:11:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_config.bzl:21:6: at
/mnt/ephemeral/output/rules_ts/e2e_nested_repos/external/aspect_rules_ts~/ts/private/ts_lib.bzl:4:6: cannot
load '@@aspect_rules_js~//js/private:proto.bzl': no such file

💡 To reproduce the build failures, run

bazel build @@module_b~//:consumer @@module_a~//:content

Bazel-8

e2e/nested_repos

Buildkite build #507 is running...


Bazel-9

e2e/nested_repos

Buildkite build #507 is running...


Bazel-7

e2e/rules_js_v3

⚠️ Buildkite build #507 failed.


Bazel-8

e2e/rules_js_v3

⚠️ Buildkite build #507 failed.


Bazel-9

e2e/rules_js_v3

⚠️ Buildkite build #507 failed.


Bazel-7

e2e/smoke

⚠️ Buildkite build #507 failed.


Bazel-7-wksp

e2e/smoke

Buildkite build #507 is running...


Bazel-8

e2e/smoke

⚠️ Buildkite build #507 failed.


Bazel-7

e2e/worker

⚠️ Buildkite build #507 failed.


Bazel-7-wksp

e2e/worker

⚠️ Buildkite build #507 failed.


Bazel-8

e2e/worker

⚠️ Buildkite build #507 failed.


Bazel-9

e2e/worker

⚠️ Buildkite build #507 failed.


Bazel 8 (Test)

examples

⚠️ Buildkite build #507 failed.


Bazel 9 (Test)

examples

⚠️ Buildkite build #507 failed.


Buildifier      Format

alexeagle added a commit to aspect-build/rules_js that referenced this pull request Feb 11, 2026
Design:
- user expected to register a toolchain providing their protoc plugin for gen-es
- Adapt ProtoInfo to JsInfo so a proto_library target can appear anywhere a js_library does

Example of use currently in aspect-build/rules_ts#894
@alexeagle alexeagle changed the title feat: re-implement TS proto support from scratch feat: demonstrate rules_js proto support Feb 11, 2026
Comment thread examples/MODULE.bazel

catalog:
'@bufbuild/protobuf': '2.7.0'
'@types/node': '24'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we upgrading this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newer bufbuild produces typings that don't work with older @node/types. Could downgrade protoc-gen-es instead though

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine in the examples repo 🤷

alexeagle added a commit to aspect-build/rules_js that referenced this pull request Feb 11, 2026
Design:
- user expected to register a toolchain providing their protoc plugin
for gen-es
- use an aspect to adapt `ProtoInfo` to `JsInfo`, so a proto_library
target can appear anywhere a js_library does
- no need for `js_proto_library` targets to pollute the package where
the proto_library appears
- similar to bazel-contrib/rules_ruby#292

Example of use currently in
aspect-build/rules_ts#894

TODO:
- for typescript, place .d.ts files in the source tree, with @kormide
using diff.bzl as a validation action. Maybe this belongs in rules_ts
- support connect_query - we didn't have any test/example usage of it
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Alex Eagle seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants