I'm reading through the goog.proto2 package and have some questions
about some missing things:
* test.proto and package_test.proto are missing from the SVN repo,
they could quite easily be reverse-engineered from the generated
*.pb.js files but I don't think open-sourcing the *.proto files
themselves would cause any harm to Google ;-)
* is there a plan to open source the proto->js compiler? is it a
protoc 2.3.0+ plugin or a modified protoc? (fortunately, if it's in C+
+ it shouldn't be hard to convert it into a protoc plugin)
Aside from that, can any Googler share some thoughts about how (and
why!) it's used (I mean goog.proto2.*) inside Google products?
Thanks in advance!
I am very interested in any ,proto -> *.pb.js compiler. Are these available
yet? (Or anyone else's implementation?) I'm new to Protocol Buffers and
it would be a big help. If I made my own it would be the third or fourth
redundant implementation.
Thanks a lot,
Ivan
I am very interested in any ,proto -> *.pb.js compiler. Are these available
yet?
(Or anyone else's implementation?)
Thanks, Andy. I'm only looking for the *.proto -> *.pb.js portion at the moment.
I assume the JSON format is exactly what goog.proto2.PbLiteSerializer does,
right?
Ivan
Thanks, Andy. I'm only looking for the *.proto -> *.pb.js portion at the moment.
I assume the JSON format is exactly what goog.proto2.PbLiteSerializer does,
right?
On Wed, May 26, 2010 at 1:56 PM, Andy Hochhaus <ahoc...@samegoal.com> wrote:
> I'll do my best to get this out soon.
I did the minimal cleanup necessary to get you a usable proto to pb.js
plugin. Unfortunately, as this is normally built buy our build system,
no Makefile or configure scripts exist. Instead, I've included some
generic instructions for how to compile in the README file.
https://samegoal.com/s/protobuf/
I've tested it on the two sample files provided by google and the
dozen or so files we are using it for internally and things seems to
mostly work. That said, I'm sure problems exist so if you find
anything wrong please let me know. The plugin for c++
(de)serialization isn't ready yet but it is still on my list of things
to do. Let me know if it becomes important for you and I'll try to
prioritize it.
Thanks,
Andy
Many thanks! The plugin is working well for me. It might be a little while
before I use it in an application. After I understand the format, I'll write my
own Python serializer/deserializer.
I'm including my own build steps, nearly identical to the README, in case
they help anyone:
step -1: compile and install Google's protobuf to /opt/protobuf
step 0: wget -r -np the above URL; copy js/ into the protobuf source tree.
Then I used this build script, which worked on Ubuntu 10.04:
#!/bin/sh -e
export PROTOBUF="/opt/protobuf"
export OUTDIR="$PROTOBUF/bin"
# step 1: generate the necessary headers to complete plugin compilation
"$PROTOBUF/bin/protoc" -I . -I protobuf/src --cpp_out=. \
protobuf/js/javascript_package.proto
# step 2: compile the plugin
mkdir -p ./protobuf/js/build
g++ -I "$PROTOBUF/include" \
-I . \
./protobuf/src/google/protobuf/compiler/plugin.pb.cc \
./protobuf/src/google/protobuf/compiler/plugin.cc \
./protobuf/js/code_generator.cpp \
./protobuf/js/protoc-gen-js.cpp \
./protobuf/js/javascript_package.pb.cc \
"-l:$PROTOBUF/lib/libprotobuf.a" \
"-l:$PROTOBUF/lib/libprotoc.a" \
-lpthread \
-o ./protobuf/js/build/protoc-gen-js
sudo cp ./protobuf/js/build/protoc-gen-js "$OUTDIR/"
### END OF SCRIPT
This successfully generated both the .js and .cc files:
/opt/protobuf/bin/protoc --plugin=/opt/protobuf/bin/protoc-gen-js \
-I . -I ./protobuf/src --js_out=/tmp --cpp_out=/tmp protobuf/js/test.proto
Thanks again,
Ivan
I finally got around to releasing the C++ pb json wire format
(de)serialization plugin. You can find it in the "cppjs" directory:
http://code.google.com/p/protobuf-plugin-closure/
This project now has everything you need to share protocol buffers
between a c++ server and a js client.
-Andy
-Andy