You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "spmallette (via GitHub)" <gi...@apache.org> on 2026/04/08 23:51:24 UTC

[PR] Gremlator [tinkerpop]

spmallette opened a new pull request, #3382:
URL: https://github.com/apache/tinkerpop/pull/3382

   Introducing Gremlator in its javascript only form. This is a port of the prototype application currently running at https://gremlator.com and built by @bechbd 
   
   Just a draft PR for now to reference in the DISCUSS thread.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#issuecomment-4271120184

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette merged PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#issuecomment-4270879739

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette commented on code in PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#discussion_r3099841254


##########
bin/generate-home.sh:
##########
@@ -31,14 +31,24 @@ npm run build
 
 popd
 
+pushd docs/gremlator
+
+echo "npm: $(npm -version)"
+npm install
+npm run build
+
+popd
+
 hash rsync 2> /dev/null
 
 if [ $? -eq 0 ]; then
   rsync -avq docs/site/home target/site --exclude template
   rsync -avq docs/gremlint/dist/ target/site/home/gremlint
+  rsync -avq docs/gremlator/build/ target/site/home/gremlator

Review Comment:
   not sure what happened there. thought i purposely changed that to build after dist didn't work but now i see it doesn't work with build....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on code in PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#discussion_r3103068812


##########
gremlin-js/package-lock.json:
##########
@@ -39,6 +39,7 @@
         "eslint-plugin-prettier": "^5.0.0",
         "globals": "^15.14.0",
         "js-yaml": "^3.14.2",
+        "jsdoc": "^4.0.5",

Review Comment:
   Nit: leaked dependency addition? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette commented on code in PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#discussion_r3103194530


##########
docs/gremlator/vite.config.ts:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/// <reference types="vitest" />
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+
+export default defineConfig({
+  plugins: [react()],
+  base: '/gremlator',

Review Comment:
   https://issues.apache.org/jira/browse/TINKERPOP-3241



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on code in PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#discussion_r3096321794


##########
bin/generate-home.sh:
##########
@@ -31,14 +31,24 @@ npm run build
 
 popd
 
+pushd docs/gremlator
+
+echo "npm: $(npm -version)"
+npm install
+npm run build
+
+popd
+
 hash rsync 2> /dev/null
 
 if [ $? -eq 0 ]; then
   rsync -avq docs/site/home target/site --exclude template
   rsync -avq docs/gremlint/dist/ target/site/home/gremlint
+  rsync -avq docs/gremlator/build/ target/site/home/gremlator

Review Comment:
   ```suggestion
     rsync -avq docs/gremlator/dist/ target/site/home/gremlator
   ```



##########
bin/generate-home.sh:
##########
@@ -31,14 +31,24 @@ npm run build
 
 popd
 
+pushd docs/gremlator
+
+echo "npm: $(npm -version)"
+npm install
+npm run build
+
+popd
+
 hash rsync 2> /dev/null
 
 if [ $? -eq 0 ]; then
   rsync -avq docs/site/home target/site --exclude template
   rsync -avq docs/gremlint/dist/ target/site/home/gremlint
+  rsync -avq docs/gremlator/build/ target/site/home/gremlator
 else
   cp -R docs/site/home target/site
   cp -R docs/gremlint/dist/. target/site/home/gremlint
+  cp -R docs/gremlator/build/. target/site/home/gremlator

Review Comment:
   ```suggestion
     cp -R docs/gremlator/dist/. target/site/home/gremlator
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Gremlator [tinkerpop]

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on code in PR #3382:
URL: https://github.com/apache/tinkerpop/pull/3382#discussion_r3096526371


##########
docs/gremlator/vite.config.ts:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/// <reference types="vitest" />
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+
+export default defineConfig({
+  plugins: [react()],
+  base: '/gremlator',

Review Comment:
   ```suggestion
     base: '/gremlator',
     esbuild: {
       keepNames: true,
     },
   ```
   
   In local testing, I was noticing that step arguments seemed to just pass straight through without any translation.
   
   <img width="942" height="396" alt="image" src="https://github.com/user-attachments/assets/3df9df97-42d5-447c-856a-60731fc306aa" />
   <img width="895" height="386" alt="image" src="https://github.com/user-attachments/assets/f75b38ad-13b2-41fa-9134-47d4794b6e42" />
   
   
   My AI overlord of choice had this to say about it, resulting in this fix:
   
   > The TranslateVisitor.visit() method dispatches to the correct visitor method (e.g. visitStringLiteral, visitIntegerLiteral) by inspecting tree.constructor.name at runtime — it expects names like StringLiteralContext and strips the Context suffix to find the method. 
   >
   > Vite's production build minifies class names, so StringLiteralContext becomes something like Qh. The className.endsWith('Context') check fails, the dispatch never matches any specific visitor method, and every rule context falls through to the generic visitChildren() path, which just walks down to terminal 
   tokens and outputs raw text.
   > 
   > That's why step names translate correctly (they're terminal tokens handled by visitTerminal) but all arguments — strings, numbers, booleans, collections — pass through unmodified. The language-specific visitor overrides for those literal types never get called.
   >
   > The fix is adding esbuild: { keepNames: true } to vite.config.ts so class names survive minification. But the deeper issue is in gremlin-js itself: the visit() dispatch relies on runtime class name reflection, which is inherently fragile under minification. A more robust approach would be to dispatch on 
   ruleIndex (a stable integer) rather than the class name string.
   
   That is quite an unexpected failure mode in my opinion. It does give me some concerns about the frailty of the JS translators in embedded webapp deployments (which is their intended purpose). 
   
   I don't think the translator fragility is of concern for this PR, but it's something to think about going forward.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org