[protobuf] What happend to the protobuf-javascript?

2023-10-09 Thread Joonsoo Jeon
Hi,

I am looking for the official implementation of Protobuf for JavaScript(and 
TypeScript, if exists).

protobuf-javascript <https://github.com/protocolbuffers/protobuf-javascript> 
seems 
like the official implementation, but it looks like it hasn't been updated 
for a while. The latest version was 3.21.2, which was uploaded last year.

Does it mean that it is OK to use the old version for JavaScript? Or is it 
deprecated and should I use another implementation? Or does it mean that I 
shouldn't use protobuf for web apps at all?

I know there are some alternative implementations, but I am looking for the 
official implementation or official recommendations.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/02a74e0a-642a-46b7-a4bb-400434a1cd2cn%40googlegroups.com.


[protobuf] Re: JavaScript generated code

2022-09-08 Thread Evgeniia T
thanks

четверг, 8 сентября 2022 г. в 04:25:03 UTC+7, deanna...@google.com: 

> As announced in May 
> <https://developers.google.com/protocol-buffers/docs/news/2022-05-06>, 
> JavaScript protobufs are being decoupled from the main repository. Any 
> questions about JavaScript should be directed to the JavaScript repository 
> <https://github.com/protobufjs/protobuf.js/>.
>
> On Monday, September 5, 2022 at 4:22:05 AM UTC-7 evgenia...@gmail.com 
> wrote:
>
>> Where is JavaScript tutorial?
>>
>> It was here before:
>>
>> https://developers.google.com/protocol-buffers/docs/reference/javascript-generated
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/45a49369-a47f-493c-8deb-a5adca7eb3f7n%40googlegroups.com.


[protobuf] Re: JavaScript generated code

2022-09-07 Thread 'Deanna Garcia' via Protocol Buffers
As announced in May 
<https://developers.google.com/protocol-buffers/docs/news/2022-05-06>, 
JavaScript protobufs are being decoupled from the main repository. Any 
questions about JavaScript should be directed to the JavaScript repository 
<https://github.com/protobufjs/protobuf.js/>.

On Monday, September 5, 2022 at 4:22:05 AM UTC-7 evgenia...@gmail.com wrote:

> Where is JavaScript tutorial?
>
> It was here before:
>
> https://developers.google.com/protocol-buffers/docs/reference/javascript-generated
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/983128e1-2dc6-4ca6-9f83-ddd1b53d5d4en%40googlegroups.com.


[protobuf] JavaScript generated code

2022-09-05 Thread Evgeniia T
Where is JavaScript tutorial?

It was here before:
https://developers.google.com/protocol-buffers/docs/reference/javascript-generated

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/e679f211-0b85-4967-8d46-5e20a2af93fbn%40googlegroups.com.


Re: [protobuf] Re: Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-19 Thread Csaba Szigeti
I found the solution.

This stackoverflow post described a really similar issue, and it helped me 
to fix my parsing as well : 
https://stackoverflow.com/questions/68750875/protobuf-serialize-deserialize-c-to-js

Here is my updated code, which works well : 
I had to update the Javascript side : 
```javascript
function sendMessage() {

Module.self().setMyMessage(module$contents$protobufMessageGenerator_generateMyMessage().serializeBinary().toString())
}
sendMessage()
```
and the C++ side : 
```cpp
namespace
{
QByteArray decryptProtobufMessage(const std::string &str)
{
QStringList strList = QString::fromStdString(str).split(',');
QByteArray bytedata;
foreach (const QString &str, strList)
{
bytedata += (str.toUInt());
}
return bytedata;
}
} // namespace

void JavascriptPublicInterface::setMyMessage(const QByteArray &myMessage)
{
if (_myMessage != myMessage)
{
_myMessage = myMessage;
emit myMessageChanged();
}
}

void JavascriptPublicInterface::setMyMessageEMS(const std::string 
&myMessage)
{
setMyMessage(decryptProtobufMessage(myMessage));
}

//...

void startListeningToMyMessage(std::function listener)
{
const auto changedListener = [listener]() {
const auto newMyMessageByteArray = 
JavascriptPublicInterface::self()->myMessage();
my_proto::MyMessage myMessagePb;
if (myMessagePb.ParseFromArray(newMyMessageByteArray.data(), 
newMyMessageByteArray.size()))
{
qDebug() << "C++ : Successfully parsed new MyMessage: " << 
newMyMessageByteArray;
}
else
{
qDebug() << "C++ : Failed to parse new MyMessage: " << 
newMyMessageByteArray;
}

qDebug() << "MyMessage received: " << 
QString::fromStdString(myMessagePb.DebugString());

listener(myMessagePb);
};
if (!QObject::connect(JavascriptPublicInterface::self(), 
&JavascriptPublicInterface::myMessageChanged, changedListener))
{
throw std::runtime_error("Failed to connect to 
JavascriptPublicInterface myMessageChanged");
}
}
```

On Friday, February 18, 2022 at 6:36:19 PM UTC+1 Csaba Szigeti wrote:

> The issue is not fixed yet, but I got much-much closer to fixing it.
>
> Using this code, from the Javascript console, I printed my protobuf 
> message as hex : 
> ```javascript
> function buf2hex(buffer) { // buffer is an ArrayBuffer
>   return [...new Uint8Array(buffer)]
>   .map(x => x.toString(16).padStart(2, '0'))
>   .join('');
> }
>
>
> buf2hex(module$contents$protobufMessageGenerator_generatePubDetailsMessage().serializeBinary())
> ```
>
> I copy pasted it into a.txt, and converted it : 
> ```bash
> cat a.txt | tr ',' '\n' | xargs printf 'x%02x'
>
> ```
>
> and I copy pasted this output as well, and generated a.bin like this : 
> ```bash
> echo -n -e 
> \\x2a\\xd2\\x02\\x1a\\x93\\x01\\x0a\\x0c\\x45\\x6d\\x69\\x74\\x74\\x65\\x72\\x20\\x4e\\x61\\x6d\\x65\\x12\\x0d\\x45\\x6d\\x69\\x74\\x74\\x65\\x72\\x20\\x54\\x69\\x74\\x6c\\x65\\x1a\\x74\\x69\\x56\\x42\\x4f\\x52\\x77\\x30\\x4b\\x47\\x67\\x6f\\x41\\x41\\x41\\x41\\x4e\\x53\\x55\\x68\\x45\\x55\\x67\\x41\\x41\\x41\\x41\\x55\\x41\\x41\\x41\\x41\\x46\\x43\\x41\\x59\\x41\\x41\\x41\\x43\\x4e\\x62\\x79\\x62\\x6c\\x41\\x41\\x41\\x41\\x48\\x45\\x6c\\x45\\x51\\x56\\x51\\x49\\x31\\x32\\x50\\x34\\x2f\\x2f\\x38\\x2f\\x77\\x33\\x38\\x47\\x49\\x41\\x58\\x44\\x49\\x42\\x4b\\x45\\x30\\x44\\x48\\x78\\x67\\x6c\\x6a\\x4e\\x42\\x41\\x41\\x4f\\x39\\x54\\x58\\x4c\\x30\\x59\\x34\\x4f\\x48\\x77\\x41\\x41\\x41\\x41\\x42\\x4a\\x52\\x55\\x35\\x45\\x72\\x6b\\x4a\\x67\\x67\\x67\\x3d\\x3d\\x22\\x0a\\x54\\x68\\x61\\x6e\\x6b\\x20\\x79\\x6f\\x75\\x21\\x3a\\x9a\\x01\\x1a\\x08\\x47\\x72\\x65\\x65\\x74\\x69\\x6e\\x67\\x22\\x06\\x48\\x65\\x61\\x64\\x65\\x72\\x2a\\x04\\x42\\x6f\\x64\\x79\\x32\\x06\\x46\\x6f\\x6f\\x74\\x65\\x72\\x3a\\x0c\\x53\\x69\\x6e\\x67\\x6c\\x65\\x41\\x6e\\x73\\x77\\x65\\x72\\x4a\\x12\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x31\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x31\\x4a\\x14\\x08\\x02\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x32\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x32\\x4a\\x14\\x08\\x04\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x33\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x33\\x4a\\x14\\x08\\x06\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x34\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x34\\x4a\\x14\\x08\\x08\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x35\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x35\\x4a\\x06\\x75\\x72\\x67\\x65\\x6e\\x74\\x52\\x09\\x6c\\x69\\x67\\x68\\x74\\x6e\\x69\\x6e\\x67\\x32\\x06\\x12\\x04\\x6e\\x6f\\x6e\\x65
>  
> > a.bin
>
> ```
>
> When I add this file as a resource to my C++ WebAssembly app, and load it, 
> eve

Re: [protobuf] Re: Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-18 Thread Csaba Szigeti
 

The issue is not fixed yet, but I got much-much closer to fixing it.

Using this code, from the Javascript console, I printed my protobuf message 
as hex : 
```javascript
function buf2hex(buffer) { // buffer is an ArrayBuffer
  return [...new Uint8Array(buffer)]
  .map(x => x.toString(16).padStart(2, '0'))
  .join('');
}

buf2hex(module$contents$protobufMessageGenerator_generatePubDetailsMessage().serializeBinary())
```

I copy pasted it into a.txt, and converted it : 
```bash
cat a.txt | tr ',' '\n' | xargs printf 'x%02x'

```

and I copy pasted this output as well, and generated a.bin like this : 
```bash
echo -n -e 
\\x2a\\xd2\\x02\\x1a\\x93\\x01\\x0a\\x0c\\x45\\x6d\\x69\\x74\\x74\\x65\\x72\\x20\\x4e\\x61\\x6d\\x65\\x12\\x0d\\x45\\x6d\\x69\\x74\\x74\\x65\\x72\\x20\\x54\\x69\\x74\\x6c\\x65\\x1a\\x74\\x69\\x56\\x42\\x4f\\x52\\x77\\x30\\x4b\\x47\\x67\\x6f\\x41\\x41\\x41\\x41\\x4e\\x53\\x55\\x68\\x45\\x55\\x67\\x41\\x41\\x41\\x41\\x55\\x41\\x41\\x41\\x41\\x46\\x43\\x41\\x59\\x41\\x41\\x41\\x43\\x4e\\x62\\x79\\x62\\x6c\\x41\\x41\\x41\\x41\\x48\\x45\\x6c\\x45\\x51\\x56\\x51\\x49\\x31\\x32\\x50\\x34\\x2f\\x2f\\x38\\x2f\\x77\\x33\\x38\\x47\\x49\\x41\\x58\\x44\\x49\\x42\\x4b\\x45\\x30\\x44\\x48\\x78\\x67\\x6c\\x6a\\x4e\\x42\\x41\\x41\\x4f\\x39\\x54\\x58\\x4c\\x30\\x59\\x34\\x4f\\x48\\x77\\x41\\x41\\x41\\x41\\x42\\x4a\\x52\\x55\\x35\\x45\\x72\\x6b\\x4a\\x67\\x67\\x67\\x3d\\x3d\\x22\\x0a\\x54\\x68\\x61\\x6e\\x6b\\x20\\x79\\x6f\\x75\\x21\\x3a\\x9a\\x01\\x1a\\x08\\x47\\x72\\x65\\x65\\x74\\x69\\x6e\\x67\\x22\\x06\\x48\\x65\\x61\\x64\\x65\\x72\\x2a\\x04\\x42\\x6f\\x64\\x79\\x32\\x06\\x46\\x6f\\x6f\\x74\\x65\\x72\\x3a\\x0c\\x53\\x69\\x6e\\x67\\x6c\\x65\\x41\\x6e\\x73\\x77\\x65\\x72\\x4a\\x12\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x31\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x31\\x4a\\x14\\x08\\x02\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x32\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x32\\x4a\\x14\\x08\\x04\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x33\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x33\\x4a\\x14\\x08\\x06\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x34\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x34\\x4a\\x14\\x08\\x08\\x1a\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x35\\x22\\x07\\x4f\\x70\\x74\\x69\\x6f\\x6e\\x35\\x4a\\x06\\x75\\x72\\x67\\x65\\x6e\\x74\\x52\\x09\\x6c\\x69\\x67\\x68\\x74\\x6e\\x69\\x6e\\x67\\x32\\x06\\x12\\x04\\x6e\\x6f\\x6e\\x65
 
> a.bin

```

