Repository navigation
Conversation
|
just checking in, any timeline for this ? I hope I will be quick wth sourcemap continuation after this :) |
|
@hrgdavor I haven't had time to properly review this one and I think I want to iterate a little more on this.
I don't see a blocker here, I'm still waiting for a strawman/prototype, I'd encourage you to go ahead(starting from whatever branch) and submit a draft PR, it's easy to deal with rebases those days and I'd be happy to help. |
|
ok, I will checkout this branch and base the impl on it, I can install a version locally, this way I might help by using the changed code if I stumble upon any issues. |
5486cf8 to
2f32782
Compare
Jackson 3 needs Java 17, as do the current Quarkus, Spring Boot and Camel releases. CI runs on JDK 17 and 21. Checkstyle and google-java-format run on JDK 21 only, since they need it.
e18c229 to
e9d9970
Compare
Core is renamed quickjs4j-core and no longer depends on Jackson. It maps values through a JsonCodec: the one set with Engine.Builder.withJsonCodec or the new builder of the generated proxies, or else the one created by the highest priority JsonCodecProvider found with ServiceLoader. - quickjs4j-jackson2 and quickjs4j-jackson3: the codecs, built with Jackson2Codec.builder() and Jackson3Codec.builder(). Jackson 3 is preferred when both are present. - quickjs4j: no code, it depends on core and the default codec, Jackson 2 for now, so existing users keep the same behaviour. The default can later move to Jackson 3 with a dependency change. The codec jars ship GraalVM metadata, so they are also found in native images built with the ServiceLoader feature disabled, as Quarkus does. Engine.DEFAULT_OBJECT_MAPPER is removed, and withObjectMapper(mapper) becomes withJsonCodec(Jackson2Codec.builder().withObjectMapper(mapper).build()).
e9d9970 to
bead841
Compare
Fixes #223.
Core is renamed
quickjs4j-coreand no longer depends on Jackson: values go through aJsonCodec, set withEngine.Builder.withJsonCodecor the generated proxy builders, or else created by the highest priorityJsonCodecProviderfound withServiceLoader.quickjs4j-coreJsonCodecandJsonCodecProvider, no JSON libraryquickjs4j-jackson2quickjs4j-jackson3quickjs4jExisting users keep
quickjs4jand the same behaviour. Moving the default to Jackson 3 later is a one-line change inquickjs4j.Generated proxies get a builder,
Calculator_Proxy.builder(script, ctx).withJsonCodec(codec).build(), so libraries such as the Quarkus extension can pass a codec explicitly (for example wrapping the application'sObjectMapper) instead of relying on the classpath.Engine.DEFAULT_OBJECT_MAPPERis removed, andwithObjectMapper(mapper)becomeswithJsonCodec(Jackson2Codec.builder().withObjectMapper(mapper).build()).The first commit moves the build to Java 17, which Jackson 3 needs; it can go in as its own PR.