Skip to content

feat(graphql): GraphQL client support + @Mapped enum binding + WebSocket subprotocols#5141

Open
shai-almog wants to merge 1 commit into
masterfrom
feat-graphql
Open

feat(graphql): GraphQL client support + @Mapped enum binding + WebSocket subprotocols#5141
shai-almog wants to merge 1 commit into
masterfrom
feat-graphql

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

Adds a GraphQL client stack that slots into the same "spec → generated typed client" architecture as the existing OpenAPI (@RestClient) and gRPC (@GrpcClient) support, plus two enabling enhancements that the GraphQL work needed and that stand on their own.

GraphQL (cn1:generate-graphql + @GraphQLClient)

  • Runtime com.codename1.io.graphql: GraphQL invoker (HTTP POST queries/mutations, public decodeJson/encodeVariables), GraphQLResponse<T> (data and errors co-exist for partial results), GraphQLError, GraphQLClients registry, and GraphQLSubscription over the new core com.codename1.io.WebSocket using the graphql-transport-ws protocol.
  • Annotations com.codename1.annotations.graphql: @GraphQLClient, @Query / @Mutation / @Subscription, @Var (reuses @Header and @Mapped).
  • Processor GraphQLClientAnnotationProcessor emits <Name>Impl + cn1app.GraphQLClientBootstrap, registered in the annotation-processor SPI and wired into JavaSEPort / Executor exactly like the REST/gRPC bootstraps.
  • Generator mojo cn1:generate-graphql with hand-written SDL + operation-document parsers. Two modes: precise operations mode (per-selection @Mapped types, fragments inlined, operation document embedded verbatim) and a schema-only quick-start mode (bounded-depth auto-selection, cn1.graphql.maxDepth).
@GraphQLClient("https://api.example.com/graphql")
public interface StarWarsApi {
    @Query("query HeroName($episode: Episode) { hero(episode: $episode) { name } }")
    void heroName(@Var("episode") Episode episode,
                  @Header("Authorization") String bearerToken,
                  OnComplete<GraphQLResponse<HeroNameData>> callback);

    @Subscription("subscription OnReview($ep: Episode!) { reviewAdded(episode: $ep) { stars } }")
    GraphQLSubscription onReview(@Var("ep") Episode ep,
                                 @Header("Authorization") String bearerToken,
                                 GraphQLSubscription.Handler<OnReviewData> handler);

    static StarWarsApi of(String endpoint) { return GraphQLClients.create(StarWarsApi.class, endpoint); }
}

@Mapped enum binding

Previously an enum-typed field was classified as a nested reference, found no mapper, and silently didn't serialise. Now AnnotatedClass.isEnum() + PropertyTypeKind.enumType() let MappingAnnotationProcessor upgrade REFERENCE → ENUM (and detect List<Enum>), emitting name() on write and valueOf on read (unknown values decode to null) across both JSON and XML. GraphQL response/input fields now use real enum types instead of String.

WebSocket subprotocols (Sec-WebSocket-Protocol)

The core WebSocket facade gains subprotocols(String...) + getSelectedSubprotocol(), threaded through WebSocketImpl. Implemented across every port: JavaSE + Android hand-rolled handshakes, iOS (webSocketTaskWithURL:protocols: + didOpenWithProtocol:, with the matching IOSNative bridge rename), and JavaScript (new WebSocket(url, protocols) + w.protocol). GraphQL subscriptions offer graphql-transport-ws during the handshake.

Tests

  • Plugin: GenerateGraphQLMojoTest (operations + schema-only modes, fragments, enum/input emission, records vs classes), GraphQLClientAnnotationProcessorTest (impl/bootstrap, GraphQL.execute/subscribe, error cases), and a new enum round-trip case in MappingAnnotationProcessorTest.
  • Core: GraphQLResponseTest (envelope decode, partial errors, variable encoding) and a subprotocol case in WebSocketTest.
  • JavaSE: a real RFC 6455 subprotocol-negotiation case in JavaSEWebSocketImplTest.

All of the above pass locally (34 GraphQL/mapping/WebSocket tests) against the current master base.