When I add this file as a resource to my C++ WebAssembly app, and load it, 
everything works fine : 
```cpp

euf_proto::PubDetails pubDetails;
QByteArray data;
{
QString fileName(":/a.bin");

QFile file(fileName);
if(!file.open(QIODevice::ReadOnly)) {
qDebug() << "file not opened";
}
else
{
qDebug() << "file opened";
data = file.readAll();
}
}



if (pubDetails.ParseFromArray(data.data(), data.size()))
{
qDebug() << "C++ : Successfully parsed new pubDetails: " << data;
}
else
{
qDebug() << "C++ : Failed to parse new pubDetails: " << data;
}

=>

file opened

qtloader.js:382 C++ : Successfully parsed new pubDetails:  
"*\xD2\x02\x1A\x93\x01\n\fEmitter Name\x12\rEmitter 
Title\x1AtiVBORw0KGgoNSUhEUgUFCAYAAACNbyblHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwBJRU5ErkJggg==\"\nThank
 
you!:\x9A\x01\x1A\bGreeting\"\x06Header*\x04""Body2\x06""Footer:\fSingleAnswerJ\x12\x1A\x07Option1\"\x07Option1J\x14\b\x02\x1A\x07Option2\"\x07Option2J\x14\b\x04\x1A\x07Option3\"\x07Option3J\x14\b\x06\x1A\x07Option4\"\x07Option4J\x14\b\b\x1A\x07Option5\"\x07Option5J\x06urgentR\tlightning2\x06\x12\x04none"

So basically this means that the protobuf message gets correctly generated 
on the Javascript side, and even the wire format output is correct as well.
So the issue is with passing this to C++ somehow.

I tried to encode it as hex on the Javascript side, and decode it on the 
C++ side, but it didn't help.
On Friday, February 18, 2022 at 11:39:13 AM UTC+1 Csaba Szigeti wrote:

> In case if I modify my code, so it is passing a simple string as logo, 
> then I can successfully parse the protobuf message on the C++ side :
> ```javascript
> ...
> internal.setLogo("logo") 
> ...
> ```
>
> So I guess that the issue is with this field. The original string is a 
> base64 encoded image. What should I do with this string to fix the parsing?
>
> On Thursday, February 17, 2022 at 8:49:38 PM UTC+1 acoz...@google.com 
> wrote:
>
>> If only UTF-8 messages are being parsed successfully, then that sounds 
>> like a clue to me that you probably need to base64-encode the serialized 
>> message. I have only limited experience with

Re: [protobuf] Re: Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-18 Thread Csaba Szigeti


In case if I modify my code, so it is passing a simple string as logo, then 
I can successfully parse the protobuf message on the C++ side :
```javascript
...
internal.setLogo("logo") 
...
```

So I guess that the issue is with this field. The original string is a 
base64 encoded image. What should I do with this string to fix the parsing?

On Thursday, February 17, 2022 at 8:49:38 PM UTC+1 acoz...@google.com wrote:

> If only UTF-8 messages are being parsed successfully, then that sounds 
> like a clue to me that you probably need to base64-encode the serialized 
> message. I have only limited experience with JavaScript, but from what I 
> understand, JavaScript strings can only represent Unicode and not raw 
> binary data. So if you need to store raw binary in a JavaScript string then 
> you probably want to base64-encode it (and then decode it on the other side 
> before parsing the message).
>
> On Thu, Feb 17, 2022 at 11:28 AM Csaba Szigeti  wrote:
>
>> I am really sorry. Posting again with correct formatting this time : 
>>
>> I would like to pass a protobuf message from Javascript to a C++ 
>> WebAssembly module.
>>
>> I do receive, and can successfully parse the simpler protobuf messages on 
>> the C++ side, however, protobuf is failing to parse the less-simple 
>> protobuf messages.
>>
>> Here is the code that I am using : 
>>
>> ```javascript
>> goog.module('protobufMessageGenerator');
>> goog.require('proto.my_proto.MyMessage');
>>
>> function generateMyMessage() {
>> var msg = new proto.my_proto.MyMessage()
>> var internal = new proto.my_proto.MyMessageInternal()
>> internal.setAccentColor("#CC1D24")
>> 
>> internal.setLogo("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")
>> msg.setInternal(internal)
>> return msg
>> }
>> ```
>>
>> Using the google-closure-compiler, I compile this protobuf message 
>> generator to pure Javascript.
>> I use this code to pass the message to the C++ WebAssembly module : 
>>
>> ```javascript
>> function sendMessage() {
>> 
>> Module.self().setMyMessage(module$contents$protobufMessageGenerator_generateMyMessage().serializeBinary())
>> }
>> sendMessage()
>> ```
>>
>> I receive the message on the C++ side using this code : 
>>
>> ```cpp
>> void JavascriptPublicInterface::setMyMessage(const QString &myMessage)
>> {
>> if (_myMessage != myMessage)
>> {
>> _myMessage = myMessage;
>> emit myMes

Re: [protobuf] Re: Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-17 Thread 'Adam Cozzette' via Protocol Buffers
If only UTF-8 messages are being parsed successfully, then that sounds like
a clue to me that you probably need to base64-encode the serialized
message. I have only limited experience with JavaScript, but from what I
understand, JavaScript strings can only represent Unicode and not raw
binary data. So if you need to store raw binary in a JavaScript string then
you probably want to base64-encode it (and then decode it on the other side
before parsing the message).

On Thu, Feb 17, 2022 at 11:28 AM Csaba Szigeti  wrote:

> I am really sorry. Posting again with correct formatting this time :
>
> I would like to pass a protobuf message from Javascript to a C++
> WebAssembly module.
>
> I do receive, and can successfully parse the simpler protobuf messages on
> the C++ side, however, protobuf is failing to parse the less-simple
> protobuf messages.
>
> Here is the code that I am using :
>
> ```javascript
> goog.module('protobufMessageGenerator');
> goog.require('proto.my_proto.MyMessage');
>
> function generateMyMessage() {
> var msg = new proto.my_proto.MyMessage()
> var internal = new proto.my_proto.MyMessageInternal()
> internal.setAccentColor("#CC1D24")
>
> internal.setLogo("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")
> msg.setInternal(internal)
> return msg
> }
> ```
>
> Using the google-closure-compiler, I compile this protobuf message
> generator to pure Javascript.
> I use this code to pass the message to the C++ WebAssembly module :
>
> ```javascript
> function sendMessage() {
>
> Module.self().setMyMessage(module$contents$protobufMessageGenerator_generateMyMessage().serializeBinary())
> }
> sendMessage()
> ```
>
> I receive the message on the C++ side using this code :
>
> ```cpp
> void JavascriptPublicInterface::setMyMessage(const QString &myMessage)
> {
> if (_myMessage != myMessage)
> {
> _myMessage = myMessage;
> emit myMessageChanged();
> }
> }
>
> void JavascriptPublicInterface::setMyMessageEMS(const std::string
> &myMessage)
> {
> setMyMessage(QString::fromStdString(myMessage));
> }
>
> //...
>
> void startListeningToMyMessage(std::function myMessage)> listener)
> {
> const auto changedListener = [listener]() {
> const auto newMyMessageString =
> JavascriptPublicInterface::self()->myMessage();
> my_proto::MyMessage myMessagePb;
> if
> (myMessagePb.ParseFromString(newMyMessageString.toStdString()))
> {
> qDebug() << "C++ : Succe

[protobuf] Re: Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-17 Thread Csaba Szigeti
I am really sorry. Posting again with correct formatting this time : 

I would like to pass a protobuf message from Javascript to a C++ 
WebAssembly module.

I do receive, and can successfully parse the simpler protobuf messages on 
the C++ side, however, protobuf is failing to parse the less-simple 
protobuf messages.

Here is the code that I am using : 

```javascript
goog.module('protobufMessageGenerator');
goog.require('proto.my_proto.MyMessage');

function generateMyMessage() {
var msg = new proto.my_proto.MyMessage()
var internal = new proto.my_proto.MyMessageInternal()
internal.setAccentColor("#CC1D24")

internal.setLogo("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")
msg.setInternal(internal)
return msg
}
```

Using the google-closure-compiler, I compile this protobuf message 
generator to pure Javascript.
I use this code to pass the message to the C++ WebAssembly module : 

```javascript
function sendMessage() {

Module.self().setMyMessage(module$contents$protobufMessageGenerator_generateMyMessage().serializeBinary())
}
sendMessage()
```

I receive the message on the C++ side using this code : 

```cpp
void JavascriptPublicInterface::setMyMessage(const QString &myMessage)
{
if (_myMessage != myMessage)
{
_myMessage = myMessage;
emit myMessageChanged();
}
}

void JavascriptPublicInterface::setMyMessageEMS(const std::string 
&myMessage)
{
setMyMessage(QString::fromStdString(myMessage));
}

//...

void startListeningToMyMessage(std::function listener)
{
const auto changedListener = [listener]() {
const auto newMyMessageString = 
JavascriptPublicInterface::self()->myMessage();
my_proto::MyMessage myMessagePb;
if 
(myMessagePb.ParseFromString(newMyMessageString.toStdString()))
{
qDebug() << "C++ : Successfully parsed new 
MyMessage: " << newMyMessageString;
}
else
{
qDebug() << "C++ : Failed to parse new MyMessage: " 
<< newMyMessageString;
}

qDebug() << "MyMessage received: " << 
QString::fromStdString(myMessagePb.DebugString());

listener(myMessagePb);
};
if (!QObject::connect(JavascriptPublicInterface::self(), 
&JavascriptPublicInterface::myMessageChanged, changedListener))
{
    throw std::runtime_error("Failed to connect to 
JavascriptPublicInterface myMessageChanged");
}
}
```

In the Javascript console I see : "C++ : Failed to parse new MyMessage: ..."

I guess that it can be relate

[protobuf] Passing protobuf message from Javascript to C++ WebAssembly module

2022-02-17 Thread Csaba Szigeti
I would like to pass a protobuf message from Javascript to a C++ 
WebAssembly module.

I do receive, and can successfully parse the simpler protobuf messages on 
the C++ side, however, protobuf is failing to parse the less-simple 
protobuf messages.

Here is the code that I am using :
```
goog.module('protobufMessageGenerator'); 
goog.require('proto.my_proto.MyMessage'); function generateMyMessage() { 
var msg = new proto.my_proto.MyMessage() var internal = new 
proto.my_proto.MyMessageInternal() internal.setAccentColor("#CC1D24") 
internal.setLogo("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")
 
msg.setInternal(internal) return msg }
```
Using the google-closure-compiler, I compile this protobuf message 
generator to pure Javascript. I use this code to pass the message to the 
C++ WebAssembly module :
```
function sendMessage() { 
Module.self().setMyMessage(module$contents$protobufMessageGenerator_generateMyMessage().serializeBinary())
 
} sendMessage()
```
I receive the message on the C++ side using this code :
```
void JavascriptPublicInterface::setMyMessage(const QString &myMessage) { if 
(_myMessage != myMessage) { _myMessage = myMessage; emit 
myMessageChanged(); } } void 
JavascriptPublicInterface::setMyMessageEMS(const std::string &myMessage) { 
setMyMessage(QString::fromStdString(myMessage)); } //... void 
startListeningToMyMessage(std::function listener) { const auto changedListener = [listener]() { const 
auto newMyMessageString = JavascriptPublicInterface::self()->myMessage(); 
my_proto::MyMessage myMessagePb; if 
(myMessagePb.ParseFromString(newMyMessageString.toStdString())) { qDebug() 
<< "C++ : Successfully parsed new MyMessage: " << newMyMessageString; } 
else { qDebug() << "C++ : Failed to parse new MyMessage: " << 
newMyMessageString; } qDebug() << "MyMessage received: " << 
QString::fromStdString(myMessagePb.DebugString()); listener(myMessagePb); 
}; if (!QObject::connect(JavascriptPublicInterface::self(), 
&JavascriptPublicInterface::myMessageChanged, changedListener)) { throw 
std::runtime_error("Failed to connect to JavascriptPublicInterface 
myMessageChanged"); } }
```


In the Javascript console I see : "C++ : Failed to parse new MyMessage: ..."

I guess that it can be related to the fact that Javascript is using UTF-16 
and C++ is using UTF-8 encoding (because the messages that are UTF-8 only 
can be successfully parsed), so I tried to fix the sending and receiving 
like this:

```
//For more info see : 
https://emscripten.org/docs/api_reference/emscripten.h.html?highlight=stringtoutf8
 
function convertUtf16ToUtf8(input) { var uint8Arr = input var jsString = 
String.fromCharCode.apply(null, uint8Arr) var lengthB

[protobuf] Re: Diff and merge functionality in javascript

2022-01-24 Thread 'Deanna Garcia' via Protocol Buffers
Can you use MergeFrom 

?

On Tuesday, January 18, 2022 at 2:55:01 AM UTC-8 kzwe...@gmail.com wrote:

> Hi,
>
> Is there a way to get a diff and merge that diff into an instance of a 
> message?
> E.g. I saw there is a static method on Message class 'difference', that 
> returns a new message instance with the fields of param2 that are not 
> represented in param1.
> Any existing methods that can merge the diff?
>
> With kinds regards
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/694971fa-27f8-40a5-9b10-41649fddfafcn%40googlegroups.com.


[protobuf] Diff and merge functionality in javascript

2022-01-18 Thread Koen
Hi,

Is there a way to get a diff and merge that diff into an instance of a 
message?
E.g. I saw there is a static method on Message class 'difference', that 
returns a new message instance with the fields of param2 that are not 
represented in param1.
Any existing methods that can merge the diff?

With kinds regards

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/d02bd9cb-bfd5-47c7-aa1b-651c03d7ef70n%40googlegroups.com.


[protobuf] Re: Javascript library: Serialization/ deserialization into bytes type gives wrong data

2021-05-10 Thread Ben B
Does anyone who uses or contributes to javascript + protobuf have any idea 
regarding my previous question?

Thanks :)

On Friday, 7 May 2021 at 19:59:10 UTC+1 Ben B wrote:

> Dear Protobuf team,
>
> I was looking to serialize Float32's or Int16 (or other arbitrary data 
> type) so I've decided to use the bytes type. Unfortunately, In Javascript, 
> I've had to convert this data into UInt8 to serialize it. This wasn't too 
> ergonomic because it involves using DataViews, because UInt8 is required to 
> `setBytes` and Int8Array(floatArray) will cast the numbers individually. In 
> the end, that's not a problem though.
>
> However, deserializing this data back out results in incorrect values:
> const { BytesMessage } = require('./protobuf/BytesMessage_pb');
>
> const message = new BytesMessage();
> const int16Array = new Int16Array([0, 1000, 2000]);
> const dataView = new DataView(int16Array.buffer);
> const uint8 = new Uint8Array(dataView.buffer);
> message.setSomeBytes(uint8);
> const bytes = message.serializeBinary(); // <--- This seems to negatively 
> affect the output
>
> const uint8before = message.getSomeBytes() as Uint8Array;
> const int16Before = new Int16Array(new 
> DataView(uint8before.buffer).buffer);
>
> const deserializedMessage = BytesMessage.deserializeBinary(bytes);
> const uint8after = deserializedMessage.getSomeBytes() as Uint8Array;
> const int16After = new Int16Array(new DataView(uint8after.buffer).buffer);
> console.log({ uint8before, uint8after });
> console.log({ int16Before, int16After });
>
> The output showing the inconsistency between *int16Before* and 
> *int16After*:
> {
>   uint8before: Uint8Array(6) [ 0, 0, 232, 3, 208, 7 ],
>   uint8after: Uint8Array(6) [ 0, 0, 232, 3, 208, 7 ]
> }
> {
>   int16Before: Int16Array(3) [ 0, 1000, 2000 ],
>   int16After: Int16Array(4) [ 1546, 0, 1000, 2000 ] <-- Notice this one is 
> different to the original.
> }
>
> I am not sure why this is the case. As you can see, the exact same code is 
> run, the difference between *before* and *after is whether is call 
> serializeBinary*. I have created a minimum example here in this repo: 
> https://github.com/ben-xD/google-protobuf-js-issue-1
>
> Please let me know what you think, is it my programming mistake or is it a 
> bug?
>
> Thanks!
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/d09cc722-bd49-4ab2-a25b-e271d7f41ff4n%40googlegroups.com.


[protobuf] Javascript library: Serialization/ deserialization into bytes type gives wrong data

2021-05-07 Thread Ben B
Dear Protobuf team,

I was looking to serialize Float32's or Int16 (or other arbitrary data 
type) so I've decided to use the bytes type. Unfortunately, In Javascript, 
I've had to convert this data into UInt8 to serialize it. This wasn't too 
ergonomic because it involves using DataViews, because UInt8 is required to 
`setBytes` and Int8Array(floatArray) will cast the numbers individually. In 
the end, that's not a problem though.

However, deserializing this data back out results in incorrect values:
const { BytesMessage } = require('./protobuf/BytesMessage_pb');

const message = new BytesMessage();
const int16Array = new Int16Array([0, 1000, 2000]);
const dataView = new DataView(int16Array.buffer);
const uint8 = new Uint8Array(dataView.buffer);
message.setSomeBytes(uint8);
const bytes = message.serializeBinary(); // <--- This seems to negatively 
affect the output

const uint8before = message.getSomeBytes() as Uint8Array;
const int16Before = new Int16Array(new DataView(uint8before.buffer).buffer);

const deserializedMessage = BytesMessage.deserializeBinary(bytes);
const uint8after = deserializedMessage.getSomeBytes() as Uint8Array;
const int16After = new Int16Array(new DataView(uint8after.buffer).buffer);
console.log({ uint8before, uint8after });
console.log({ int16Before, int16After });

The output showing the inconsistency between *int16Before* and *int16After*:
{
  uint8before: Uint8Array(6) [ 0, 0, 232, 3, 208, 7 ],
  uint8after: Uint8Array(6) [ 0, 0, 232, 3, 208, 7 ]
}
{
  int16Before: Int16Array(3) [ 0, 1000, 2000 ],
  int16After: Int16Array(4) [ 1546, 0, 1000, 2000 ] <-- Notice this one is 
different to the original.
}

I am not sure why this is the case. As you can see, the exact same code is 
run, the difference between *before* and *after is whether is call 
serializeBinary*. I have created a minimum example here in this 
repo: https://github.com/ben-xD/google-protobuf-js-issue-1

Please let me know what you think, is it my programming mistake or is it a 
bug?

Thanks!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/dddb9e35-4268-4cfd-bc7f-53a67d3f1d9fn%40googlegroups.com.


[protobuf] JavaScript still supported?

2020-11-29 Thread Ottmar Zittlau

I'm trying to parse a protobuf-packet in the browser and while trying to 
get this working encountered several questions:

1. Is it possible to use protobuf without node and the closure library?

2. When I use the closure-builder to build a javascript-file that I can run 
in the browser I encounter the error "depstree.NamespaceNotFoundError: 
Namespace "jspb.BinaryReader" never provided."
When I grep for this thing, I see two things

a. The npm-installed "google-protobuf"-module contains multiple usages 
but no file that contains "goog.provide('jspb.BinaryReader')"

b. The manually downloaded protobuf-repository contains the file 
"js/binary/reader.js" that apparently contains the definition.

2. The fact that the protobuf-repository version contains the 
"jsbp.BinaryReader" made me play around with this option.
After playing around for a while, I figured out, that it is necessary to 
run "npm install" before "gulp dist" as pointed out in the documentation 
(https://developers.google.com/protocol-buffers/docs/reference/javascript-generated).
 
This generates the "google-protobuf.js" file.

Is this the correct way? Does this answer my first question with "no" - as 
this step requires node?

3. I now tried to run the "closure-builder" again (I use the closure 
library version that was installed in the previous step):
./protobuf/js/node_modules/google-closure-library/closure/bin/build/closurebuilder.py
 
\
--root="protobuf/js" \
--root="testJS/" \
--namespace="proto.test"
The folder "testJS" contains the javascript-files produced by protoc.

This produces the error:

depstree.MultipleProvideError: Namespace "protobuf.runtime.KernelTest" 
provided more than once in sources:
PathSource protobuf/js/experimental/runtime/kernel/kernel_repeated_test.js
PathSource protobuf/js/experimental/runtime/kernel/kernel_test.js

My next idea was to include only the subfolders of "protobuf/js" that I 
need - however, this doesn't work, as I need to include 
"protobuf/js/message.js" because this file contains 
"goog.provide('jspb.Message')" - the definition of "jsbp.Message".

How can I handle this? Do I need to include all files individually with the 
"-i" option? I have noticed, that there is an exclude option on the current 
master of protobuf (which seems to break the "closure-builder" on the 
current master branch - but apparently there is already a fix underway) - 
do I need to use this option?

4. Final question - does all this stuff make sense? Is anybody using a 
similar approach or is there a different, simpler way to get protobuf 
working in a browser?

Thanks
ou

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/82518d50-c4c6-4293-8d72-156a430ce1bbn%40googlegroups.com.


[protobuf] Re: Javascript - where is google-protobuf.js

2020-10-02 Thread guydi...@gmail.com
,A);A
> =v(2);if(0 ])}A=v(3);if(null!=A){var D=A;null!=D&&(l(p,3,0),p.a.a.push(D?1:0))}for(
> var E=new Uint8Array(p.b+p.a.length()),F=p.c,G=F.length,H=0,I=0;I var J=F[I];E.set(J,H);H+=J.length}var K=k(p.a);E.set(K,H);p.c=[E];console.
> log(E);
>
>
>
> With advanced optimisations, which is just 2.1KB. 
>
> My assumption is that you wouldn't want 230KB runtime so the compilation 
> strategy is what you're after... So I'll be preparing a guide on how to do 
> that for my website, you can add me on keybase so I'll post it to you, or 
> I'll submit to the newsletter too. 
>
> There's also https://www.npmjs.com/package/protobufjs library which 
> allows to generate static js code too and their runtime is 20kb. It's also 
> 7 times faster than google's but I don't like it because I can't compile 
> their code and it installs hell of a lot of dependencies. They cheat npm 
> dependency count as they have only < 10 specified in package.json, but once 
> you start compiling protos it will pull uglify etc so you'll end up with 
> hundreds of deps. Speed is not a factor for me I'm just looking into RPC 
> API implementation instead of rest, and protobufs also provide message 
> hiding so that people can't inspect network requests.
>
> Best regards, 
> Ned. 
>
>
> On Thursday, July 9, 2020 at 9:45:41 PM UTC+3, Michael Lum wrote:
>>
>> Hi, I've searched for quite a while but I cannot find the file: 
>> *google-protobuf.js*.
>>
>> I followed this link:  
>> https://github.com/protocolbuffers/protobuf/tree/master/js
>>
>> I'm using the *CommonJS imports *instructions.
>>
>> I built my protobuf files using a docker image that contains the 
>> Javascript plugin this way:
>>
>> docker run --rm --user "$(id -u):$(id -g)" -v $(pwd):$(pwd) -w $(pwd) 
>> gwihlidal/protoc --js_out=import_style=commonjs,binary:. -I. ./myproto.proto
>>
>> This produced:  myproto_pb.js
>>
>> Now the link above says I need google-protobuf.js but that file does not 
>> exist.
>>
>> I am not using Node nor gulp, so 'gulp dist' does not work.
>>
>> I've tried looking at multiple threads here but none indicate where this 
>> file is.
>> I've downloaded protobuf-js-3.12.3.zip but it's not in there.
>>
>> I want to generate protobuf messages in  a browser not from Node.
>>
>> Thanks for any help
>>
>>
>>
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/4af16994-e80b-4a3d-a0c7-6e1ea17ec391n%40googlegroups.com.


[protobuf] Immediately Interview Senior JavaScript engineering with 10 Years of experience for my client in New York City . (100% interview with in 24/hr)

2020-09-09 Thread syed faheem
Hello Associates,

Any available local consultants for Senior JavaScript engineering. I have
an excellent project with my client at  New York City (remote start, but
will be working on-site with team Jan. 2021).



Kindly share suitable profiles at  *fah...@mirthconsulting.net*




Job Title: Senior JavaScript engineering

Location : New York City (remote start, but will be working on-site with
team Jan. 2021)

Duration : 24+ months (estimated between 2-3 years)

* H4 EAD, TN VISA, GC OR US Citizens required …..*

*Only Independent consultants…*

*Don’t submit consultants who work through Employers….*

*Must have atleast 10 Years of experience ….*



   - Senior-level JavaScript engineering expertise - less focused on
   Pixel-Perfect development (*although an understanding of UX principles
   and standards is important*) and more geared towards "code in the
   browser "
   - Expert in ECMA6 / ECMA7.  *For example*:
  - Promises
  - Scoping
  - Literals
  - Map/Set, WeakMap, WeakSet
  - Arrow Functions
  - Typed Arrays
  - Classes
  - Destructuring
   - Expert in CSS & Preprocessors such as LESS, Stylus, etc.
   - Possess a solid understanding of two or more component-based
   frameworks and their ecosystems (*Vue and either React and/or Vanilla)*
   - Have an appreciation for the complexities associated with writing
   JavaScript SDKs, libraries and third-party integration code.  The JS that
   this Engineer will write will talk directly to Java-based Microservices &
   RESTful Services
   - Will have gained expertise in enterprise-class shops engineering
   solutions that function at scale.  The bigger and cloudier, the better.
   - Ideal candidate will have worked on Tokenization, Encryption,
   Signatures, etc. in a JS context
   - Possesses a Quality Engineering mindset & gladly writes Unit Tests (*using
   tools such as Mocha, Karma, Protractor, Cucumber, Jasmine, etc.*) with a
   smile on their face
   - We DO NOT want JS Ninjas, Script Kiddies, or Web Vikings.  We're
   talking about true Engineers who have plowed their programming career
   furrow using JavaScript, as opposed to *Java, C#, etc. *Candidates
   should know JavaScript backwards and forwards.

-

Thanks & Regards.

Syed Faheem | Technical Recruiter

[image: http://www.mirthconsulting.net/assets/images/mirth2.png]

6353 N  Claremont Ave Chicago, IL. 60659

Direct: 312-428-5615

*fah...@mirthconsulting.net|  www.mirthconsulting.net|*


*https://www.linkedin.com/company/mirth-consulting-inc*
<https://www.linkedin.com/company/mirth-consulting-inc/>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAOQ7AkrihtrpVw1h_m_zhEH-63ME5np_aBRnEnzU5jcncS%2Bc7w%40mail.gmail.com.


[protobuf] Re: Javascript - where is google-protobuf.js

2020-07-10 Thread zad0m
Hi Michael

I've been wondering exact same question recently, the way I found it was to:

`yarn add google-protobuf`

I know you're not using Node but just use yarn (or npm i google-protobuf) 
to add the node_modules folder. You need `yarn init` or `npm init -y` first 
to make sure there's package.json otherwise the dependency won't save.

This will add the package to your node_modules

Then inside the package you'll have the google-protobuf.js file.

Hope this helps.

But the file is massive, 230KB! Because it's the full unoptimised runtime. 
What I've been working lately is generating a static JS file from a proto 
and then compiling it with Closure Compiler. That's the right way to do it, 
using a test file from the protobuf js project I got:

goog.require(/*depack*/ 'proto.jspb.test.Simple1');


var message = new proto.jspb.test.Simple1();
message.setARepeatedStringList(['hello'])
message.setAString('world')
const binary = message.serializeBinary()

This simple interface was compiled into 


/*


 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
function f(b,a){function c(){}c.prototype=a.prototype;b.prototype=new c;b.
prototype.constructor=b};function g(){this.a=[]}g.prototype.length=function
(){return this.a.length};function k(b){var a=b.a;b.a=[];return a};function l
(b,a,c){b=b.a;for(a=8*a+c;127>>=7;b.a.push(a)}
function n(b,a){var c=p;if(null!=a){l(c,b,2);b=k(c.a);c.c.push(b);c.b+=b.
length;b.push(c.b);for(var e=c.a,h=0;hd)e.a.push(d);else if(2048>d)e.a.push(d>>6|192),e.a.push(d&63|128);
else if(65536>d)if(55296<=d&&56319>=d&&h+1=m&&(d=1024*(d-55296)+m-56320+65536,e.a.push(d>>18|240),e.
a.push(d>>12&63|128),e.a.push(d>>6&63|128),e.a.push(d&63|128),h++)}else e.a.
push(d>>12|224),e.a.push(d>>6&63|128),e.a.push(d&63|
128)}a=b.pop();for(a=c.b+c.a.length()-a;127>>=7,c.b
++;b.push(a);c.b++}};function q(){}var r="function"==typeof Uint8Array,t=
Object.freeze?Object.freeze([]):[];function u(b){var a=b.c+b.f;b.a[a]||(b.b=
b.a[a]={})}function v(b){var a=w;if(bhttps://www.npmjs.com/package/protobufjs library which allows 
to generate static js code too and their runtime is 20kb. It's also 7 times 
faster than google's but I don't like it because I can't compile their code 
and it installs hell of a lot of dependencies. They cheat npm dependency 
count as they have only < 10 specified in package.json, but once you start 
compiling protos it will pull uglify etc so you'll end up with hundreds of 
deps. Speed is not a factor for me I'm just looking into RPC API 
implementation instead of rest, and protobufs also provide message hiding 
so that people can't inspect network requests.

Best regards, 
Ned. 


On Thursday, July 9, 2020 at 9:45:41 PM UTC+3, Michael Lum wrote:
>
> Hi, I've searched for quite a while but I cannot find the file: 
> *google-protobuf.js*.
>
> I followed this link:  
> https://github.com/protocolbuffers/protobuf/tree/master/js
>
> I'm using the *CommonJS imports *instructions.
>
> I built my protobuf files using a docker image that contains the 
> Javascript plugin this way:
>
> docker run --rm --user "$(id -u):$(id -g)" -v $(pwd):$(pwd) -w $(pwd) 
> gwihlidal/protoc --js_out=import_style=commonjs,binary:. -I. ./myproto.proto
>
> This produced:  myproto_pb.js
>
> Now the link above says I need google-protobuf.js but that file does not 
> exist.
>
> I am not using Node nor gulp, so 'gulp dist' does not work.
>
> I've tried looking at multiple threads here but none indicate where this 
> file is.
> I've downloaded protobuf-js-3.12.3.zip but it's not in there.
>
> I want to generate protobuf messages in  a browser not from Node.
>
> Thanks for any help
>
>
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/47893fbb-4bf8-4c4f-8716-7c2edff140c3o%40googlegroups.com.


[protobuf] Javascript - where is google-protobuf.js

2020-07-09 Thread Michael Lum
Hi, I've searched for quite a while but I cannot find the file: 
*google-protobuf.js*.

I followed this link:  
https://github.com/protocolbuffers/protobuf/tree/master/js

I'm using the *CommonJS imports *instructions.

I built my protobuf files using a docker image that contains the Javascript 
plugin this way:

docker run --rm --user "$(id -u):$(id -g)" -v $(pwd):$(pwd) -w $(pwd) 
gwihlidal/protoc --js_out=import_style=commonjs,binary:. -I. ./myproto.proto

This produced:  myproto_pb.js

Now the link above says I need google-protobuf.js but that file does not 
exist.

I am not using Node nor gulp, so 'gulp dist' does not work.

I've tried looking at multiple threads here but none indicate where this 
file is.
I've downloaded protobuf-js-3.12.3.zip but it's not in there.

I want to generate protobuf messages in  a browser not from Node.

Thanks for any help





-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/8c901c19-f63e-464b-a46b-780de79d9f47o%40googlegroups.com.


[protobuf] How to encode messages with "map" using google-protobuf in JavaScript

2020-06-29 Thread Hee-Jung Chae
The proto file I defined is as follows.


```
syntax = "proto3";
package live;
message Op{
  string cmd = 1;
  bool rsp = 2;
  map args = 3;
}
```

The above proto file was converted to javascript using PROTOC. 
And the converted file contains the following functions:

```
proto.live.Op.toObject = function(includeInstance, msg) {}
proto.live.Op.deserializeBinary = function(bytes) {};
proto.live.Op.deserializeBinaryFromReader = function(msg, reader) {};

proto.live.Op.prototype.serializeBinary = function() {};
proto.live.Op.serializeBinaryToWriter = function(message, writer) {};
proto.live.Op.prototype.getCmd = function() {};
proto.live.Op.prototype.setCmd = function(value) {};
proto.live.Op.prototype.getRsp = function() {};
proto.live.Op.prototype.setRsp = function(value) {};
proto.live.Op.prototype.getArgsMap = function(opt_noLazyCreate) {};
proto.live.Op.prototype.clearArgsMap = function() {};
```
Referring to the example shown in GitHub, it can be seen that setCmd() and 
setRsp() are used to encode messages. However, no function such as 
"setArgs()" was found for data of the map type. 
The getArgsMap() function seems to be for decoding. How can I encode the 
message including the data of the map type.


* example for encoding message (shown in GitHub)
```
var message = new MyMessage();
message.setName("John Doe");
message.setAge(25);
message.setPhoneNumbers(["800-555-1212", "800-555-"]);
var bytes = message.serializeBinary();
```


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/87cfa9d5-3639-4f24-89e6-c5b7e4334fb1o%40googlegroups.com.


[protobuf] Question: JavaScript Object Literals

2020-06-15 Thread Will Tatum
All,

I'm just now starting to use protobuf by way of the support for grpc in 
NodeJS with TypeScript. One thing that stands out to me right away is that 
the syntax for initializing and "hydrating" messages is pretty clunky. Just 
a basic hello world operations has a lot of "ceremony" in order to 
initialize data objects and populate values:

sayHello: handleUnaryCall = (call, callback) 
> => {
> console.log("Handling call", call)
> const {name} = call.request.toObject()
> 
> const reply = new HelloReply()
> reply.setMessage(`Hello ${name}`)
> 
> callback(null, reply)
> }
>
 
It feels to me like the most common cases would simply use object literals, 
or at the very least esnext compatible setters on the value objects. I 
found a request for such a feature in the grpc-node project

https://github.com/grpc/grpc-node/issues/1378

and it looks like the original poster was directed to inquire about it from 
the protobuf project. I didn't see a corresponding feature request and 
before raising one myself I wanted to just ask as a general question. Is 
there a more user friendly way to do this? The .toObject function doesn't 
really seem to help since it's only "one way". I'd really love to be able 
to rewrite the above as this instead:

sayHello: handleUnaryCall = (call, callback) 
> => {
> console.log("Handling call", call)
> const {name} = call.request
> 
> callback(null, { message : `Hello ${name}` })
> }
>
 
Not only is it shorter, and more idiomatic, it also has the advantage in 
TypeScript of checking for exhaustivity (all non-null properties must be 
set) which isn't really possible with the setter-based solution.

Thanks

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/24557d7a-3e87-451a-9720-089603b72d15o%40googlegroups.com.


[protobuf] Using closure imports with javascript

2019-02-23 Thread Valentin Johansson
Greetings!

I have setup a page with javascript that uses the closure imports.
In the reference page of protocol buffers they talk about importing your 
generated statements using closure imports as follow:

goog.require('proto.my.package.MyMessage');

var message = proto.my.package.MyMessage();



>From what I can see there are no further details on how you read/write to a 
specific variables from your module.
At the moment I have two variables in a module called loginInformation: 
username and password (both are strings). My question is how I can write 
and reads to those using the closure import.

I have tried to write the following line:
var message = new proto.commpackage.loginInformation().setUsername("test");
To insert a string to the username variable, but I am unsure if that is 
correct and how I would proceed to read from that.


Kind regards
Valentin

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
But that oneof says, only one field should be set at a time , and in my
example I need all of my fields to be set.

On 13-Feb-2018 23:49, "Adam Cozzette"  wrote:

> Oneof fields are great for representing that, though: https://developers.
> google.com/protocol-buffers/docs/proto#oneof
>
> On Tue, Feb 13, 2018 at 10:15 AM, Yaseen Khan 
> wrote:
>
>> But a single message can have various data types as seen in the example..
>> The message Master {..}
>>
>> On 13-Feb-2018 23:41, "Adam Cozzette"  wrote:
>>
>> I mean to say just don't rely on the field names at all, and instead
>> store all the information you need in the serialized message. For example,
>> your serialized message could store a map that maps the
>> string property name to another message called DataType describing the kind
>> of data associated with that property.
>>
>> On Tue, Feb 13, 2018 at 10:05 AM, Yaseen Khan 
>> wrote:
>>
>>> I'm sorry I don't understand. How would you serialise the field names?
>>>
>>> On 13-Feb-2018 23:32, "Adam Cozzette"  wrote:
>>>
 Ah, I see. I would try to find a way to do this without trying to rely
 on reflection, perhaps by serializing the names you need inside a proto
 message without using the actual field names.

 On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan >>> > wrote:

> A dynamic form needs keys and values(if any) to be fed to it to create
> a form. I was thinking I could get the names of the properties in a msg
> with a descriptor and feeding it to create a dynamic form.
>
> Although a crude way of doing it is converting the jspb proto object
> to a normal Object and reading its keys,.. I didn't find it to be a good
> approach.
>
> On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:
>
>> But ordinarily you parse messages without needing any
>> descriptors--why do need a descriptor to read your message?
>>
>> On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan <
>> khan.charlie...@gmail.com> wrote:
>>
>>> Trying to create dynamic forms by reading proto msgs.
>>>
>>> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>>>
 What do you want to do with the descriptors?

 On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
 khan.charlie...@gmail.com> wrote:

> So, could you possibly give me the work around for it? It would be
> very helpful. Thanks!
>
> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>>
>> I'm trying to get the descriptor for my proto message. In java
>> there is this, Message.getDescriptor()
>> which does the job but its hard to find something similar in jspb.
>>
>> syntax = "proto3";
>>
>> message Master {
>> int32 id = 1;
>> string name = 2;
>> Type type = 3;
>> }
>>
>> enum Type {
>> UNKNOWN_TYPE = 0;
>> INDUSTRY_TYPE = 1;
>> LOCATION_TYPE = 2;
>> }
>>
>> This is the message of which i want the descriptor of.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>


>>

>>
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
Oneof fields are great for representing that, though:
https://developers.google.com/protocol-buffers/docs/proto#oneof

On Tue, Feb 13, 2018 at 10:15 AM, Yaseen Khan 
wrote:

> But a single message can have various data types as seen in the example..
> The message Master {..}
>
> On 13-Feb-2018 23:41, "Adam Cozzette"  wrote:
>
> I mean to say just don't rely on the field names at all, and instead store
> all the information you need in the serialized message. For example, your
> serialized message could store a map that maps the string
> property name to another message called DataType describing the kind of
> data associated with that property.
>
> On Tue, Feb 13, 2018 at 10:05 AM, Yaseen Khan 
> wrote:
>
>> I'm sorry I don't understand. How would you serialise the field names?
>>
>> On 13-Feb-2018 23:32, "Adam Cozzette"  wrote:
>>
>>> Ah, I see. I would try to find a way to do this without trying to rely
>>> on reflection, perhaps by serializing the names you need inside a proto
>>> message without using the actual field names.
>>>
>>> On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan 
>>> wrote:
>>>
 A dynamic form needs keys and values(if any) to be fed to it to create
 a form. I was thinking I could get the names of the properties in a msg
 with a descriptor and feeding it to create a dynamic form.

 Although a crude way of doing it is converting the jspb proto object to
 a normal Object and reading its keys,.. I didn't find it to be a good
 approach.

 On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:

> But ordinarily you parse messages without needing any descriptors--why
> do need a descriptor to read your message?
>
> On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan <
> khan.charlie...@gmail.com> wrote:
>
>> Trying to create dynamic forms by reading proto msgs.
>>
>> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>>
>>> What do you want to do with the descriptors?
>>>
>>> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
>>> khan.charlie...@gmail.com> wrote:
>>>
 So, could you possibly give me the work around for it? It would be
 very helpful. Thanks!

 On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>
> I'm trying to get the descriptor for my proto message. In java
> there is this, Message.getDescriptor()
> which does the job but its hard to find something similar in jspb.
>
> syntax = "proto3";
>
> message Master {
> int32 id = 1;
> string name = 2;
> Type type = 3;
> }
>
> enum Type {
> UNKNOWN_TYPE = 0;
> INDUSTRY_TYPE = 1;
> LOCATION_TYPE = 2;
> }
>
> This is the message of which i want the descriptor of.
>
 --
 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+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at https://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>
>>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
But a single message can have various data types as seen in the example..
The message Master {..}

On 13-Feb-2018 23:41, "Adam Cozzette"  wrote:

I mean to say just don't rely on the field names at all, and instead store
all the information you need in the serialized message. For example, your
serialized message could store a map that maps the string
property name to another message called DataType describing the kind of
data associated with that property.

On Tue, Feb 13, 2018 at 10:05 AM, Yaseen Khan 
wrote:

> I'm sorry I don't understand. How would you serialise the field names?
>
> On 13-Feb-2018 23:32, "Adam Cozzette"  wrote:
>
>> Ah, I see. I would try to find a way to do this without trying to rely on
>> reflection, perhaps by serializing the names you need inside a proto
>> message without using the actual field names.
>>
>> On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan 
>> wrote:
>>
>>> A dynamic form needs keys and values(if any) to be fed to it to create a
>>> form. I was thinking I could get the names of the properties in a msg with
>>> a descriptor and feeding it to create a dynamic form.
>>>
>>> Although a crude way of doing it is converting the jspb proto object to
>>> a normal Object and reading its keys,.. I didn't find it to be a good
>>> approach.
>>>
>>> On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:
>>>
 But ordinarily you parse messages without needing any descriptors--why
 do need a descriptor to read your message?

 On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan >>> > wrote:

> Trying to create dynamic forms by reading proto msgs.
>
> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>
>> What do you want to do with the descriptors?
>>
>> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
>> khan.charlie...@gmail.com> wrote:
>>
>>> So, could you possibly give me the work around for it? It would be
>>> very helpful. Thanks!
>>>
>>> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:

 I'm trying to get the descriptor for my proto message. In java
 there is this, Message.getDescriptor()
 which does the job but its hard to find something similar in jspb.

 syntax = "proto3";

 message Master {
 int32 id = 1;
 string name = 2;
 Type type = 3;
 }

 enum Type {
 UNKNOWN_TYPE = 0;
 INDUSTRY_TYPE = 1;
 LOCATION_TYPE = 2;
 }

 This is the message of which i want the descriptor of.

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To post to this group, send email to protobuf@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
I mean to say just don't rely on the field names at all, and instead store
all the information you need in the serialized message. For example, your
serialized message could store a map that maps the string
property name to another message called DataType describing the kind of
data associated with that property.

On Tue, Feb 13, 2018 at 10:05 AM, Yaseen Khan 
wrote:

> I'm sorry I don't understand. How would you serialise the field names?
>
> On 13-Feb-2018 23:32, "Adam Cozzette"  wrote:
>
>> Ah, I see. I would try to find a way to do this without trying to rely on
>> reflection, perhaps by serializing the names you need inside a proto
>> message without using the actual field names.
>>
>> On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan 
>> wrote:
>>
>>> A dynamic form needs keys and values(if any) to be fed to it to create a
>>> form. I was thinking I could get the names of the properties in a msg with
>>> a descriptor and feeding it to create a dynamic form.
>>>
>>> Although a crude way of doing it is converting the jspb proto object to
>>> a normal Object and reading its keys,.. I didn't find it to be a good
>>> approach.
>>>
>>> On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:
>>>
 But ordinarily you parse messages without needing any descriptors--why
 do need a descriptor to read your message?

 On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan >>> > wrote:

> Trying to create dynamic forms by reading proto msgs.
>
> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>
>> What do you want to do with the descriptors?
>>
>> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
>> khan.charlie...@gmail.com> wrote:
>>
>>> So, could you possibly give me the work around for it? It would be
>>> very helpful. Thanks!
>>>
>>> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:

 I'm trying to get the descriptor for my proto message. In java
 there is this, Message.getDescriptor()
 which does the job but its hard to find something similar in jspb.

 syntax = "proto3";

 message Master {
 int32 id = 1;
 string name = 2;
 Type type = 3;
 }

 enum Type {
 UNKNOWN_TYPE = 0;
 INDUSTRY_TYPE = 1;
 LOCATION_TYPE = 2;
 }

 This is the message of which i want the descriptor of.

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To post to this group, send email to protobuf@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
I'm sorry I don't understand. How would you serialise the field names?

On 13-Feb-2018 23:32, "Adam Cozzette"  wrote:

> Ah, I see. I would try to find a way to do this without trying to rely on
> reflection, perhaps by serializing the names you need inside a proto
> message without using the actual field names.
>
> On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan 
> wrote:
>
>> A dynamic form needs keys and values(if any) to be fed to it to create a
>> form. I was thinking I could get the names of the properties in a msg with
>> a descriptor and feeding it to create a dynamic form.
>>
>> Although a crude way of doing it is converting the jspb proto object to a
>> normal Object and reading its keys,.. I didn't find it to be a good
>> approach.
>>
>> On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:
>>
>>> But ordinarily you parse messages without needing any descriptors--why
>>> do need a descriptor to read your message?
>>>
>>> On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan 
>>> wrote:
>>>
 Trying to create dynamic forms by reading proto msgs.

 On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:

> What do you want to do with the descriptors?
>
> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
> khan.charlie...@gmail.com> wrote:
>
>> So, could you possibly give me the work around for it? It would be
>> very helpful. Thanks!
>>
>> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>>>
>>> I'm trying to get the descriptor for my proto message. In java there
>>> is this, Message.getDescriptor()
>>> which does the job but its hard to find something similar in jspb.
>>>
>>> syntax = "proto3";
>>>
>>> message Master {
>>> int32 id = 1;
>>> string name = 2;
>>> Type type = 3;
>>> }
>>>
>>> enum Type {
>>> UNKNOWN_TYPE = 0;
>>> INDUSTRY_TYPE = 1;
>>> LOCATION_TYPE = 2;
>>> }
>>>
>>> This is the message of which i want the descriptor of.
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
Ah, I see. I would try to find a way to do this without trying to rely on
reflection, perhaps by serializing the names you need inside a proto
message without using the actual field names.

On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan 
wrote:

> A dynamic form needs keys and values(if any) to be fed to it to create a
> form. I was thinking I could get the names of the properties in a msg with
> a descriptor and feeding it to create a dynamic form.
>
> Although a crude way of doing it is converting the jspb proto object to a
> normal Object and reading its keys,.. I didn't find it to be a good
> approach.
>
> On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:
>
>> But ordinarily you parse messages without needing any descriptors--why do
>> need a descriptor to read your message?
>>
>> On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan 
>> wrote:
>>
>>> Trying to create dynamic forms by reading proto msgs.
>>>
>>> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>>>
 What do you want to do with the descriptors?

 On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan <
 khan.charlie...@gmail.com> wrote:

> So, could you possibly give me the work around for it? It would be
> very helpful. Thanks!
>
> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>>
>> I'm trying to get the descriptor for my proto message. In java there
>> is this, Message.getDescriptor()
>> which does the job but its hard to find something similar in jspb.
>>
>> syntax = "proto3";
>>
>> message Master {
>> int32 id = 1;
>> string name = 2;
>> Type type = 3;
>> }
>>
>> enum Type {
>> UNKNOWN_TYPE = 0;
>> INDUSTRY_TYPE = 1;
>> LOCATION_TYPE = 2;
>> }
>>
>> This is the message of which i want the descriptor of.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>


>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
A dynamic form needs keys and values(if any) to be fed to it to create a
form. I was thinking I could get the names of the properties in a msg with
a descriptor and feeding it to create a dynamic form.

Although a crude way of doing it is converting the jspb proto object to a
normal Object and reading its keys,.. I didn't find it to be a good
approach.

On 13-Feb-2018 22:52, "Adam Cozzette"  wrote:

> But ordinarily you parse messages without needing any descriptors--why do
> need a descriptor to read your message?
>
> On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan 
> wrote:
>
>> Trying to create dynamic forms by reading proto msgs.
>>
>> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>>
>>> What do you want to do with the descriptors?
>>>
>>> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan >> > wrote:
>>>
 So, could you possibly give me the work around for it? It would be very
 helpful. Thanks!

 On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>
> I'm trying to get the descriptor for my proto message. In java there
> is this, Message.getDescriptor()
> which does the job but its hard to find something similar in jspb.
>
> syntax = "proto3";
>
> message Master {
> int32 id = 1;
> string name = 2;
> Type type = 3;
> }
>
> enum Type {
> UNKNOWN_TYPE = 0;
> INDUSTRY_TYPE = 1;
> LOCATION_TYPE = 2;
> }
>
> This is the message of which i want the descriptor of.
>
 --
 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+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at https://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
But ordinarily you parse messages without needing any descriptors--why do
need a descriptor to read your message?

On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan 
wrote:

> Trying to create dynamic forms by reading proto msgs.
>
> On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:
>
>> What do you want to do with the descriptors?
>>
>> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan 
>> wrote:
>>
>>> So, could you possibly give me the work around for it? It would be very
>>> helpful. Thanks!
>>>
>>> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:

 I'm trying to get the descriptor for my proto message. In java there is
 this, Message.getDescriptor()
 which does the job but its hard to find something similar in jspb.

 syntax = "proto3";

 message Master {
 int32 id = 1;
 string name = 2;
 Type type = 3;
 }

 enum Type {
 UNKNOWN_TYPE = 0;
 INDUSTRY_TYPE = 1;
 LOCATION_TYPE = 2;
 }

 This is the message of which i want the descriptor of.

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To post to this group, send email to protobuf@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
Trying to create dynamic forms by reading proto msgs.

On 13-Feb-2018 22:48, "Adam Cozzette"  wrote:

> What do you want to do with the descriptors?
>
> On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan 
> wrote:
>
>> So, could you possibly give me the work around for it? It would be very
>> helpful. Thanks!
>>
>> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>>>
>>> I'm trying to get the descriptor for my proto message. In java there is
>>> this, Message.getDescriptor()
>>> which does the job but its hard to find something similar in jspb.
>>>
>>> syntax = "proto3";
>>>
>>> message Master {
>>> int32 id = 1;
>>> string name = 2;
>>> Type type = 3;
>>> }
>>>
>>> enum Type {
>>> UNKNOWN_TYPE = 0;
>>> INDUSTRY_TYPE = 1;
>>> LOCATION_TYPE = 2;
>>> }
>>>
>>> This is the message of which i want the descriptor of.
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
What do you want to do with the descriptors?

On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan 
wrote:

> So, could you possibly give me the work around for it? It would be very
> helpful. Thanks!
>
> On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>>
>> I'm trying to get the descriptor for my proto message. In java there is
>> this, Message.getDescriptor()
>> which does the job but its hard to find something similar in jspb.
>>
>> syntax = "proto3";
>>
>> message Master {
>> int32 id = 1;
>> string name = 2;
>> Type type = 3;
>> }
>>
>> enum Type {
>> UNKNOWN_TYPE = 0;
>> INDUSTRY_TYPE = 1;
>> LOCATION_TYPE = 2;
>> }
>>
>> This is the message of which i want the descriptor of.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-12 Thread Yaseen Khan
So, could you possibly give me the work around for it? It would be very 
helpful. Thanks!

On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote:
>
> I'm trying to get the descriptor for my proto message. In java there is 
> this, Message.getDescriptor() 
> which does the job but its hard to find something similar in jspb.
>
> syntax = "proto3";
>
> message Master {
> int32 id = 1;
> string name = 2;
> Type type = 3;
> }
>
> enum Type {
> UNKNOWN_TYPE = 0;
> INDUSTRY_TYPE = 1;
> LOCATION_TYPE = 2;
> }
>
> This is the message of which i want the descriptor of.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Descriptor for ProtoBuf Messages in Javascript.

2018-02-12 Thread 'Adam Cozzette' via Protocol Buffers
JSPB doesn't include descriptors in the generated code, so unfortunately
there's no easy way to do this.

On Fri, Feb 9, 2018 at 3:36 AM, Yaseen Khan 
wrote:

> I'm trying to get the descriptor for my proto message. In java there is
> this, Message.getDescriptor()
> which does the job but its hard to find something similar in jspb.
>
> syntax = "proto3";
>
> message Master {
> int32 id = 1;
> string name = 2;
> Type type = 3;
> }
>
> enum Type {
> UNKNOWN_TYPE = 0;
> INDUSTRY_TYPE = 1;
> LOCATION_TYPE = 2;
> }
>
> This is the message of which i want the descriptor of.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Descriptor for ProtoBuf Messages in Javascript.

2018-02-09 Thread Yaseen Khan
I'm trying to get the descriptor for my proto message. In java there is 
this, Message.getDescriptor() 
which does the job but its hard to find something similar in jspb.

syntax = "proto3";

message Master {
int32 id = 1;
string name = 2;
Type type = 3;
}

enum Type {
UNKNOWN_TYPE = 0;
INDUSTRY_TYPE = 1;
LOCATION_TYPE = 2;
}

This is the message of which i want the descriptor of.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Where to find Protobuf Javascript tutorial?

2017-07-19 Thread hce h
Thanks for the response. If I understand it correctly, the js package 
contains a js directory which is pre-built javascript libraries. I built 
the C++ package and I can use the C++ package to generate javascript 
library by running "protoc --js_out=library=myproto_libs,binary:. 
proto3_test.proto"

I am not going to use the node, then I cannot use the npm either, not quite 
sure if I could install javascript libraries manually without npm?  

On Tuesday, July 18, 2017 at 4:00:21 AM UTC+10, Feng Xiao wrote:
>
>
> protobuf-js-3.3.0.zip is the original source code for C++ + Javascript. If 
> you only need the already-built protobuf js package, try npm 
> google-protobuf:
> https://www.npmjs.com/package/google-protobuf
>
> Note that you will need to download protoc binary to do the code 
> generation.
>  
>
>>
>>
>> Thank you.
>>
>> Kind regards,
>>
>>  - j
>>
>> <https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>
>>
>> -- 
>> 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.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Where to find Protobuf Javascript tutorial?

2017-07-17 Thread 'Feng Xiao' via Protocol Buffers
On Sat, Jul 15, 2017 at 8:28 PM, hce h  wrote:

> Hi,
>
> We are using javascript for web front end development and we are using the
> protobuf to communicate with backend web applications. Currently we are
> using GO to do protobuf communication between the backend application
> server which runs on C++ and the front end  running on Javascript, but I've
> just found there is a protobuf interface for Javascript as well, we can
> actually simplify the process directly to use javascript to fetch the
> protobuf messages with backend application without GO. Is it a good idea? I
> have since been investigating the javascript protobuf capability but I
> could not find javascript progotbuf examples and tutorials, the link
> https://developers.google.com/protocol-buffers/docs/tutorials shows
> tutorials for every program language except javascript. Appriciate anyone
> could point me likes for Javascript prototobuf examples and tutorials.
>
> I have also downloaded protobuf-js-3.3.0.zip, but it looks like it is
> similar to
> <https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>protobuf-cpp-3.3.0.tar.gz
> which I built on Linux platform, I guess the
> <https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz>protobuf-js-3.3.0.zip
> is not the binary for javascript, link the C++ I need to build it as well,
> correct?
> <https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>
>
protobuf-js-3.3.0.zip is the original source code for C++ + Javascript. If
you only need the already-built protobuf js package, try npm
google-protobuf:
https://www.npmjs.com/package/google-protobuf

Note that you will need to download protoc binary to do the code generation.


>
>
> Thank you.
>
> Kind regards,
>
>  - j
>
> <https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Where to find Protobuf Javascript tutorial?

2017-07-15 Thread hce h
Hi,

We are using javascript for web front end development and we are using the 
protobuf to communicate with backend web applications. Currently we are  
using GO to do protobuf communication between the backend application 
server which runs on C++ and the front end  running on Javascript, but I've 
just found there is a protobuf interface for Javascript as well, we can 
actually simplify the process directly to use javascript to fetch the 
protobuf messages with backend application without GO. Is it a good idea? I 
have since been investigating the javascript protobuf capability but I 
could not find javascript progotbuf examples and tutorials, the link 
https://developers.google.com/protocol-buffers/docs/tutorials shows 
tutorials for every program language except javascript. Appriciate anyone 
could point me likes for Javascript prototobuf examples and tutorials.

I have also downloaded protobuf-js-3.3.0.zip, but it looks like it is 
similar to 
<https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>protobuf-cpp-3.3.0.tar.gz
 
which I built on Linux platform, I guess the 
<https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz>protobuf-js-3.3.0.zip
 
is not the binary for javascript, link the C++ I need to build it as well, 
correct? 
<https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>

Thank you.

Kind regards,

 - j
<https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-js-3.3.0.zip>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Javascript with Protobuf FileDescriptorSet and what is equivalent to DynamicMessage.parse(FileDescriptor, byte[] payload) ?

2017-04-14 Thread 'Adam Cozzette' via Protocol Buffers
Unfortunately the Javascript implementation doesn't support this kind of
DynamicMessage functionality. In Javascript you can only really manipulate
a protocol buffer if you have already built the generated code with protoc.

On Fri, Apr 7, 2017 at 5:15 PM, Vijay Balakrishnan 
wrote:

> Hi,
> Newbie to protobuf and pardon my naivete on this topic.
>
> I would like to use protoc --descriptor_set_out=out.desc  -js_out=
> import_style=commonjs,error_on_name_conflict,binary:.  mymessage.proto
>
> I have code to upload this out.desc to my server to S3. using out.desc as
> I want multiple clients to upload their separate descriptor files to me
> I have a node.js micro-service and want to be able to handle a byte[]
> payload using this out.desc. The micro-service receives a key along with
> the byte[] payload. I use the key on the backend to identify the out.desc
> filedescriptor to use.
> In Java, I can use DynamicMessage.parse(FileDescriptor, byte[] payload)
> to do this after identifying the relevant desc file using a key to connect
> the client to the desc file.
>
> How do i do this in javascript or node.js ?
>
> TIA,
> Vijay
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Javascript with Protobuf FileDescriptorSet and what is equivalent to DynamicMessage.parse(FileDescriptor, byte[] payload) ?

2017-04-07 Thread Vijay Balakrishnan
Hi,
Newbie to protobuf and pardon my naivete on this topic.

I would like to use protoc --descriptor_set_out=out.desc  -js_out=
import_style=commonjs,error_on_name_conflict,binary:.  mymessage.proto

I have code to upload this out.desc to my server to S3. using out.desc as I 
want multiple clients to upload their separate descriptor files to me
I have a node.js micro-service and want to be able to handle a byte[] 
payload using this out.desc. The micro-service receives a key along with 
the byte[] payload. I use the key on the backend to identify the out.desc 
filedescriptor to use.
In Java, I can use DynamicMessage.parse(FileDescriptor, byte[] payload) to 
do this after identifying the relevant desc file using a key to connect the 
client to the desc file.

How do i do this in javascript or node.js ?

TIA,
Vijay

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-21 Thread gunnar . gissel
Thanks for the help, I appreciate it

I think it's worth noting, for those that follow in my footsteps, that when 
you do a GET vs a RESTful endpoint you don't get raw bytes back.  The most 
expedient thing I found (and please set me straight if I'm wrong), was to 
declare the response type to be a blob then turn the blob into an array 
buffer, then deserialize that

Like so:

var xhr = new XMLHttpRequest();
xhr.open("GET",'http://localhost:8080/people.proto', true);
xhr.responseType = 'blob';
xhr.onload = function(e){
  if(this.status === 200){
var arrBuff = null;
var fileReader = new FileReader();
fileReader.onload = function(){
  //here we've translated the blob into something our protobuf 
javascript can understand
  arrBuff = this.result;
  //here we get an object to work with
  var pkg = proto.package.MyPeopleProto.deserializeBinary(arrBuff);
}
//here we read the blob
fileReader.readAsArrayBuffer(this.response);
  }
}




On Tuesday, February 21, 2017 at 7:44:04 AM UTC-9, Adam Cozzette wrote:
>
> Ok, that's good you were able to get things working with CommonJS-style 
> imports. To parse the raw bytes into an object you will want to call 
> MyProto.deserializeBinary(bytes).
>
> On Wed, Feb 15, 2017 at 3:42 PM, Gunnar Gissel - NOAA Federal <
> gunnar...@noaa.gov > wrote:
>
>> FWIW, switching to commonjs style imports seems to work.
>>
>> Now I'm wondering how do I get from bytes to objects?  Passing the bytes 
>> into the generated constructor doesn't seem to work - I'm still seeing 
>> binary values where I expect to see textual values
>>
>> On Wed, Feb 15, 2017 at 10:20 AM, > 
>> wrote:
>>
>>> I don't expect that the code got pulled into the protobuf library 
>>> because I'm pulling the generated javascript files out of a jar created by 
>>> maven and using them on a box that has been set up solely for doing the 
>>> javascript side of things.  The protobuf install there is via npm, although 
>>> I had to add message.js and map.js files to the closure compiler to get it 
>>> working there.  It is possible I've gone about acquiring protobuf for my 
>>> javascript build entirely wrong, though.
>>>
>>> On Wednesday, February 15, 2017 at 10:16:42 AM UTC-9, gunnar...@noaa.gov 
>>> wrote:
>>>>
>>>> Sure thing!
>>>>
>>>> Gruntfile.js:
>>>>
>>>> module.exports = function(grunt){
>>>>   
>>>>   require('google-closure-compiler').grunt(grunt);
>>>>
>>>>   grunt.initConfig({
>>>> pkg: grunt.file.readJSON('package.json'),
>>>> 'closure-compiler': {
>>>>   my_target: {
>>>> files: {
>>>>   'target/full.js': ['js/**.js']
>>>> },
>>>> options: {
>>>>   js: [
>>>> 'node_modules/google-closure-library/**.js', 
>>>> '!node_modules/google-closure-library/**_test.js', 
>>>> '!node_modules/google-closure-library/**_perf.js', 
>>>> '!node_modules/google-closure-library/**tester.js', 
>>>> 
>>>> '!node_modules/google-closure-library/**promise/testsuiteadapter.js', 
>>>> '!node_modules/google-closure-library/**osapi/osapi.js', 
>>>> '!node_modules/google-closure-library/**svgpan/svgpan.js', 
>>>> '!node_modules/google-closure-library/**alltests.js', 
>>>> '!node_modules/google-closure-library/**node_modules**.js', 
>>>> 
>>>> '!node_modules/google-closure-library/**protractor_spec.js', 
>>>> 
>>>> '!node_modules/google-closure-library/**protractor.conf.js', 
>>>> 
>>>> '!node_modules/google-closure-library/**browser_capabilities.js', 
>>>> '!node_modules/google-closure-library/doc/**.js', 
>>>> 'node_modules/google-protobuf/**.js',
>>>> 'js/missing-google-crap/message.js',
>>>> 'js/missing-google-crap/map.js',
>>>> 'js/person.js'
>>>>   ],
>>>>   compilation_level: 'SIMPLE',
>>>>   language_in: 'ECMASCRIPT5

Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-21 Thread 'Adam Cozzette' via Protocol Buffers
Ok, that's good you were able to get things working with CommonJS-style
imports. To parse the raw bytes into an object you will want to call
MyProto.deserializeBinary(bytes).

On Wed, Feb 15, 2017 at 3:42 PM, Gunnar Gissel - NOAA Federal <
gunnar.gis...@noaa.gov> wrote:

> FWIW, switching to commonjs style imports seems to work.
>
> Now I'm wondering how do I get from bytes to objects?  Passing the bytes
> into the generated constructor doesn't seem to work - I'm still seeing
> binary values where I expect to see textual values
>
> On Wed, Feb 15, 2017 at 10:20 AM,  wrote:
>
>> I don't expect that the code got pulled into the protobuf library because
>> I'm pulling the generated javascript files out of a jar created by maven
>> and using them on a box that has been set up solely for doing the
>> javascript side of things.  The protobuf install there is via npm, although
>> I had to add message.js and map.js files to the closure compiler to get it
>> working there.  It is possible I've gone about acquiring protobuf for my
>> javascript build entirely wrong, though.
>>
>> On Wednesday, February 15, 2017 at 10:16:42 AM UTC-9, gunnar...@noaa.gov
>> wrote:
>>>
>>> Sure thing!
>>>
>>> Gruntfile.js:
>>>
>>> module.exports = function(grunt){
>>>
>>>   require('google-closure-compiler').grunt(grunt);
>>>
>>>   grunt.initConfig({
>>> pkg: grunt.file.readJSON('package.json'),
>>> 'closure-compiler': {
>>>   my_target: {
>>> files: {
>>>   'target/full.js': ['js/**.js']
>>> },
>>> options: {
>>>   js: [
>>> 'node_modules/google-closure-library/**.js',
>>> '!node_modules/google-closure-library/**_test.js',
>>> '!node_modules/google-closure-library/**_perf.js',
>>> '!node_modules/google-closure-library/**tester.js',
>>> '!node_modules/google-closure-library/**promise/testsuiteada
>>> pter.js',
>>> '!node_modules/google-closure-library/**osapi/osapi.js',
>>> '!node_modules/google-closure-library/**svgpan/svgpan.js',
>>> '!node_modules/google-closure-library/**alltests.js',
>>> '!node_modules/google-closure-library/**node_modules**.js',
>>> '!node_modules/google-closure-library/**protractor_spec.js',
>>>
>>> '!node_modules/google-closure-library/**protractor.conf.js',
>>>
>>> '!node_modules/google-closure-library/**browser_capabilities
>>> .js',
>>> '!node_modules/google-closure-library/doc/**.js',
>>> 'node_modules/google-protobuf/**.js',
>>> 'js/missing-google-crap/message.js',
>>> 'js/missing-google-crap/map.js',
>>> 'js/person.js'
>>>   ],
>>>   compilation_level: 'SIMPLE',
>>>   language_in: 'ECMASCRIPT5',
>>>   create_source_map: 'target/full.js.map'
>>>
>>> }
>>>   }
>>> }
>>>   });
>>>
>>>
>>>   grunt.registerTask('default', ['closure-compiler']);
>>> }
>>>
>>>
>>> The javascript is generated via Maven, so here is the command we are
>>> using:
>>>
>>> 
>>>com.github.os72
>>>protoc-jar-maven-plugin
>>>3.0.0
>>>
>>>
>>>generate-sources
>>>
>>>run
>>>
>>>
>>>3.0.0
>>>
>>>src/main/resources/proto
>>>
>>>
>>>
>>>    java
>>>none
>>>
>>> src/main/gen
>>>
>>>
>>>

Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-15 Thread Gunnar Gissel - NOAA Federal
FWIW, switching to commonjs style imports seems to work.

Now I'm wondering how do I get from bytes to objects?  Passing the bytes
into the generated constructor doesn't seem to work - I'm still seeing
binary values where I expect to see textual values

On Wed, Feb 15, 2017 at 10:20 AM,  wrote:

> I don't expect that the code got pulled into the protobuf library because
> I'm pulling the generated javascript files out of a jar created by maven
> and using them on a box that has been set up solely for doing the
> javascript side of things.  The protobuf install there is via npm, although
> I had to add message.js and map.js files to the closure compiler to get it
> working there.  It is possible I've gone about acquiring protobuf for my
> javascript build entirely wrong, though.
>
> On Wednesday, February 15, 2017 at 10:16:42 AM UTC-9, gunnar...@noaa.gov
> wrote:
>>
>> Sure thing!
>>
>> Gruntfile.js:
>>
>> module.exports = function(grunt){
>>
>>   require('google-closure-compiler').grunt(grunt);
>>
>>   grunt.initConfig({
>> pkg: grunt.file.readJSON('package.json'),
>> 'closure-compiler': {
>>   my_target: {
>> files: {
>>   'target/full.js': ['js/**.js']
>> },
>> options: {
>>   js: [
>> 'node_modules/google-closure-library/**.js',
>> '!node_modules/google-closure-library/**_test.js',
>> '!node_modules/google-closure-library/**_perf.js',
>> '!node_modules/google-closure-library/**tester.js',
>> '!node_modules/google-closure-library/**promise/testsuiteada
>> pter.js',
>> '!node_modules/google-closure-library/**osapi/osapi.js',
>> '!node_modules/google-closure-library/**svgpan/svgpan.js',
>> '!node_modules/google-closure-library/**alltests.js',
>> '!node_modules/google-closure-library/**node_modules**.js',
>> '!node_modules/google-closure-library/**protractor_spec.js',
>> '!node_modules/google-closure-library/**protractor.conf.js',
>> '!node_modules/google-closure-library/**browser_capabilities
>> .js',
>> '!node_modules/google-closure-library/doc/**.js',
>> 'node_modules/google-protobuf/**.js',
>> 'js/missing-google-crap/message.js',
>> 'js/missing-google-crap/map.js',
>> 'js/person.js'
>>   ],
>>   compilation_level: 'SIMPLE',
>>   language_in: 'ECMASCRIPT5',
>>   create_source_map: 'target/full.js.map'
>>
>> }
>>   }
>> }
>>   });
>>
>>
>>   grunt.registerTask('default', ['closure-compiler']);
>> }
>>
>>
>> The javascript is generated via Maven, so here is the command we are
>> using:
>>
>>  
>> com.github.os72
>> protoc-jar-maven-plugin
>> 3.0.0
>> 
>> 
>> generate-sources
>> 
>> run
>> 
>> 
>> 3.0.0
>> 
>> src/main/resources/proto
>> 
>> 
>> 
>> java
>> none
>> 
>> src/main/gen
>> 
>> 
>>  
>> descriptor
>>  none
>>  
>> src/main/resources/protoDesc/
>> 
>> 
>>  js
>>  none
>>  
>> src/main/resources/js/
>> 
>>     
>> 
>> 
>> 
>&

Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-15 Thread gunnar . gissel
I don't expect that the code got pulled into the protobuf library because 
I'm pulling the generated javascript files out of a jar created by maven 
and using them on a box that has been set up solely for doing the 
javascript side of things.  The protobuf install there is via npm, although 
I had to add message.js and map.js files to the closure compiler to get it 
working there.  It is possible I've gone about acquiring protobuf for my 
javascript build entirely wrong, though.

On Wednesday, February 15, 2017 at 10:16:42 AM UTC-9, gunnar...@noaa.gov 
wrote:
>
> Sure thing!
>
> Gruntfile.js:
>
> module.exports = function(grunt){
>   
>   require('google-closure-compiler').grunt(grunt);
>
>   grunt.initConfig({
> pkg: grunt.file.readJSON('package.json'),
> 'closure-compiler': {
>   my_target: {
> files: {
>   'target/full.js': ['js/**.js']
> },
> options: {
>   js: [
> 'node_modules/google-closure-library/**.js', 
> '!node_modules/google-closure-library/**_test.js', 
> '!node_modules/google-closure-library/**_perf.js', 
> '!node_modules/google-closure-library/**tester.js', 
> 
> '!node_modules/google-closure-library/**promise/testsuiteadapter.js', 
> '!node_modules/google-closure-library/**osapi/osapi.js', 
> '!node_modules/google-closure-library/**svgpan/svgpan.js', 
> '!node_modules/google-closure-library/**alltests.js', 
> '!node_modules/google-closure-library/**node_modules**.js', 
> '!node_modules/google-closure-library/**protractor_spec.js', 
> '!node_modules/google-closure-library/**protractor.conf.js', 
> 
> '!node_modules/google-closure-library/**browser_capabilities.js', 
> '!node_modules/google-closure-library/doc/**.js', 
> 'node_modules/google-protobuf/**.js',
> 'js/missing-google-crap/message.js',
> 'js/missing-google-crap/map.js',
> 'js/person.js'
>   ],
>   compilation_level: 'SIMPLE',
>   language_in: 'ECMASCRIPT5',
>   create_source_map: 'target/full.js.map'
>   
> }
>   }
> }
>   });
>
>
>   grunt.registerTask('default', ['closure-compiler']);
> }
>
>
> The javascript is generated via Maven, so here is the command we are using:
>
>   
>  com.github.os72
>  protoc-jar-maven-plugin
>  3.0.0
>  
>  
>  generate-sources
>  
>  run
>  
>  
>  3.0.0 
>  
>  src/main/resources/proto
>  
>  
>  
>  java
>  none
>  
> src/main/gen
>  
>  
>   
> descriptor
>   none
>   
> src/main/resources/protoDesc/
>  
>  
>   js
>   none
>   
> src/main/resources/js/
>  
>  
>  
>  
>  
>   
>
>
>
>
> On Wednesday, February 15, 2017 at 9:40:03 AM UTC-9, Adam Cozzette wrote:
>>
>> If you could share your gruntfile that would be great. I would be 
>> interested to know in particular the protoc command used to generate the 
>> Javascript. Also it would be good to verify that the generated code for 
>> that proto did not somehow get pulled into the protobuf build and end up 
>> being part of the actual protobuf library.
>>
>> On Wed, Feb 15, 2017 at 9:10 AM,  wrote:
>>
>>> I've got some javascript generated from protoc and I'm trying to compil

Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-15 Thread gunnar . gissel
Sure thing!

Gruntfile.js:

module.exports = function(grunt){
  
  require('google-closure-compiler').grunt(grunt);

  grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'closure-compiler': {
  my_target: {
files: {
  'target/full.js': ['js/**.js']
},
options: {
  js: [
'node_modules/google-closure-library/**.js', 
'!node_modules/google-closure-library/**_test.js', 
'!node_modules/google-closure-library/**_perf.js', 
'!node_modules/google-closure-library/**tester.js', 

'!node_modules/google-closure-library/**promise/testsuiteadapter.js', 
'!node_modules/google-closure-library/**osapi/osapi.js', 
'!node_modules/google-closure-library/**svgpan/svgpan.js', 
'!node_modules/google-closure-library/**alltests.js', 
'!node_modules/google-closure-library/**node_modules**.js', 
'!node_modules/google-closure-library/**protractor_spec.js', 
'!node_modules/google-closure-library/**protractor.conf.js', 

'!node_modules/google-closure-library/**browser_capabilities.js', 
'!node_modules/google-closure-library/doc/**.js', 
'node_modules/google-protobuf/**.js',
'js/missing-google-crap/message.js',
'js/missing-google-crap/map.js',
'js/person.js'
  ],
  compilation_level: 'SIMPLE',
  language_in: 'ECMASCRIPT5',
  create_source_map: 'target/full.js.map'
  
}
  }
}
  });


  grunt.registerTask('default', ['closure-compiler']);
}


The javascript is generated via Maven, so here is the command we are using:


   com.github.os72
   protoc-jar-maven-plugin
   3.0.0
   
   
   generate-sources
   
   run
   
   
   3.0.0 
   
   src/main/resources/proto
   
   
   
   java
   none
   
src/main/gen
   
   

descriptor
none

src/main/resources/protoDesc/
   
   
js
none

src/main/resources/js/
   
   
   
   
   





On Wednesday, February 15, 2017 at 9:40:03 AM UTC-9, Adam Cozzette wrote:
>
> If you could share your gruntfile that would be great. I would be 
> interested to know in particular the protoc command used to generate the 
> Javascript. Also it would be good to verify that the generated code for 
> that proto did not somehow get pulled into the protobuf build and end up 
> being part of the actual protobuf library.
>
> On Wed, Feb 15, 2017 at 9:10 AM, > wrote:
>
>> I've got some javascript generated from protoc and I'm trying to compile 
>> all those files together with closure-compiler so I can use them in a 
>> client app.
>>
>> I'm using Grunt and closure compiler and can provide my gruntfile and 
>> generated javascript if it would help.
>>
>> My problem is that the closure compiler gives me a namespace error for 
>> each type defined in the protobuf.
>>
>> ERROR - namespace 
>> "proto.gov.noaa.alaskafisheries.demoperson.protos.Person" cannot be 
>> provided twice
>> goog.provide('proto.gov.noaa.alaskafisheries.demoperson.protos.Person');
>> ^
>>
>> And so on for each type defined in the .proto.
>>
>> So far as I can tell these are only provided once in the generated file, 
>> and I've pared down my compilation attempt to that single file + the 
>> closure library and protobuf library files.
>>
>> I

Re: [protobuf] Generated Javascript Protobufs and Grunt

2017-02-15 Thread 'Adam Cozzette' via Protocol Buffers
If you could share your gruntfile that would be great. I would be
interested to know in particular the protoc command used to generate the
Javascript. Also it would be good to verify that the generated code for
that proto did not somehow get pulled into the protobuf build and end up
being part of the actual protobuf library.

On Wed, Feb 15, 2017 at 9:10 AM,  wrote:

> I've got some javascript generated from protoc and I'm trying to compile
> all those files together with closure-compiler so I can use them in a
> client app.
>
> I'm using Grunt and closure compiler and can provide my gruntfile and
> generated javascript if it would help.
>
> My problem is that the closure compiler gives me a namespace error for
> each type defined in the protobuf.
>
> ERROR - namespace "proto.gov.noaa.alaskafisheries.demoperson.
> protos.Person" cannot be provided twice
> goog.provide('proto.gov.noaa.alaskafisheries.demoperson.protos.Person');
> ^
>
> And so on for each type defined in the .proto.
>
> So far as I can tell these are only provided once in the generated file,
> and I've pared down my compilation attempt to that single file + the
> closure library and protobuf library files.
>
> I've googled the heck out of it and I'm stumped.  I've gotten everything
> working with https://github.com/dcodeIO/ProtoBuf.js/ but I'd like to be
> able to use google's generated code rather than bring in another library
> just for the javascript client.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Generated Javascript Protobufs and Grunt

2017-02-15 Thread gunnar . gissel
I've got some javascript generated from protoc and I'm trying to compile 
all those files together with closure-compiler so I can use them in a 
client app.

I'm using Grunt and closure compiler and can provide my gruntfile and 
generated javascript if it would help.

My problem is that the closure compiler gives me a namespace error for each 
type defined in the protobuf.

ERROR - namespace "proto.gov.noaa.alaskafisheries.demoperson.protos.Person" 
cannot be provided twice
goog.provide('proto.gov.noaa.alaskafisheries.demoperson.protos.Person');
^

And so on for each type defined in the .proto.

So far as I can tell these are only provided once in the generated file, 
and I've pared down my compilation attempt to that single file + the 
closure library and protobuf library files.

I've googled the heck out of it and I'm stumped.  I've gotten everything 
working with https://github.com/dcodeIO/ProtoBuf.js/ but I'd like to be 
able to use google's generated code rather than bring in another library 
just for the javascript client.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] How to use protoc with Node http - and in a Javascript client

2016-11-16 Thread 'Adam Cozzette' via Protocol Buffers
It sounds like perhaps postData is a Uint8Array but req.write() expects to
be passed either a string or a Buffer
<https://nodejs.org/api/buffer.html#buffer_class_buffer>. Maybe the right
solution is to convert postData to a Buffer before calling req.write().

On Tue, Nov 15, 2016 at 8:49 PM, Jorg Janke  wrote:

> I am trying to send/receive protoc with Node and in a Javascript client.
>
> With the Node code below, I get: TypeError: First argument must be a
> string or Buffer
> What am I missing?
>
> The actual server is Java based.
>
> Thanks!
> Jorg
>
> :
>
> var postData = protoRequest.serializeBinary(); // Uint8Array
>
> var options = {
> protocol: 'https:',
> hostname: 'xxx',
> port: 443,
> path: '/xxx',
> method: 'POST',
> headers: {
> 'Content-Type': 'application/application/x-google-protobuf',
> 'Content-Length': Buffer.byteLength(postData)
> }
> };
>
> var req = https.request(options, function(res) {
> res.on('data', function(chunk) {
> var responseMessage = ProtoResponse.deserializeBinary(chunk);
> console.log("Response", responseMessage);
>
> });
> });
> req.write(postData);
> req.end();
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] How to use protoc with Node http - and in a Javascript client

2016-11-15 Thread Jorg Janke
I am trying to send/receive protoc with Node and in a Javascript client.

With the Node code below, I get: TypeError: First argument must be a string 
or Buffer
What am I missing?

The actual server is Java based.

Thanks!
Jorg

:

var postData = protoRequest.serializeBinary(); // Uint8Array

var options = {
protocol: 'https:',
hostname: 'xxx',
port: 443,
path: '/xxx',
method: 'POST',
headers: {
'Content-Type': 'application/application/x-google-protobuf',
'Content-Length': Buffer.byteLength(postData)
}
};

var req = https.request(options, function(res) {
res.on('data', function(chunk) {
var responseMessage = ProtoResponse.deserializeBinary(chunk);
console.log("Response", responseMessage);

});
});
req.write(postData);
req.end();

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: how can i change my protobuf object to byte arrays in javascript

2016-07-22 Thread 'Josh Haberman' via Protocol Buffers
For the moment, you can call msg.serializeBinary(), but make sure you 
generated the JavaScript with the binary=1 option.

In the near future this will be changing. The binary serialization code 
will get generated into separate files from the data structures themselves. 
So in the future it will be more like: 
my_proto_binarypb.Foo.deserializeBinary(msg) if the type is Foo.

On Thursday, July 21, 2016 at 11:04:27 AM UTC-7, antoniochen0...@gmail.com 
wrote:
>
> i just want to get a byte arrays from a protobuf object as java in 
> javascript, but i never find a function to do it. who knows? please tell me
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] how can i change my protobuf object to byte arrays in javascript

2016-07-21 Thread antoniochen0205
i just want to get a byte arrays from a protobuf object as java in 
javascript, but i never find a function to do it. who knows? please tell me

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Where is jspb.Map for my Javascript protobuf-client?

2016-07-08 Thread 'Josh Haberman' via Protocol Buffers
Hi Julian,

This was fixed in a recent commit. Try re-syncing and you should see a 
map.js file that defines jspb.Map.

On Friday, July 8, 2016 at 11:50:30 AM UTC-7, Juli H wrote:
>
> Hi,
> from a thread (
> https://groups.google.com/forum/#!topic/protobuf/v8nXb-aj0rg) I got the 
> information that I have to include the protobuf/js/messages.js file to get 
> the definition of jspb.Message.
> But including this file leads me to the next missing definition. In the 
> messages.js a goog.require('jspb.Map'); can be found in line 44. But I 
> can't find a jspb.Map in the whole protobuf-filetree, so where I can find 
> it? Or am I doing smth. wrong?
>
> 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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Where is jspb.Map for my Javascript protobuf-client?

2016-07-08 Thread Juli H
Hi,
from a thread 
(https://groups.google.com/forum/#!topic/protobuf/v8nXb-aj0rg) I got the 
information that I have to include the protobuf/js/messages.js file to get 
the definition of jspb.Message.
But including this file leads me to the next missing definition. In the 
messages.js a goog.require('jspb.Map'); can be found in line 44. But I 
can't find a jspb.Map in the whole protobuf-filetree, so where I can find 
it? Or am I doing smth. wrong?

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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated javascript dtos requiring missing built in proto types types, e.g. Timestamp (using beta-3, proto3, CommonJs)

2016-06-01 Thread Keith Woods
thanks for the response, issue created 
https://github.com/google/protobuf/issues/1638

On Wednesday, June 1, 2016 at 7:54:35 PM UTC+1, Feng Xiao wrote:
>
>
>
> On Wed, Jun 1, 2016 at 9:18 AM, Keith Woods  > wrote:
>
>> Hi All
>>
>> I'm using proto3 with the last beta 3 (v3.0.0-beta-3) to generate 
>> javascript DTOS as CommonJs modules.
>>
>> In the generated javascript, built in proto type (e.g. 
>> google.protobuf.Timestamp) are 'required' but don't exist.
>>
>> For example, given this proto:
>>
>> // foo.proto
>> syntax = "proto3";
>>
>> import "google/protobuf/timestamp.proto";
>>
>> message SomeMessage {
>>google.protobuf.Timestamp someTime = 1;
>> }
>>
>>
>> And this command:
>>
>> protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto
>>
>> we get this output: 
>>
>> /**
>> * @fileoverview
>> * @enhanceable
>> * @public
>> */
>> // GENERATED CODE -- DO NOT EDIT!
>>
>> var jspb = require('google-protobuf');
>> var goog = jspb;
>> var global = Function('return this')();
>>
>> var google_protobuf_timestamp_pb = require(
>> './google/protobuf/timestamp_pb.js'); *// NOTE 
>> ./google/protobuf/timestamp_pb.js doesn't exist*
>> goog.exportSymbol('proto.SomeMessage', null, global);
>>
>> The file timestamp_pb.js isn't generated (note timestamp.proto does exist 
>> under my protoc executable). 
>>
>> I'd expect it to exist in either:
>>
>>1. the google-protobuf npm package 
>><https://www.npmjs.com/package/google-protobuf>, e.g. 
>> require('google-protobuf/somePathHere/timestamp_pb.js')
>>2. the output generated by protoc
>>
>>
>> I don't see anything in the repo 
>> <https://github.com/google/protobuf/tree/master/js> to support the first 
>> option, and not sure about the second.
>>
> We should support option (1): the google-protobuf package is supposed to 
> contain these well-known types. Could you create a github issue for that?
>  
>
>>
>> Any ideas?
>>
>> Any help much appreciated. 
>>
>> -- 
>> 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.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Using v3.0.0-beta-3 generated Javascript requires built in type (e.g. timestamp.proto) but protoc doesn't spit them out

2016-06-01 Thread Keith Woods
Sorry, this was a duplicate posting. My bad.
Duplicate link: 
https://groups.google.com/forum/#!topic/protobuf/46NJpIX-kFI 

On Wednesday, June 1, 2016 at 7:48:18 PM UTC+1, Keith Woods wrote:
>
> Hi all
>
> I'm using protoc from the latest beta release (v3.0.0-beta-3) I'm having 
> an issue with the  generated javascript. It's not generating .js files for 
> my 'out of the box' proto imports (i.e. for the include Timestamp type).
>
> Given this .ptoto:
>
> // foo.proto
> syntax = "proto3";
>
> import "google/protobuf/timestamp.proto";
>
> message SomeMessage {
>google.protobuf.Timestamp someTime = 1;
> }
>
>
> and this command to gen the dtos: 
>
> protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto
>
> You end up with a single output foo_pb.js. Inside this file it tries to 
> require the timestamp file which wasn't generated:
>
> /**
>  * @fileoverview
>  * @enhanceable
>  * @public
>  */
> // GENERATED CODE -- DO NOT EDIT!
>
> var jspb = require('google-protobuf');
> var goog = jspb;
> var global = Function('return this')();
>
> *var google_protobuf_timestamp_pb = 
> require('./google/protobuf/timestamp_pb.js');  // NOTE *
> *./google/protobuf/timestamp_pb.js** doesn't exist*
> goog.exportSymbol('proto.SomeMessage', null, global);
>
>
> // ... 
>
> I'm guessing the the npm package google-protobuf 
> <https://www.npmjs.com/package/google-protobuf> should contain these 
> types so the above should read something like this:
>
> require('gooogle-protobuf/builtInTypes/timestamp_pb.js');
>
> OR that protoc should generate timestamp_pb.js on the fly with the rest of 
> the protos.
>
> As a side note I don't see anything like timestamp_pb.js in the repo 
> <https://github.com/google/protobuf/tree/master/js>
>
> Any ideas?
> Is there a way to get protoc to generate timestamp_pb.js?
>
> Any help appreciated, thanks.
>
> Keith
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated javascript dtos requiring missing built in proto types types, e.g. Timestamp (using beta-3, proto3, CommonJs)

2016-06-01 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jun 1, 2016 at 9:18 AM, Keith Woods  wrote:

> Hi All
>
> I'm using proto3 with the last beta 3 (v3.0.0-beta-3) to generate
> javascript DTOS as CommonJs modules.
>
> In the generated javascript, built in proto type (e.g.
> google.protobuf.Timestamp) are 'required' but don't exist.
>
> For example, given this proto:
>
> // foo.proto
> syntax = "proto3";
>
> import "google/protobuf/timestamp.proto";
>
> message SomeMessage {
>google.protobuf.Timestamp someTime = 1;
> }
>
>
> And this command:
>
> protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto
>
> we get this output:
>
> /**
> * @fileoverview
> * @enhanceable
> * @public
> */
> // GENERATED CODE -- DO NOT EDIT!
>
> var jspb = require('google-protobuf');
> var goog = jspb;
> var global = Function('return this')();
>
> var google_protobuf_timestamp_pb = require(
> './google/protobuf/timestamp_pb.js'); *// NOTE
> ./google/protobuf/timestamp_pb.js doesn't exist*
> goog.exportSymbol('proto.SomeMessage', null, global);
>
> The file timestamp_pb.js isn't generated (note timestamp.proto does exist
> under my protoc executable).
>
> I'd expect it to exist in either:
>
>1. the google-protobuf npm package
><https://www.npmjs.com/package/google-protobuf>, e.g.
> require('google-protobuf/somePathHere/timestamp_pb.js')
>2. the output generated by protoc
>
>
> I don't see anything in the repo
> <https://github.com/google/protobuf/tree/master/js> to support the first
> option, and not sure about the second.
>
We should support option (1): the google-protobuf package is supposed to
contain these well-known types. Could you create a github issue for that?


>
> Any ideas?
>
> Any help much appreciated.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Using v3.0.0-beta-3 generated Javascript requires built in type (e.g. timestamp.proto) but protoc doesn't spit them out

2016-06-01 Thread Keith Woods
Hi all

I'm using protoc from the latest beta release (v3.0.0-beta-3) I'm having an 
issue with the  generated javascript. It's not generating .js files for my 
'out of the box' proto imports (i.e. for the include Timestamp type).

Given this .ptoto:

// foo.proto
syntax = "proto3";

import "google/protobuf/timestamp.proto";

message SomeMessage {
   google.protobuf.Timestamp someTime = 1;
}


and this command to gen the dtos: 

protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto

You end up with a single output foo_pb.js. Inside this file it tries to 
require the timestamp file which wasn't generated:

/**
 * @fileoverview
 * @enhanceable
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

*var google_protobuf_timestamp_pb = 
require('./google/protobuf/timestamp_pb.js');  // NOTE *
*./google/protobuf/timestamp_pb.js** doesn't exist*
goog.exportSymbol('proto.SomeMessage', null, global);


// ... 

I'm guessing the the npm package google-protobuf 
<https://www.npmjs.com/package/google-protobuf> should contain these types 
so the above should read something like this:

require('gooogle-protobuf/builtInTypes/timestamp_pb.js');

OR that protoc should generate timestamp_pb.js on the fly with the rest of 
the protos.

As a side note I don't see anything like timestamp_pb.js in the repo 
<https://github.com/google/protobuf/tree/master/js>

Any ideas?
Is there a way to get protoc to generate timestamp_pb.js?

Any help appreciated, thanks.

Keith

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Generated javascript dtos requiring missing built in proto types types, e.g. Timestamp (using beta-3, proto3, CommonJs)

2016-06-01 Thread Keith Woods
Hi All

I'm using proto3 with the last beta 3 (v3.0.0-beta-3) to generate 
javascript DTOS as CommonJs modules.

In the generated javascript, built in proto type (e.g. 
google.protobuf.Timestamp) are 'required' but don't exist.

For example, given this proto:

// foo.proto
syntax = "proto3";

import "google/protobuf/timestamp.proto";

message SomeMessage {
   google.protobuf.Timestamp someTime = 1;
}


And this command:

protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto

we get this output: 

/**
* @fileoverview
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

var google_protobuf_timestamp_pb = require(
'./google/protobuf/timestamp_pb.js'); *// NOTE 
./google/protobuf/timestamp_pb.js doesn't exist*
goog.exportSymbol('proto.SomeMessage', null, global);

The file timestamp_pb.js isn't generated (note timestamp.proto does exist 
under my protoc executable). 

I'd expect it to exist in either:

   1. the google-protobuf npm package 
   <https://www.npmjs.com/package/google-protobuf>, e.g. 
require('google-protobuf/somePathHere/timestamp_pb.js')
   2. the output generated by protoc
   

I don't see anything in the repo 
<https://github.com/google/protobuf/tree/master/js> to support the first 
option, and not sure about the second.

Any ideas?

Any help much appreciated. 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Question regarding Any.Proto inside Javascript (NodeJS)

2015-11-24 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Nov 24, 2015 at 8:57 AM, Brandon K  wrote:

> I am writing a gRPC NodeJS Client to communicate with a server service. I
> am getting the response back from my request, however the response is
> contains message data of 'any.proto' type. What is the proper way to handle
> unpacking this data within my NodeJS code?
>
> Just to give some background I have a User proto object that was created,
> here is the response:
>
> response : {
>   result: {
> type_url = "type.googleapis.com/User",
> value = Uint8Array[5]
>   },
>   validationErrors = [ ]
> }
>
>
> In Java there exists the pack( ) and unpack( ) methods to handle this
> process ensuring type-safety. Are there any helpers that are similar for
> Javascript?
>
> I note from this Language Guide link
> <https://developers.google.com/protocol-buffers/docs/proto3?hl=en> (about
> 50% down the page in "Any" section) it states  *"*Currently the runtime
> libraries for working with Any types are under development*." *So I am
> curious if what I'm asking for doesn't exist, will such a feature be added
> in the future as part of this active development.
>
I don't think such functionalities currently exist for Javascript. We will
soon opensource a proto JS implementation which should be able to cover
this. It's planned to be released this quarter.


