I'm having a heck of a time getting this to work.
Let me back up, I _did_ get it to work, but I don't know if it was the 
right process.

I am not using node.js or anything.
The 
documentation https://github.com/google/protobuf/blob/master/js/README.md 
isn't super clear, it seems to assume familiarity with closure.  I have no 
familiarity, this was pieced together from Closure's website.
I've had no problems with ProtoBuf in Java or C++, JS is throwing me for a 
loop.

To keep it short, I'll put what I did that worked first.

1) This DID work, but it doesn't seem _right_
I grabbed https://github.com/google/protobuf/releases the javascript release
I copied js to a subfolder in my project's path.

dylanetaft@dylanetaft-iMac:~/Projects/RClient$ 
./lib/closure-library/closure/bin/build/closurebuilder.py --root=. --input 
client.js -o script > out.js
./lib/closure-library/closure/bin/build/closurebuilder.py: Scanning paths...
./lib/closure-library/closure/bin/build/closurebuilder.py: 1600 sources 
scanned.
./lib/closure-library/closure/bin/build/closurebuilder.py: Building 
dependency tree..
Traceback (most recent call last):
  File "./lib/closure-library/closure/bin/build/closurebuilder.py", line 
293, in <module>
    main()
  File "./lib/closure-library/closure/bin/build/closurebuilder.py", line 
229, in main
    tree = depstree.DepsTree(sources)
  File 
"/home/dylanetaft/Projects/RClient/lib/closure-library/closure/bin/build/depstree.py",
 
line 56, in __init__
    raise NamespaceNotFoundError(require, source)
depstree.NamespaceNotFoundError: Namespace "proto.jspb.test.TestProto3" 
never provided. Required in PathSource lib/protobuf/proto3_test.js

If I delete *test* in "build" and "js" - it works.  I can use protobuf in 
my JavaScript scripts.  
This doesn't seem like a "normal" way to include it?  What is the _right_ 
way without Node.JS?


2) The first thing I tried was I 
downloaded https://unpkg.com/google-protobuf@3.3.0 to protobuf.js - this 
doesn't work

dylanetaft@dylanetaft-iMac:~/Projects/RClient$ 
./lib/closure-library/closure/bin/build/closurebuilder.py --root=. --input 
client.js -o script > out.js
./lib/closure-library/closure/bin/build/closurebuilder.py: Scanning paths...
./lib/closure-library/closure/bin/build/closurebuilder.py: 1572 sources 
scanned.
./lib/closure-library/closure/bin/build/closurebuilder.py: Building 
dependency tree..
Traceback (most recent call last):
  File "./lib/closure-library/closure/bin/build/closurebuilder.py", line 
293, in <module>
    main()
  File "./lib/closure-library/closure/bin/build/closurebuilder.py", line 
229, in main
    tree = depstree.DepsTree(sources)
  File 
"/home/dylanetaft/Projects/RClient/lib/closure-library/closure/bin/build/depstree.py",
 
line 56, in __init__
    raise NamespaceNotFoundError(require, source)
depstree.NamespaceNotFoundError: Namespace "jspb.BinaryReader" never 
provided. Required in PathSource rprotocol.js

No dice here.


I'm not using npm because I'm not using node.js?

Do I need to use closurebuilder.py to combine everything into a single js? 
I see also depswriter.py - but that seems to recursively search and build a 
js file I can include to include every single js under the path I am in.

There's also a closure compiler?

What if at this stage in testing I don't want to compile, or combine to a 
single 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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to