You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "fdominik (GitHub)" <gi...@apache.org> on 2019/02/23 21:26:39 UTC

[GitHub] [tinkerpop] fdominik opened pull request #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

https://issues.apache.org/jira/browse/TINKERPOP-2143
Summary of changes:
* Updated dependency on WS package (which was very old 3.0.0) to v 6.0.0. This is required by browsers.
* Added dependency to util and events packages which were required by the javascript module,  but were not listed in dependencies, so that it wouldn't compile.
* Added new dependency to uiid library.

* Generation of UUIDs was passed to UUID library instead of utilizing crypto package (which is not anymore available as separate library in browsers world, it is bundled, however some functions used in generating UUID were not available in the new bundled crypto). The uuid library can generate UUID of version 4, which was the version used to generate the UUIDs.
* Usage of standard WebSocket object from default packages.
 -  a new Buffer handling had to be written because the browser WS library doesnt have automatic creation of Buffer Arrays, so it had to be implemented from scratch => using Uint8Array.

Code has been tested in our UI project, where we can send requests from UI to Gremlin server. I wasn't able to run the Tinkerpop tests locally.


[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

[GitHub] [tinkerpop] fdominik commented on issue #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

Posted by "fdominik (GitHub)" <gi...@apache.org>.
@spmallette yeah I've noticed that, I tried to solve, it didn't help. And I hoped somebody could direct me, why the dependencies are not read from package.json file. Because the reason it fails is that Travis can't find the uuid library I added to dependencies. I will try to investigate the issue and come with solution, but it might take some time as I am on vacation now and doing it when it is rainy :) 

[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

[GitHub] [tinkerpop] spmallette commented on issue #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

Posted by "spmallette (GitHub)" <gi...@apache.org>.
@fdominik - sorry it took me some time to come back to this. if the problem is with `package.json` then i think it's likely that your problem is related to the fact that we generate `package.json` from:

https://github.com/apache/tinkerpop/blob/3c87b3a99b5182b9c1dc245d474def1662bae68f/gremlin-javascript/glv/PackageJson.template

That generation is triggered by a maven command so that's probably why maven builds in Travis are having trouble. Hopefully, that solves your problem. 

As far as other issues go, I'll largely defer to @jorgebay and @jbmusso but I think that administratively, it would be nice to have an entry added in CHANGELOG for 3.4.1:

https://github.com/apache/tinkerpop/blob/3c87b3a99b5182b9c1dc245d474def1662bae68f/CHANGELOG.asciidoc

and if you want to really polish this up, then you would want to add a section to our "Upgrade Documentation":

https://github.com/apache/tinkerpop/blob/3c87b3a99b5182b9c1dc245d474def1662bae68f/docs/src/upgrade/release-3.4.x.asciidoc

specifically, a subsection to an "Upgrading for Users" for 3.4.1. This change seems interesting enough that users would want to know about it.

anyway, let's see if your build problem gets resolved on Travis and then we can resume the review process.






[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

[GitHub] [tinkerpop] spmallette commented on issue #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

Posted by "spmallette (GitHub)" <gi...@apache.org>.
@fdominik Travis seems to be complaining about something:

```text
[INFO] --- frontend-maven-plugin:1.6:npm (npm test) @ gremlin-javascript ---
[INFO] Running 'npm test --exit' in /home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript
[INFO] 
[INFO] > gremlin@3.4.1-alpha1 test /home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript
[INFO] > mocha test/unit test/integration -t 5000
[INFO] 
[ERROR] module.js:471
[ERROR]     throw err;
[ERROR]     ^
[ERROR] 
[ERROR] Error: Cannot find module 'uuid/v4'
[ERROR]     at Function.Module._resolveFilename (module.js:469:15)
[ERROR]     at Function.Module._load (module.js:417:25)
[ERROR]     at Module.require (module.js:497:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at Object.<anonymous> (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js:26:16)
[ERROR]     at Module._compile (module.js:570:32)
[ERROR]     at Object.Module._extensions..js (module.js:579:10)
[ERROR]     at Module.load (module.js:487:32)
[ERROR]     at tryModuleLoad (module.js:446:12)
[ERROR]     at Function.Module._load (module.js:438:3)
[ERROR]     at Module.require (module.js:497:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at Object.<anonymous> (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js:25:15)
[ERROR]     at Module._compile (module.js:570:32)
[ERROR]     at Object.Module._extensions..js (module.js:579:10)
[ERROR]     at Module.load (module.js:487:32)
[ERROR]     at tryModuleLoad (module.js:446:12)
[ERROR]     at Function.Module._load (module.js:438:3)
[ERROR]     at Module.require (module.js:497:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at Object.<anonymous> (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js:25:11)
[ERROR]     at Module._compile (module.js:570:32)
[ERROR]     at Object.Module._extensions..js (module.js:579:10)
[ERROR]     at Module.load (module.js:487:32)
[ERROR]     at tryModuleLoad (module.js:446:12)
[ERROR]     at Function.Module._load (module.js:438:3)
[ERROR]     at Module.require (module.js:497:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at Object.<anonymous> (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/exports-test.js:26:19)
[ERROR]     at Module._compile (module.js:570:32)
[ERROR]     at Object.Module._extensions..js (module.js:579:10)
[ERROR]     at Module.load (module.js:487:32)
[ERROR]     at tryModuleLoad (module.js:446:12)
[ERROR]     at Function.Module._load (module.js:438:3)
[ERROR]     at Module.require (module.js:497:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at /home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/node_modules/mocha/lib/mocha.js:231:27
[ERROR]     at Array.forEach (native)
[ERROR]     at Mocha.loadFiles (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/node_modules/mocha/lib/mocha.js:228:14)
[ERROR]     at Mocha.run (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/node_modules/mocha/lib/mocha.js:514:10)
[ERROR]     at Object.<anonymous> (/home/travis/build/apache/tinkerpop/gremlin-javascript/src/main/javascript/gremlin-javascript/node_modules/mocha/bin/_mocha:484:18)
[ERROR]     at Module._compile (module.js:570:32)
[ERROR]     at Object.Module._extensions..js (module.js:579:10)
[ERROR]     at Module.load (module.js:487:32)
[ERROR]     at tryModuleLoad (module.js:446:12)
[ERROR]     at Function.Module._load (module.js:438:3)
[ERROR]     at Module.runMain (module.js:604:10)
[ERROR]     at run (bootstrap_node.js:383:7)
[ERROR]     at startup (bootstrap_node.js:149:9)
[ERROR]     at bootstrap_node.js:496:3
[ERROR] npm ERR! Test failed.  See above for more details.
```

Failed on two separate builds which is interesting because I wasn't aware javascript builds were running twice. @jorgebay it seems like we don't use the `.glv` file to control whether or not `gremlin-javascript` builds. I think that's fine given that the maven plugin seems to handle all the environmental setup on the local machine. Any reason we need a [specific build](https://github.com/apache/tinkerpop/blob/master/.travis.yml#L35) for `gremlin-javascript` then? seems like we could just rely on the regular `mvn clean install` build, right?

[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

[GitHub] [tinkerpop] x007007007 commented on issue #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

Posted by "x007007007 (GitHub)" <gi...@apache.org>.
hi, I try to checkout your pr and run local, I have a error once I have a query like g.V().valueMap(true).toList()

```
TypeError: this._ws.removeAllListeners is not a function[详细了解] app.js line 5320 > eval:309:5
_cleanupWebsocket
connection.js:309
_handleClose
connection.js:224
open/this._ws.onclose
connection.js:125
```

[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

[GitHub] [tinkerpop] fdominik commented on issue #1070: TINKERPOP-2143 JavaScript GLV: Support browsers

Posted by "fdominik (GitHub)" <gi...@apache.org>.
@spmallette yeah I've noticed that, I tried to solve, it didn't help. And I hoped somebody could me direct, why the dependencies are not read from package.json file. Because the reason it fails is that Travis can't find the uuid library I added to dependencies. I will try to investigate the issue and come with solution, but it might take some time as I am on vacation now and doing it when it is rainy :) 

[ Full content available at: https://github.com/apache/tinkerpop/pull/1070 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org