>
> Thanks ahead of time.
>
> -Brandon
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Question regarding Any.Proto inside Javascript (NodeJS)

2015-11-24 Thread Brandon K
I am writing a gRPC NodeJS Client to communicate with a server service. I 
am getting the response back from my request, however the response is 
contains message data of 'any.proto' type. What is the proper way to handle 
unpacking this data within my NodeJS code?

Just to give some background I have a User proto object that was created, 
here is the response:

response : {
  result: {
type_url = "type.googleapis.com/User",
value = Uint8Array[5]
  },
  validationErrors = [ ]
}


In Java there exists the pack( ) and unpack( ) methods to handle this 
process ensuring type-safety. Are there any helpers that are similar for 
Javascript?

I note from this Language Guide link 
<https://developers.google.com/protocol-buffers/docs/proto3?hl=en> (about 
50% down the page in "Any" section) it states  *"*Currently the runtime 
libraries for working with Any types are under development*." *So I am 
curious if what I'm asking for doesn't exist, will such a feature be added 
in the future as part of this active development.

Thanks ahead of time.

-Brandon

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: JavaScript

2015-03-24 Thread Timo K
I am just using  https://github.com/dcodeIO/ProtoBuf.js right now. I use it 
for piping the internal protobuffer communication over websockets and it 
just works like a charm.

