Where is jspb.Message provided?

1,886 views
Skip to first unread message

Jeffrey Getzin

unread,
Apr 28, 2016, 5:58:42 PM4/28/16
to Protocol Buffers
Hi there,

 Experimenting with Protobuffers again after being out of Google for a few years. I've been generating C# code for my proto buffer definition files with no problem; the problem is when I generate the JavaScript files.

 Each generated JavaScript file has the Closure dependency:

goog.require('jspb.Message');

However, I can't seem to find any file that contains a goog.provide('jspb.Message'), either locally or on the intertubes. My fear is that the providing file may be internal to Google, in which case protoc is useless to me for generating JavaScript. Is this the case, or is there a file somewhere I'm missing?

   Thanks,
       Jeff the Xoogler
 

Jeffrey Getzin

unread,
Apr 29, 2016, 10:02:25 AM4/29/16
to Protocol Buffers
Scratch that. I found where it was being provided. Now, though, I don't know how to use the generated JavaScript file.

Say I have a protobuffer definition file:

      MyProtobuffer.proto

which defines an message SuperDuperMessage, and I've compiled the proto file with protoc into

      MyProtobuffer.js


And let's say I have an AngularJS app with some callback:

     /**
      * param {{ data: ArrayBuffer}} response
      */
     function(response) {
           var ./** SuperDuperMessage */ = ???????
     }
        

What do I put in place of the question marks to read the ArrayBuffer from the response and deserialize it into the transmitted SuperDuperMessage?

   Thanks,

     Jeff the Xoogler

ga...@jingoal.co

unread,
May 10, 2016, 6:52:04 PM5/10/16
to Protocol Buffers
Can you share where did you find the file to provide jspb?

Thanks,
John

Jeffrey Getzin

unread,
May 10, 2016, 9:55:36 PM5/10/16
to Protocol Buffers
Sure, John, it's here.

Hope this helps!

     Jeff

Juli H

unread,
Jul 8, 2016, 2:50:30 PM7/8/16
to Protocol Buffers
In the message.js - File in Line 44 we can find that line: goog.require('jspb.Map');
But I can't find nowhere smth. named jspb.Map in the whole file-tree of protobuf. So where I can find jspb.Map?

Julian

Feng Xiao

unread,
Jul 8, 2016, 2:51:50 PM7/8/16
to Juli H, Protocol Buffers
On Tue, Jul 5, 2016 at 2:58 AM, Juli H <hindelan...@gmail.com> wrote:
In the message.js - File in Line 44 we can find that line: goog.require('jspb.Map');
But I can't find nowhere smth. named jspb.Map in the whole file-tree of protobuf. So where I can find jspb.Map?
 

Julian

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages