grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.51k stars 766 forks source link

Add version flag and version info in generated code #1231

Closed meling closed 2 years ago

meling commented 2 years ago

Fixes #1216.

Example output (edited):

"use strict";
/**
 * @fileoverview gRPC-Web generated client stub for ag
 * @enhanceable
 * @public
 */
exports.__esModule = true;
exports.AutograderServiceClient = void 0;
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
//  protoc-gen-grpc-web v1.3.1
//  protoc              v3.19.4
// source: ag/ag.proto
/* eslint-disable */
// @ts-nocheck

Caveat: Needs manual updating of newly added version.h file. The process of deciding the version number is not clear to me, and whether or not it could be automated somehow.

linux-foundation-easycla[bot] commented 2 years ago

CLA Signed

The committers listed above are authorized under a signed CLA.

meling commented 2 years ago

Note: I added "versioned" comments also for PrintMethodDescriptorFile and PrintGrpcWebClosureES6File for consistency.

PS: Feel free to squash the commits into one for the merge.

sampajano commented 2 years ago

BTW i've build a few binaries (for all 3 platforms) here: https://github.com/grpc/grpc-web/actions

In case anyone is interested in downloading them :)