Am Freitag, 26. Juni 2009 00:23:40 UTC+2 schrieb rthompson@gmail.com:
>
> Is there anything in the works that would allow us to output 
> JavaScript along with C++, Java, and Python?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: JavaScript

2015-03-23 Thread Leo Gallucci
Almost 6 years later, what do you think about this now? What about 
using https://github.com/dcodeIO/ProtoBuf.js ? or is it still more 
convenient to simply stick to JSON/BSON/PSON?

--
Leo

On Friday, June 26, 2009 at 2:17:58 AM UTC+2, Kenton Varda wrote:
>
> One problem with javascript and protobuf is that you need a lot of support 
> code to parse the messages.  Unless you end up sending quite a lot of stuff 
> back and forth, making the user download a JS protobuf codec library may be 
> a net loss.  It may be better to use JSON or XML because browsers already 
> have built-in support for those.
>
> That said, I think various people inside google have been playing with 
> javascript + protocol buffers for awhile and if we end up with anything 
> that works well enough, we'll release it.
>
> On Thu, Jun 25, 2009 at 3:23 PM, rthompson.dtisoft@gmail.com <
> rthompson.dtisoft@gmail.com> wrote:
>
>>
>> Is there anything in the works that would allow us to output
>> JavaScript along with C++, Java, and Python?
>>
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: ProtoBuf.js - protobuf for JavaScript

