Skip to content

Commit

Permalink
Merge branch 'release/0.18.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmlopes committed Apr 29, 2022
2 parents 15d3f8f + 13c74f5 commit 1f08e25
Show file tree
Hide file tree
Showing 90 changed files with 274 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['22.0.0.2', dev]
version: ['22.1.0', dev]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: [8, 11, 17]
version: [11, 17]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.17.1] -
## [0.18.0] -
* Added new module `@vertx/uri-template`
* Force commonjs loader to be synchronized
* Bumped graal to 22.1.0
* Bumped vertx to 4.2.7
* Given that graaljs no longer supports java8, we bump the minor

## [0.17.1] - 2022-03-11
* Bump graaljs to 22.0.0.2
* codegen: fix imports on options
* structured clone: fix handling of graal proxy objects
Expand Down
29 changes: 2 additions & 27 deletions codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,14 @@
<parent>
<groupId>io.reactiverse</groupId>
<artifactId>es4x-parent</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>es4x-codegen</artifactId>
<version>0.17.1</version>

<properties>
<tools.jar>${java.home}/../lib/tools.jar</tools.jar>
</properties>

<profiles>
<profile>
<id>tools.jar</id>
<activation>
<file>
<exists>${tools.jar}</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${tools.jar}</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
</profiles>
<version>0.18.0</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ public String render(DataObjectModel model, int index, int size, Map<String, Obj
String superScope = getNPMScope(model.getSuperType().getModule());
if (!selfScope.equals(superScope)) {
TypeInfo referencedType = model.getSuperType();
importType(writer, session, referencedType, referencedType.getSimpleName(), getNPMScope(referencedType.getRaw().getModule()));
String suffix = "";
// take care of the suffixes
if (referencedType.getKind() == ClassKind.ENUM) {
suffix = "/enums";
}
if (referencedType.getKind() == ClassKind.OTHER && referencedType.getDataObject() != null) {
suffix = "/options";
}
importType(writer, session, referencedType, referencedType.getSimpleName(), getNPMScope(referencedType.getRaw().getModule()) + suffix);
imports = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ npm start # OR yarn start
```

::: tip COMPATIBILITY NOTE
ES4X requires [GraalVM](https://www.graalvm.org) or Java >= 8. If you're not sure which version is installed on your
ES4X requires [GraalVM](https://www.graalvm.org) or Java >= 11. If you're not sure which version is installed on your
system, consider using [jabba](https://github.com/shyiko/jabba).
:::
8 changes: 4 additions & 4 deletions docs/get-started/install.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Install

Assuming you’ve already installed [Node.js](https://nodejs.org/), you will need a working JVM. The requirements are
either ([Java](https://adoptopenjdk.net/) or [GraalVM](http://www.graalvm.org/)).
either ([Java](https://adoptium.net/) or [GraalVM](http://www.graalvm.org/)).

```bash
$ java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode)
```

If you see a similar output, this means your system currently has `java` **8**, which is not the best option as it will
Expand Down
4 changes: 2 additions & 2 deletions es4x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<parent>
<groupId>io.reactiverse</groupId>
<artifactId>es4x-parent</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>es4x</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
10 changes: 4 additions & 6 deletions es4x/src/main/java/io/reactiverse/es4x/ESVerticleFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
import io.reactiverse.es4x.impl.REPLVerticle;
import io.reactiverse.es4x.impl.StructuredClone;
import io.reactiverse.es4x.impl.VertxFileSystem;
import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.core.Verticle;
import io.vertx.core.Vertx;
import io.vertx.core.*;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.spi.VerticleFactory;
import org.graalvm.polyglot.Source;
import org.graalvm.polyglot.Value;
Expand Down Expand Up @@ -180,8 +178,8 @@ private String mainScript(String fsVerticleName) {
return main;
}

protected final Future<Void> waitFor(Runtime runtime, String callback) {
final Promise<Void> wrapper = Promise.promise();
protected final Future<Void> waitFor(Runtime runtime, ContextInternal context, String callback) {
final Promise<Void> wrapper = context.promise();
try {
if (runtime.emit(callback, wrapper) == 0) {
wrapper.complete();
Expand Down
2 changes: 1 addition & 1 deletion es4x/src/main/java/io/reactiverse/es4x/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class Runtime extends EventEmitterImpl {
// override the default load function to allow proper mapping of file for debugging
bindings.putMember("load", new Function<Object, Value>() {
@Override
public Value apply(Object value) {
public synchronized Value apply(Object value) {

try {
final Source source;
Expand Down
25 changes: 15 additions & 10 deletions es4x/src/main/java/io/reactiverse/es4x/impl/JSVerticleFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.reactiverse.es4x.ESVerticleFactory;
import io.reactiverse.es4x.Runtime;
import io.vertx.core.*;
import io.vertx.core.impl.ContextInternal;
import org.graalvm.polyglot.Source;
import org.graalvm.polyglot.Value;

Expand Down Expand Up @@ -54,7 +55,7 @@ public void init(Vertx vertx, Context context) {
}

@Override
public void start(Promise<Void> startFuture) {
public void start(Promise<Void> startPromise) {
final String address;
final boolean worker;

Expand All @@ -80,23 +81,27 @@ public void start(Promise<Void> startFuture) {

try {
module.invokeMember("runMain", fsVerticleName);
waitFor(runtime, "deploy")
.onComplete(startFuture);
waitFor(runtime, (ContextInternal) context, "deploy")
.onComplete(startPromise);
} catch (RuntimeException e) {
startFuture.fail(e);
startPromise.fail(e);
}
} catch (RuntimeException e) {
startFuture.fail(e);
startPromise.fail(e);
}
}

@Override
public void stop(Promise<Void> stopFuture) {
public void stop(Promise<Void> stopPromise) {
// call the undeploy if available
waitFor(runtime, "undeploy")
.onComplete(undeploy -> {
stopFuture.handle(undeploy);
runtime.close();
waitFor(runtime, (ContextInternal) context, "undeploy")
.onComplete(stopPromise)
.onSuccess(v -> {
try {
runtime.close();
} catch (RuntimeException e) {
e.printStackTrace();
}
});
}
};
Expand Down
27 changes: 16 additions & 11 deletions es4x/src/main/java/io/reactiverse/es4x/impl/MJSVerticleFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.reactiverse.es4x.Runtime;
import io.vertx.core.*;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.impl.ContextInternal;
import org.graalvm.polyglot.Source;

import java.io.File;
Expand Down Expand Up @@ -50,7 +51,7 @@ public void init(Vertx vertx, Context context) {
}

@Override
public void start(Promise<Void> startFuture) {
public void start(Promise<Void> startPromise) {
final String address;
final boolean worker;

Expand Down Expand Up @@ -87,25 +88,29 @@ public void start(Promise<Void> startFuture) {
.buildLiteral();

runtime.eval(source);
waitFor(runtime, "deploy")
.onComplete(startFuture);
waitFor(runtime, (ContextInternal) context,"deploy")
.onComplete(startPromise);
} catch (InvalidPathException e) {
startFuture.fail("File Not Found: " + fsVerticleName);
startPromise.fail("File Not Found: " + fsVerticleName);
} catch (RuntimeException e) {
startFuture.fail(e);
startPromise.fail(e);
}
} catch (RuntimeException e) {
startFuture.fail(e);
startPromise.fail(e);
}
}

@Override
public void stop(Promise<Void> stopFuture) {
public void stop(Promise<Void> stopPromise) {
// call the undeploy if available
waitFor(runtime, "undeploy")
.onComplete(undeploy -> {
stopFuture.handle(undeploy);
runtime.close();
waitFor(runtime, (ContextInternal) context, "undeploy")
.onComplete(stopPromise)
.onSuccess(v -> {
try {
runtime.close();
} catch (RuntimeException e) {
e.printStackTrace();
}
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions generator/io.reactiverse/elasticsearch-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<parent>
<groupId>io.reactiverse.es4x</groupId>
<artifactId>es4x-generator</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>elasticsearch-client</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<parent>
<groupId>io.reactiverse.es4x</groupId>
<artifactId>es4x-generator</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>reactiverse-contextual-logging</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<packaging>jar</packaging>

Expand Down
5 changes: 3 additions & 2 deletions generator/io.vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<parent>
<groupId>io.reactiverse</groupId>
<artifactId>es4x-parent</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>es4x-vertx-stack</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<dependencies>
<dependency>
Expand Down Expand Up @@ -94,6 +94,7 @@
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-stomp</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-tcp-eventbus-bridge</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-unit</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-uri-template</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-web-api-contract</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-web-api-service</artifactId><version>${project.version}</version></artifactItem>
<artifactItem><groupId>io.reactiverse.es4x</groupId><artifactId>vertx-web</artifactId><version>${project.version}</version></artifactItem>
Expand Down
4 changes: 2 additions & 2 deletions generator/io.vertx/vertx-amqp-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>io.reactiverse.es4x</groupId>
<artifactId>es4x-generator</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>vertx-amqp-client</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<properties>
<maven.groupId>io.vertx</maven.groupId>
Expand Down
4 changes: 2 additions & 2 deletions generator/io.vertx/vertx-auth-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>io.reactiverse.es4x</groupId>
<artifactId>es4x-generator</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>vertx-auth-common</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<properties>
<maven.groupId>io.vertx</maven.groupId>
Expand Down
4 changes: 2 additions & 2 deletions generator/io.vertx/vertx-auth-htdigest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>io.reactiverse.es4x</groupId>
<artifactId>es4x-generator</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>vertx-auth-htdigest</artifactId>
<version>0.17.1</version>
<version>0.18.0</version>

<properties>
<maven.groupId>io.vertx</maven.groupId>
Expand Down
Loading

0 comments on commit 1f08e25

Please sign in to comment.