Coder Social home page Coder Social logo

protoc-gen-flow's People

Contributors

steckel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

andcostello

protoc-gen-flow's Issues

Invalid Enum Declarations

-export type Proto3Enum = 0 | 1 | 2;
+declare export var Proto3Enum: {
+  PROTO3_FOO: 0,
+  PROTO3_BAR: 1,
+  PROTO3_BAZ: 2
+}

+export type Proto3EnumType = 0 | 1 | 2;

Invalid flow annotation for nested types

proto3_pb.js.flow:168
168:   static Type: typeof TestProto3$NestedMessage$Type;
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TestProto3$NestedMessage$Type. type referenced from value position
171: type TestProto3$NestedMessage$Type = {
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type TestProto3$NestedMessage$Type

Groups don't get annotated to the parent namespace

current

message Foo {
  optional group Group = 1 { }
}
declare export class TestAllTypes {
  static Group: typeof Group
}

declare export class OptionalGroup {}

This should probably be namespaced to Foo somehow (e.g. Foo$Group).

proto.jspb.test.ExtendsWithMessage.optionalExtension

Not yet annotated.

/**
 * A tuple of {field number, class constructor} for the extension
 * field named `optionalExtension`.
 * @type {!jspb.ExtensionFieldInfo.<!proto.jspb.test.ExtendsWithMessage>}
 */
proto.jspb.test.ExtendsWithMessage.optionalExtension = new jspb.ExtensionFieldInfo(
    19,
    {optionalExtension: 0},
    proto.jspb.test.ExtendsWithMessage,
     /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
         proto.jspb.test.ExtendsWithMessage.toObject),
    0);

Don't export nested classes

 declare export class TestProto {
   static NestedMessage: typeof TestProto3$NestedMessage;
 }
 
-declare export class TestProto3$NestedMessage {
+declare class TestProto3$NestedMessage {
 ...
 }

proto2 Message.prototype.hasFoo declaration

.prototype.hasFoo not declared

/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.jspb.test.ExtendsWithMessage.prototype.hasFoo = function() {
  return jspb.Message.getField(this, 1) != null;
};

Extensions incorrectly annotated.

https://developers.google.com/protocol-buffers/docs/proto#extensions

Are these exported? They aren't defined as if they would be...

goog.exportSymbol('jspb.test.extend_optional_bool', null, global);
goog.exportSymbol('jspb.test.extend_optional_bytes', null, global);
goog.exportSymbol('jspb.test.extend_optional_double', null, global);
goog.exportSymbol('jspb.test.extend_optional_fixed32', null, global);
goog.exportSymbol('jspb.test.extend_optional_fixed64', null, global);
goog.exportSymbol('jspb.test.extend_optional_float', null, global);
goog.exportSymbol('jspb.test.extend_optional_foreign_enum', null, global);
goog.exportSymbol('jspb.test.extend_optional_int32', null, global);
goog.exportSymbol('jspb.test.extend_optional_int64', null, global);
goog.exportSymbol('jspb.test.extend_optional_sfixed32', null, global);
goog.exportSymbol('jspb.test.extend_optional_sfixed64', null, global);
goog.exportSymbol('jspb.test.extend_optional_sint32', null, global);
goog.exportSymbol('jspb.test.extend_optional_sint64', null, global);
goog.exportSymbol('jspb.test.extend_optional_string', null, global);
goog.exportSymbol('jspb.test.extend_optional_uint32', null, global);
goog.exportSymbol('jspb.test.extend_optional_uint64', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_bool', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_double', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_fixed32', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_fixed64', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_float', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_foreign_enum', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_int32', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_int64', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_sfixed32', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_sfixed64', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_sint32', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_sint64', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_uint32', null, global);
goog.exportSymbol('jspb.test.extend_packed_repeated_uint64', null, global);
goog.exportSymbol('jspb.test.extend_repeated_bool', null, global);
goog.exportSymbol('jspb.test.extend_repeated_bytes', null, global);
goog.exportSymbol('jspb.test.extend_repeated_double', null, global);
goog.exportSymbol('jspb.test.extend_repeated_fixed32', null, global);
goog.exportSymbol('jspb.test.extend_repeated_fixed64', null, global);
goog.exportSymbol('jspb.test.extend_repeated_float', null, global);
goog.exportSymbol('jspb.test.extend_repeated_foreign_enum', null, global);
goog.exportSymbol('jspb.test.extend_repeated_int32', null, global);
goog.exportSymbol('jspb.test.extend_repeated_int64', null, global);
goog.exportSymbol('jspb.test.extend_repeated_sfixed32', null, global);
goog.exportSymbol('jspb.test.extend_repeated_sfixed64', null, global);
goog.exportSymbol('jspb.test.extend_repeated_sint32', null, global);
goog.exportSymbol('jspb.test.extend_repeated_sint64', null, global);
goog.exportSymbol('jspb.test.extend_repeated_string', null, global);
goog.exportSymbol('jspb.test.extend_repeated_uint32', null, global);
goog.exportSymbol('jspb.test.extend_repeated_uint64', null, global);

proto.jspb.test.ExtendsWithMessage.repeatedExtensionList

Not yet annotated.

/**
 * A tuple of {field number, class constructor} for the extension
 * field named `repeatedExtensionList`.
 * @type {!jspb.ExtensionFieldInfo.<!Array.<!proto.jspb.test.ExtendsWithMessage>>}
 */
proto.jspb.test.ExtendsWithMessage.repeatedExtensionList = new jspb.ExtensionFieldInfo(
    49,
    {repeatedExtensionList: 0},
    proto.jspb.test.ExtendsWithMessage,
     /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
         proto.jspb.test.ExtendsWithMessage.toObject),
    1);

Map Field getters missing argument

getMapStringStringMap(): any;
/**
 * map<string, string> map_string_string = 1;
 * @param {boolean=} opt_noLazyCreate Do not create the map if
 * empty, instead returning `undefined`
 * @return {!jspb.Map<string,string>}
 */
proto.jspb.test.TestMapFields.prototype.getMapStringStringMap = function(opt_noLazyCreate) {
  return /** @type {!jspb.Map<string,string>} */ (
      jspb.Message.getMapField(this, 1, opt_noLazyCreate,
      null));
};

Generating too much code

Switch plugin from generating all proto files in proto_file field to just those explicitly mentioned on command-line.

// An encoded CodeGeneratorRequest is written to the plugin's stdin.
message CodeGeneratorRequest {
  // The .proto files that were explicitly listed on the command-line.  The
  // code generator should generate code only for these files.  Each file's
  // descriptor will be included in proto_file, below.
  repeated string file_to_generate = 1;
 ...
  repeated FileDescriptorProto proto_file = 15;
}

Missing Enum Declaration

/**
 * @enum {number}
 */
proto.jspb.test.ForeignEnum = {
  FOREIGN_FOO: 4,
  FOREIGN_BAR: 5,
  FOREIGN_BAZ: 6
};
+declare export ForeignEnum = {
+  FOREIGN_FOO: 4,
+  FOREIGN_BAR: 5,
+  FOREIGN_BAZ: 6 
+}
+
-export type ForeignEnum = 4 | 5 | 6;
+export type ForeignEnumValue = 4 | 5 | 6;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.