2013-03-18 Thread Feng Xiao
On Mon, Mar 18, 2013 at 4:45 AM, Daniel Wirtz  wrote:

> If you have a project that should be listed here, please send a message to
> the discussion group
>
> I'd be happy if you'd add ProtoBuf.js to
> http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns#Programming_Languages

Done. Added "Javascript: https://github.com/dcodeIO/ProtoBuf.js";.


>
>  --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[protobuf] Re: ProtoBuf.js - protobuf for JavaScript

2013-03-18 Thread Daniel Wirtz
If you have a project that should be listed here, please send a message to 
the discussion group 

I'd be happy if you'd add ProtoBuf.js to 
http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns#Programming_Languages

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[protobuf] ProtoBuf.js - protobuf for JavaScript

2013-03-07 Thread Daniel Wirtz
A protobuf implementation including a .proto parser, reflection, message 
class building and simple encoding and decoding in plain JavaScript. No 
compilation step required, works out of the box on .proto files.

GitHub: https://github.com/dcodeIO/ProtoBuf.js
npm: https://npmjs.org/package/protobufjs

I am thankful for any feedback from experienced protobuf users. Hope you'll 
find this useful!

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [protobuf] Javascript protocol buffer implementation

2010-02-22 Thread Kenton Varda
Cool, added to the list:
  http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns

