Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Anton
    @antonkatz
    Couple of very specific questions about es4x/vert.x, may I ask them here?
    Paulo Lopes
    @pmlopes
    Yes, feel free to ask anything. We will try to help! 👍
    Anton
    @antonkatz
    Thank you!
    Is it possible to use a TemplateHandler with parameterized routes (eg. /user/:id) ?
    Anton
    @antonkatz
    And is there a hot-reloader?
    Frank Lemanschik
    @frank-dspeed
    var route = router.route('POST', "/catalogue/products/:producttype/:productid/");
    
    route.handler(function (routingContext) {
    
      var productType = routingContext.request().getParam("producttype");
      var productID = routingContext.request().getParam("productid");
    
      // Do something with them...
    });
    hot reload not really but!
    when you use quarkus a framework that is using also vertx in the background
    then it does offer that
    Paulo Lopes
    @pmlopes
    @antonkatz you can do redeploy (restart the application) with: es4x run --redeploy=**/*.js this watches for modifications on any js file and restarts the process when something changes. This is a built-in of vertx. There's also a extra parameter to run a command before restart (useful if you have a build step) --on-redeploy="run tsc for example"
    Regarding templates, it wasn't possible I think, but many improvements have landed on vertx 4 which may make it possible now, I need to check.
    Anton
    @antonkatz
    @frank-dspeed Thank you for confirming that the solution that I have going myself right now is the correct one.
    @pmlopes awesome, I'll try that.
    Also, what should I be aware of in terms of compatibility of libraries between node and es4x?
    Paulo Lopes
    @pmlopes
    you shouldn't take any node lib for granted. es4x is a ecma engine, which means, no v8, no node, just js. If the library is pure JS without node specific modules (think, libs you can use on the browser, then there's a chance it will work, otherwise it needs adjusment or a re-write, i'm afraid
    Anton
    @antonkatz
    that makes sense. I've got one lib in particular level-up that I'm curious about.
    and is there any way to specify the version of vert.x to use? The 4.0 beta is looking good
    Anton
    @antonkatz
    Ok, so I just did some testing. level-up didn't work out for me (could not find events module). Though, this isn't a pure level-up that I was testing, it's a my own custom mod. I also tried aws and that failed on crypto module. Darn.
    Is there any way to run side-car/worker scripts on node? Does that totally defeat the purpose of using es4x?
    Anton
    @antonkatz
    Is this an option? Or does it again defeat the point of es4x? https://www.graalvm.org/reference-manual/js/NodeJS/
    Paulo Lopes
    @pmlopes
    Hi, I've thought about it a while back. I thought of using the worker api to communicate with a real node process but I haven't spent time looking at it from the node side. In vertx there's the event bus and bridges. I'm slowly working on improving the tcp one to speak jsonrpc, just like a language server on vscode but the progress is slow...
    Anton
    @antonkatz
    Yeah man! Rock on. Slow progress is progress, and you don't own it to anybody! I really appreciate all the work you have done. This is the future of javascript.
    Frank Lemanschik
    @frank-dspeed
    @pmlopes @antonkatz about the node and no node part you can always use es4x with node-graal for migration i would advice to not overuse the node part but it can get you up and running till you got java replacements also consider to always pass "--engine.Mode=latency" that will save u warmup time
    John McAndrews
    @binarytide
    is there any way to get latest es4x pushed up to npm?
    Paulo Lopes
    @pmlopes
    You mean the current develop branch?
    I think I could attempt a prerelease. But I never did it before. I need some trials first
    John McAndrews
    @binarytide
    I didn't realize 0.13.3 was pre release, my bad
    John McAndrews
    @binarytide
    I've been working off 0.13.0 via npm
    Paulo Lopes
    @pmlopes
    No, a pre release would be a release based on vertx 4.0.0.Beta3 this would be es4x 0.14.0-beta
    But it requires rewrite of versions so a big chance of breaking everything if not properly tested
    John McAndrews
    @binarytide
    in that case, take you time. I'll take stable over shiny every time
    Anton
    @antonkatz
    @pmlopes a curiosity that hit me: by my understanding of how es4x gets its performance advantage, would there also be benefits to simply running expess on graal?
    Paulo Lopes
    @pmlopes
    Hi, from what I've seen before express wouldn't be much better as the the vertx eventloop takes better advantage of graal than the cross compile of libuv to llvm bitcode that runs on graal
    Anton
    @antonkatz
    and that applies to any node framework, correct? Because all of them use http and that depends on libuv?
    Frank Lemanschik
    @frank-dspeed
    in general right
    the speed adavantage also goes away on large Object Creation and throw them away for example acorn parsing
    laiweiwei
    @laiweiwei

    Hello, i am using the vert.x 3.9.x.
    There has a problem in the jdbc-client use case.
    In this case, i want to limit the result via java.sql.Statement.setMaxRows(max), but the jdbc-client just missing this option in applyStatementOptions() and i found that the SqlOptions has no maxRows field.
    So i created two PR try to solve this problem.

    vert-x3/vertx-sql-common#71
    vert-x3/vertx-jdbc-client#197

    Could you please merge this PR so that i can use the SqlOptions().setMaxRows() ?

    Thanks.

    @pmlopes
    Paulo Lopes
    @pmlopes
    Hi @laiweiwei I'm merging them. It's a bit slow as our CI (Travis is quite slow this week)... as things get green, I'll merge
    laiweiwei
    @laiweiwei

    Hi @laiweiwei I'm merging them. It's a bit slow as our CI (Travis is quite slow this week)... as things get green, I'll merge

    Thanks !

    Alex Kizer
    @kizerkizer
    heeelllo
    what's the typescript types npm package name?
    for es4x?
    @types/es4x?
    Frank Lemanschik
    @frank-dspeed
    nope they are inside es4x
    laiweiwei
    @laiweiwei
    Hi @pmlopes I found es4x use asm to gen. a FutureBase class to replace vertx-core's. This will cause a problem(FutureBase replacement failed) when I do not use es4x-launcher.jar to run the application (The order in which the JAR files in a directory are enumerated in the expanded class path is not specified)
    Frank Lemanschik
    @frank-dspeed
    leiwei what stops you from direcltly using graalvm ?
    you could even use graal node with --jvm and then use vertx inside that via const vertx = Java.type('.io.vertx')
    Paulo Lopes
    @pmlopes
    @laiweiwei I've a pr that exposes the asm gen so you can include the classes in your jar and solve this. Another option is to bundle the classes in the es4x jar but this forces you to load it before vertx core to work.
    laiweiwei
    @laiweiwei
    thanks @pmlopes