Skip to content

feat(javascript): add javascript gRPC support for nodejs/browser#3760

Merged
chaokunyang merged 8 commits into
apache:mainfrom
chaokunyang:add_javascript_grpc_support
Jun 13, 2026
Merged

feat(javascript): add javascript gRPC support for nodejs/browser#3760
chaokunyang merged 8 commits into
apache:mainfrom
chaokunyang:add_javascript_grpc_support

Conversation

@chaokunyang

@chaokunyang chaokunyang commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Why?

JavaScript users can generate Fory model types today, but service schemas do not yet emit JavaScript/TypeScript gRPC companions. This closes the JavaScript gRPC stub generation gap from #3278 while keeping gRPC transport packages as application-owned dependencies.

What does this PR do?

  • Adds JavaScript service companion generation for Node.js @grpc/grpc-js clients and servers with Fory request/response serialization.
  • Adds --grpc-web for JavaScript browser clients, including callback and promise clients backed by grpc-web.
  • Adds generated JavaScript schema helpers (install, createFory, and getFory) plus a Fory.getRootCodec API for exact struct/union root serialization.
  • Validates JavaScript gRPC export, method, output-path, and gRPC-Web streaming-shape collisions during compilation.
  • Updates compiler, IDL, generated-code, and JavaScript guide docs for JavaScript gRPC and gRPC-Web output.
  • Adds compiler codegen tests and JavaScript runtime tests covering generated service bindings and root codecs.

Related issues

Closes #3278

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

Yes. It adds JavaScript gRPC/gRPC-Web compiler outputs and a JavaScript root-codec API used by generated service companions.

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

Not applicable; this PR adds code generation, runtime codec helpers, tests, and documentation rather than changing benchmarked serialization paths.

…upport

# Conflicts:
#	compiler/fory_compiler/cli.py
#	compiler/fory_compiler/tests/test_service_codegen.py
#	docs/compiler/compiler-guide.md
#	docs/compiler/flatbuffers-idl.md
#	docs/compiler/index.md
#	docs/compiler/protobuf-idl.md
#	docs/compiler/schema-idl.md
@chaokunyang chaokunyang merged commit e503ffb into apache:main Jun 13, 2026
49 checks passed
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.

[Compiler][gRPC][JavaScript] Generate gRPC stubs with Fory codec

2 participants