On Sun, Feb 21, 2010 at 1:39 AM, Patrick Horn wrote:

> Hi all,
> I am announcing a BSD-licensed javascript protocol buffer implementation,
> called protojs.  The library supports all wire types, as well as packed
> fields (not autodetection yet), float/double support thanks to
> jsfromhell.com, and Unicode support.
>
> You can find the github site here:
> http://github.com/sirikata/protojs
>
> To install, you need to run ./bootstrap.sh to download and compile antlr,
> and then run "make" to build the "pbj" compiler and compile the sample
> javascript code.
>
> Protojs also supports higher level types, such as enums, nested composites,
> and precise 64-bit integers (using two 32-bit numbers). It also allows
> extending the built-in types, and has a library called "pbj" which includes
> other helpful types, such as vectors, quaternions and uuids.
>
> The library is modelled after python's protocol buffers (same function
> names). It uses getters and setters on browsers that support them (all but
> IE), and works without getters and setters at the expense of no runtime type
> checking.
>
> Sadly, javascript currently has no binary datatype. So in place of that the
> library currently supports serializing/deserializing base64 strings and to
> arrays of integers.
>
> Feel free to let me know if you have any suggestions or bugs, or you can
> fork the project since it's developed in git.
>
> -Patrick
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Javascript protocol buffer implementation

2010-02-22 Thread Patrick Horn

Hi all,
I am announcing a BSD-licensed javascript protocol buffer 
implementation, called protojs.  The library supports all wire types, as 
well as packed fields (not autodetection yet), float/double support 
thanks to jsfromhell.com, and Unicode support.


You can find the github site here:
http://github.com/sirikata/protojs

To install, you need to run ./bootstrap.sh to download and compile 
antlr, and then run "make" to build the "pbj" compiler and compile the 
sample javascript code.


Protojs also supports higher level types, such as enums, nested 
composites, and precise 64-bit integers (using two 32-bit numbers). It 
also allows extending the built-in types, and has a library called "pbj" 
which includes other helpful types, such as vectors, quaternions and uuids.


The library is modelled after python's protocol buffers (same function 
names). It uses getters and setters on browsers that support them (all 
but IE), and works without getters and setters at the expense of no 
runtime type checking.


Sadly, javascript currently has no binary datatype. So in place of that 
the library currently supports serializing/deserializing base64 strings 
and to arrays of integers.


Feel free to let me know if you have any suggestions or bugs, or you can 
fork the project since it's developed in git.


-Patrick

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] javascript protocol buffers encoder

2010-01-04 Thread Kenton Varda
Two problems with encoding/decoding binary messages in javascript:
- Javascript doesn't have a usable "array of bytes" type.
- Even if it did, encoding/decoding would be painfully slow and would
require downloading a lot of code to the client.

A better idea is to encode messages in JSON format.  There's at least one
(third-party) JSON codec for protocol buffers here:

http://code.google.com/p/protobuf-java-format/

It's easy to write your own JSON codec against any of the official protobuf
implementations using the reflection interfaces.  Look at how TextFormat is
implemented in each language for an example.

On Mon, Jan 4, 2010 at 2:30 PM, alf  wrote:

> There are any away to encode data to protobuffer message directly from
> javascript ?
>
> what do you think about this idea. load data,
> encode,
> convert to string,
> send to server,
> receive to serve,
> convert string to bytes,
> decode to pb message
>
> any opensource tools.
>
> many thanks.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.




[protobuf] javascript protocol buffers encoder

2010-01-04 Thread alf
There are any away to encode data to protobuffer message directly from
javascript ?

what do you think about this idea. load data,
encode,
convert to string,
send to server,
receive to serve,
convert string to bytes,
decode to pb message

any opensource tools.

many thanks.



--

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.




Re: JavaScript

2009-06-25 Thread Kenton Varda
One problem with javascript and protobuf is that you need a lot of support
code to parse the messages.  Unless you end up sending quite a lot of stuff
back and forth, making the user download a JS protobuf codec library may be
a net loss.  It may be better to use JSON or XML because browsers already
have built-in support for those.
That said, I think various people inside google have been playing with
javascript + protocol buffers for awhile and if we end up with anything that
works well enough, we'll release it.

On Thu, Jun 25, 2009 at 3:23 PM, rthompson.dtisoft@gmail.com <
rthompson.dtisoft@gmail.com> wrote:

>
> Is there anything in the works that would allow us to output
> JavaScript along with C++, Java, and Python?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: JavaScript

2009-06-25 Thread Alek Storm
That one doesn't look complete.  I've got one that almost is.

On Thu, Jun 25, 2009 at 3:53 PM, Marc Gravell wrote:

>
> I haven't tried it, but
> http://code.google.com/p/protobuf/wiki/OtherLanguages
> lists javascript support here: http://code.google.com/p/protobuf-js/
>
> (this is one of many unofficial independent implementations - not
> google's; don't blame them ;-p)
>
> Marc
> >
>


-- 
Alek Storm

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: JavaScript

2009-06-25 Thread Marc Gravell

I haven't tried it, but http://code.google.com/p/protobuf/wiki/OtherLanguages
lists javascript support here: http://code.google.com/p/protobuf-js/

(this is one of many unofficial independent implementations - not
google's; don't blame them ;-p)

Marc
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



JavaScript

2009-06-25 Thread rthompson.dtisoft....@gmail.com

Is there anything in the works that would allow us to output
JavaScript along with C++, Java, and Python?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: protocol buffers for javascript

2008-10-02 Thread yas

Thanks.

On 10月3日, 午前3:00, "Kenton Varda" <[EMAIL PROTECTED]> wrote:
> Done.
>
> On Thu, Oct 2, 2008 at 10:55 AM, yas <[EMAIL PROTECTED]> wrote:
>
> > Hi project owners,
>
> > I've just started a project for a protocol buffers encoder/decoder
> > written in JavaScript.
>
> >http://code.google.com/p/protobuf-js/
>
> > To tell the truth, I don't think it's very useful. but I'm glad if you
> > add it to the OtherLanguages page (http://code.google.com/p/protobuf/
> > wiki/OtherLanguages<http://code.google.com/p/protobuf/wiki/OtherLanguages>
> > ).
>
> > Thanks,
> > ANDO Yasushi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: protocol buffers for javascript

2008-10-02 Thread Kenton Varda
Done.

On Thu, Oct 2, 2008 at 10:55 AM, yas <[EMAIL PROTECTED]> wrote:

>
> Hi project owners,
>
> I've just started a project for a protocol buffers encoder/decoder
> written in JavaScript.
>
> http://code.google.com/p/protobuf-js/
>
> To tell the truth, I don't think it's very useful. but I'm glad if you
> add it to the OtherLanguages page (http://code.google.com/p/protobuf/
> wiki/OtherLanguages<http://code.google.com/p/protobuf/wiki/OtherLanguages>
> ).
>
> Thanks,
> ANDO Yasushi
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



protocol buffers for javascript

2008-10-02 Thread yas

Hi project owners,

I've just started a project for a protocol buffers encoder/decoder
written in JavaScript.

http://code.google.com/p/protobuf-js/

To tell the truth, I don't think it's very useful. but I'm glad if you
add it to the OtherLanguages page (http://code.google.com/p/protobuf/
wiki/OtherLanguages).

Thanks,
ANDO Yasushi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---