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.
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 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?
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?