Test plan

  • cd maven && mvn install -Plocal-dev-javase -DskipTests — core + plugin compile.
  • mvn -pl codenameone-maven-plugin test -Dtest=GenerateGraphQLMojoTest,GraphQLClientAnnotationProcessorTest,MappingAnnotationProcessorTest
  • mvn -DunitTests -pl core-unittests test -Dtest=GraphQLResponseTest,WebSocketTest
  • mvn -pl javase test -Dtest=JavaSEWebSocketImplTest
  • ./scripts/build-android-port.sh -DskipTests — Android handshake change compiles.
  • ./scripts/build-ios-port.sh -DskipTests — iOS native WebSocketImpl.m + IOSNative.m bridge compile under ParparVM.

🤖 Generated with Claude Code

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 11 screenshots: 11 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.

Native Android coverage

  • 📊 Line coverage: 13.07% (7714/59020 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.57% (38276/362021), branch 4.55% (1551/34088), complexity 5.54% (1816/32762), method 9.69% (1488/15358), class 15.86% (341/2150)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 13.07% (7714/59020 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.57% (38276/362021), branch 4.55% (1551/34088), complexity 5.54% (1816/32762), method 9.69% (1488/15358), class 15.86% (341/2150)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 996.000 ms
Base64 CN1 encode 230.000 ms
Base64 encode ratio (CN1/native) 0.231x (76.9% faster)
Base64 native decode 1005.000 ms
Base64 CN1 decode 160.000 ms
Base64 decode ratio (CN1/native) 0.159x (84.1% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Cloudflare Preview

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 715 total, 0 failed, 3 skipped

Benchmark Results

  • Execution Time: 10249 ms

  • Hotspots (Top 20 sampled methods):

    • 21.08% com.codename1.tools.translator.Parser.isMethodUsed (360 samples)
    • 18.44% java.util.ArrayList.indexOf (315 samples)
    • 18.21% java.lang.String.indexOf (311 samples)
    • 6.26% java.lang.Object.hashCode (107 samples)
    • 4.39% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (75 samples)
    • 2.46% com.codename1.tools.translator.ByteCodeClass.markDependent (42 samples)
    • 2.11% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (36 samples)
    • 2.05% java.lang.System.identityHashCode (35 samples)
    • 1.70% com.codename1.tools.translator.BytecodeMethod.equals (29 samples)
    • 1.46% java.lang.StringBuilder.append (25 samples)
    • 1.41% com.codename1.tools.translator.ByteCodeClass.updateAllDependencies (24 samples)
    • 1.41% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (24 samples)
    • 1.29% com.codename1.tools.translator.Parser.cullMethods (22 samples)
    • 1.11% com.codename1.tools.translator.Parser.getClassByName (19 samples)
    • 0.82% com.codename1.tools.translator.BytecodeMethod.isMethodUsedByNative (14 samples)
    • 0.70% com.codename1.tools.translator.BytecodeMethod.optimize (12 samples)
    • 0.64% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (11 samples)
    • 0.64% com.codename1.tools.translator.ByteCodeClass.isDefaultInterfaceMethod (11 samples)
    • 0.59% com.codename1.tools.translator.BytecodeMethod.appendMethodC (10 samples)
    • 0.53% com.codename1.tools.translator.BytecodeMethod.appendMethodSignatureSuffixFromDesc (9 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 307 seconds

Build and Run Timing

Metric Duration
Simulator Boot 97000 ms
Simulator Boot (Run) 1000 ms
App Install 22000 ms
App Launch 7000 ms
Test Execution 263000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 601.000 ms
Base64 CN1 encode 1353.000 ms
Base64 encode ratio (CN1/native) 2.251x (125.1% slower)
Base64 native decode 285.000 ms
Base64 CN1 decode 984.000 ms
Base64 decode ratio (CN1/native) 3.453x (245.3% slower)
Base64 SIMD encode 487.000 ms
Base64 encode ratio (SIMD/native) 0.810x (19.0% faster)
Base64 encode ratio (SIMD/CN1) 0.360x (64.0% faster)
Base64 SIMD decode 385.000 ms
Base64 decode ratio (SIMD/native) 1.351x (35.1% slower)
Base64 decode ratio (SIMD/CN1) 0.391x (60.9% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 56.000 ms
Image createMask (SIMD on) 9.000 ms
Image createMask ratio (SIMD on/off) 0.161x (83.9% faster)
Image applyMask (SIMD off) 130.000 ms
Image applyMask (SIMD on) 60.000 ms
Image applyMask ratio (SIMD on/off) 0.462x (53.8% faster)
Image modifyAlpha (SIMD off) 153.000 ms
Image modifyAlpha (SIMD on) 73.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.477x (52.3% faster)
Image modifyAlpha removeColor (SIMD off) 252.000 ms
Image modifyAlpha removeColor (SIMD on) 172.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.683x (31.7% faster)
Image PNG encode (SIMD off) 1452.000 ms
Image PNG encode (SIMD on) 1004.000 ms
Image PNG encode ratio (SIMD on/off) 0.691x (30.9% faster)
Image JPEG encode 511.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

JavaScript port screenshot updates

Compared 94 screenshots: 74 matched, 15 updated, 5 missing references.

  • AnimateHierarchyScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateHierarchyScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateHierarchyScreenshotTest.png in workflow artifacts.

  • AnimateLayoutScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateLayoutScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateLayoutScreenshotTest.png in workflow artifacts.

  • AnimateUnlayoutScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateUnlayoutScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateUnlayoutScreenshotTest.png in workflow artifacts.

  • ComponentReplaceFadeScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    ComponentReplaceFadeScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as ComponentReplaceFadeScreenshotTest.png in workflow artifacts.

  • ComponentReplaceSlideScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    ComponentReplaceSlideScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as ComponentReplaceSlideScreenshotTest.png in workflow artifacts.

  • CoverHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    CoverHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as CoverHorizontalTransitionTest.png in workflow artifacts.

  • FadeTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    FadeTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as FadeTransitionTest.png in workflow artifacts.

  • MorphTransitionScrolledSourceTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionScrolledSourceTest.png.

    MorphTransitionScrolledSourceTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionScrolledSourceTest.png in workflow artifacts.

  • MorphTransitionSnapshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionSnapshotTest.png.

    MorphTransitionSnapshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionSnapshotTest.png in workflow artifacts.

  • MorphTransitionTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionTest.png.

    MorphTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionTest.png in workflow artifacts.

  • MotionShowcaseScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    MotionShowcaseScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MotionShowcaseScreenshotTest.png in workflow artifacts.

  • PullToRefreshSpinnerScreenshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/PullToRefreshSpinnerScreenshotTest.png.

    PullToRefreshSpinnerScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as PullToRefreshSpinnerScreenshotTest.png in workflow artifacts.

  • SheetSlideUpAnimationScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SheetSlideUpAnimationScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SheetSlideUpAnimationScreenshotTest.png in workflow artifacts.

  • SlideFadeTitleTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideFadeTitleTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideFadeTitleTransitionTest.png in workflow artifacts.

  • SlideHorizontalBackTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideHorizontalBackTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideHorizontalBackTransitionTest.png in workflow artifacts.

  • SlideHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideHorizontalTransitionTest.png in workflow artifacts.

  • SlideVerticalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideVerticalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideVerticalTransitionTest.png in workflow artifacts.

  • SmoothScrollScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SmoothScrollScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SmoothScrollScreenshotTest.png in workflow artifacts.

  • TabsAnimatedIndicatorScreenshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/TabsAnimatedIndicatorScreenshotTest.png.

    TabsAnimatedIndicatorScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as TabsAnimatedIndicatorScreenshotTest.png in workflow artifacts.

  • UncoverHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    UncoverHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as UncoverHorizontalTransitionTest.png in workflow artifacts.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 126 seconds

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 693.000 ms
Base64 CN1 encode 1165.000 ms
Base64 encode ratio (CN1/native) 1.681x (68.1% slower)
Base64 native decode 388.000 ms
Base64 CN1 decode 912.000 ms
Base64 decode ratio (CN1/native) 2.351x (135.1% slower)
Base64 SIMD encode 386.000 ms
Base64 encode ratio (SIMD/native) 0.557x (44.3% faster)
Base64 encode ratio (SIMD/CN1) 0.331x (66.9% faster)
Base64 SIMD decode 398.000 ms
Base64 decode ratio (SIMD/native) 1.026x (2.6% slower)
Base64 decode ratio (SIMD/CN1) 0.436x (56.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 64.000 ms
Image createMask (SIMD on) 13.000 ms
Image createMask ratio (SIMD on/off) 0.203x (79.7% faster)
Image applyMask (SIMD off) 201.000 ms
Image applyMask (SIMD on) 96.000 ms
Image applyMask ratio (SIMD on/off) 0.478x (52.2% faster)
Image modifyAlpha (SIMD off) 135.000 ms
Image modifyAlpha (SIMD on) 87.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.644x (35.6% faster)
Image modifyAlpha removeColor (SIMD off) 210.000 ms
Image modifyAlpha removeColor (SIMD on) 94.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.448x (55.2% faster)
Image PNG encode (SIMD off) 1246.000 ms
Image PNG encode (SIMD on) 856.000 ms
Image PNG encode ratio (SIMD on/off) 0.687x (31.3% faster)
Image JPEG encode 458.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 295 seconds

Build and Run Timing

Metric Duration
Simulator Boot 89000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 16000 ms
Test Execution 342000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1332.000 ms
Base64 CN1 encode 1924.000 ms
Base64 encode ratio (CN1/native) 1.444x (44.4% slower)
Base64 native decode 664.000 ms
Base64 CN1 decode 1888.000 ms
Base64 decode ratio (CN1/native) 2.843x (184.3% slower)
Base64 SIMD encode 624.000 ms
Base64 encode ratio (SIMD/native) 0.468x (53.2% faster)
Base64 encode ratio (SIMD/CN1) 0.324x (67.6% faster)
Base64 SIMD decode 764.000 ms
Base64 decode ratio (SIMD/native) 1.151x (15.1% slower)
Base64 decode ratio (SIMD/CN1) 0.405x (59.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 66.000 ms
Image createMask (SIMD on) 12.000 ms
Image createMask ratio (SIMD on/off) 0.182x (81.8% faster)
Image applyMask (SIMD off) 202.000 ms
Image applyMask (SIMD on) 125.000 ms
Image applyMask ratio (SIMD on/off) 0.619x (38.1% faster)
Image modifyAlpha (SIMD off) 529.000 ms
Image modifyAlpha (SIMD on) 71.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.134x (86.6% faster)
Image modifyAlpha removeColor (SIMD off) 273.000 ms
Image modifyAlpha removeColor (SIMD on) 158.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.579x (42.1% faster)
Image PNG encode (SIMD off) 2080.000 ms
Image PNG encode (SIMD on) 1178.000 ms
Image PNG encode ratio (SIMD on/off) 0.566x (43.4% faster)
Image JPEG encode 688.000 ms

…ket subprotocols

Adds a GraphQL client stack that mirrors the existing OpenAPI/gRPC
"spec -> generated typed client" architecture, plus two enabling
enhancements.

GraphQL:
- Runtime com.codename1.io.graphql: GraphQL invoker (HTTP POST queries/
  mutations + decodeJson + encodeVariables), GraphQLResponse (data and
  errors co-exist), GraphQLError, GraphQLClients registry, and
  GraphQLSubscription over com.codename1.io.WebSocket (graphql-transport-ws).
- Annotations com.codename1.annotations.graphql: @GraphQLClient,
  @Query/@Mutation/@subscription, @var (reuses @Header and @mapped).
- GraphQLClientAnnotationProcessor emits <Name>Impl + cn1app.GraphQLClientBootstrap.
- cn1:generate-graphql mojo with hand-written SDL + operation-document
  parsers; precise operations mode and schema-only bounded-depth mode.
- Bootstrap wired into JavaSEPort + Executor like the REST/gRPC ones.

@mapped enum binding:
- AnnotatedClass.isEnum() + PropertyTypeKind.enumType(); MappingAnnotationProcessor
  upgrades REFERENCE->ENUM and detects List<Enum>, emitting name()/valueOf
  (unknown -> null) across JSON and XML. GraphQL response/input fields now
  use real enum types.

WebSocket subprotocols:
- WebSocket.subprotocols(String...) + getSelectedSubprotocol(), threaded
  through WebSocketImpl. Sec-WebSocket-Protocol implemented in JavaSE,
  Android, iOS (webSocketTaskWithURL:protocols: + didOpenWithProtocol:),
  and JavaScript. GraphQL subscriptions offer graphql-transport-ws.

Tests: GenerateGraphQLMojoTest, GraphQLClientAnnotationProcessorTest,
GraphQLResponseTest, plus enum round-trip and subprotocol negotiation
tests for the mapper and WebSocket (core mock + JavaSE RFC 6455 echo).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant