Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
5f3d922
Initial work on the new JavaScript port
shai-almog Mar 31, 2026
0e523b8
Added improved JavaScript port coverage to CI and fixed port security…
shai-almog Mar 31, 2026
042e3bc
Adding initial placeholder facade for the full port
shai-almog Mar 31, 2026
8844c0f
HTML5Implementation now delegates bootstrap main-class binding, stora…
shai-almog Apr 1, 2026
10077e1
Added some event handling and delegation
shai-almog Apr 1, 2026
9c4da78
Refactored events into a more generic session state
shai-almog Apr 1, 2026
5564e63
Improved keyboard event handling
shai-almog Apr 1, 2026
1464e68
Initial work on rendering layer
shai-almog Apr 1, 2026
38b13a4
Additional HTML Graphics support
shai-almog Apr 1, 2026
0a47a02
Incorporated clipping and drawing logic
shai-almog Apr 1, 2026
a8aaf54
Additional fixes for the rendering code and updated status file
shai-almog Apr 1, 2026
b96f495
Started working on CI support and running the screenshot tests
shai-almog Apr 2, 2026
5110f0d
Fixed CI failure
shai-almog Apr 2, 2026
5f0f918
Fixed CI and got the intial bootstrap running
shai-almog Apr 2, 2026
7425f92
Fixed CSS build issue
shai-almog Apr 2, 2026
360da81
Removing TeaVM from build
shai-almog Apr 2, 2026
db6111b
Added bootstrap code
shai-almog Apr 2, 2026
3b224a0
Fixed initialization loop and some thread issues
shai-almog Apr 3, 2026
b847afa
Fixed additional CI pipeline failures
shai-almog Apr 3, 2026
27255f7
Fixed merge of String.format() change
shai-almog Apr 3, 2026
658c9bb
Added TeaVM stubs to get CI working with the new port
shai-almog Apr 3, 2026
8f402dc
Removed TeaVM dependency and replaced it with similar code
shai-almog Apr 3, 2026
cbf34ba
Cleaned up port and defined boundry with VM
shai-almog Apr 3, 2026
392975a
Added an initial JSBody implementation
shai-almog Apr 4, 2026
445ede9
Trying to native function calls
shai-almog Apr 4, 2026
a71c3eb
Fixed the Cn1ssDeviceRunner lambda bridge recursion
shai-almog Apr 4, 2026
418da37
Fixed JS tests so they run (albeit all fail)
shai-almog Apr 5, 2026
9126c3c
Fixed several blockers
shai-almog Apr 5, 2026
4a97abd
Screenshot test should now produce screenshots
shai-almog Apr 5, 2026
5d03146
Fixed another CI failure with array clone
shai-almog Apr 5, 2026
e5c20fa
Fixed invokespecial
shai-almog Apr 6, 2026
16ce63e
Trying to fix the broader CI regressions and JS Port
shai-almog Apr 6, 2026
060916a
Improved debug logging
shai-almog Apr 6, 2026
5cda061
Added some fixes for form issue
shai-almog Apr 6, 2026
05566bf
Fix bugs in ParparVMBootstrap.java: Remove duplicate call and align s…
shai-almog Apr 7, 2026
17e2f40
Fix JavaScript port pipeline: add initImpl shim, simplify bootstrap, …
Copilot Apr 7, 2026
1df3c77
Merge branch 'master' into javascript-port-initial-work
shai-almog Apr 7, 2026
b8a557b
Merge branch 'master' into javascript-port-initial-work
shai-almog Apr 9, 2026
00cb96c
Improved CI and started generating some screenshots that look close
shai-almog Apr 9, 2026
e64589e
Updated architecture to use workers
shai-almog Apr 9, 2026
da95bb3
Fixed current window issue
shai-almog Apr 9, 2026
b04abeb
Fixed bundle generation ordering issue
shai-almog Apr 9, 2026
2506c3c
Fixed compilation on newer JDKs and new native bindings
shai-almog Apr 9, 2026
5fb5575
Improved bridge so wrapped objects pass from the JS to Java code
shai-almog Apr 9, 2026
acd6641
Fixed the current startup blocker in the worker/main-thread bridge path
shai-almog Apr 10, 2026
0216f7c
Fixed build but still stuck with failing tests
shai-almog Apr 10, 2026
be78198
Fixed test cases
shai-almog Apr 10, 2026
ab3b789
Fixed cn1ss bug
shai-almog Apr 10, 2026
c52d886
Screenshot report pipeline no longer aborts immediately
shai-almog Apr 11, 2026
ac383a5
Added content-aware canvas capture
shai-almog Apr 11, 2026
f3d571b
Hardened screenshot decode pipeline
shai-almog Apr 11, 2026
1b52c50
Improved screenshot behavior
shai-almog Apr 11, 2026
12144ce
Fixed race condition in screenshot capture
shai-almog Apr 11, 2026
2382137
Added debugging to form show
shai-almog Apr 11, 2026
243ed9a
Merge branch 'master' into javascript-port-initial-work
shai-almog Apr 11, 2026
468f00b
Added draw-target aware screenshot capture in browser bridge.
shai-almog Apr 11, 2026
eef71e3
Fixed odd red and blue screenshot artifacts
shai-almog Apr 11, 2026
d95ba83
native rebinding now preserves overwritten translated JS method funct…
shai-almog Apr 11, 2026
0857312
Fixed screenshot-helper recursion regression (again)
shai-almog Apr 11, 2026
1a38cd0
One more chance...
shai-almog Apr 11, 2026
6d06b9a
Fix Worker-to-main-thread console forwarding for JavaScript pipeline …
Copilot Apr 13, 2026
c5c39cd
Fine tuned screenshot builds which still fail
shai-almog Apr 17, 2026
f663a75
Merge branch 'master' into javascript-port-initial-work
shai-almog Apr 17, 2026
981b955
Fixed white screenshot bug due to incorrect DUP implementation
shai-almog Apr 18, 2026
24ff876
Improved tests
shai-almog Apr 18, 2026
588251d
Added screenshot images to reduce the JS CI noise
shai-almog Apr 18, 2026
d56af76
Fixed additional test cases
shai-almog Apr 19, 2026
0bb4213
New build of the code with virtual method fix
shai-almog Apr 19, 2026
1f9b0e5
Fixed RGBImage Regression and added test timeout
shai-almog Apr 19, 2026
8617696
Cleaned up noise in the JS port
shai-almog Apr 19, 2026
591f555
Fix lambda synthesis stack corruption in ParparVM JavaScript translator
shai-almog Apr 19, 2026
946167f
Merge remote-tracking branch 'origin/master' into javascript-port-ini…
shai-almog Apr 19, 2026
c60f0e1
Reduce test-timeout from 30s to 10s to fit suite in browser lifetime
shai-almog Apr 19, 2026
a177091
Update STATUS.md with local verification of lambda + timeout fixes
shai-almog Apr 19, 2026
e5be94a
Unblock CI: Float64Array bindings, worker-safe document, SimpleDateFo…
shai-almog Apr 20, 2026
0d473b9
Guard null native transforms across HTML5Implementation
shai-almog Apr 20, 2026
3892a83
Clear drain region before executing ops in drainPendingDisplayFrame
shai-almog Apr 20, 2026
d645ec3
Update STATUS.md after rendering-correctness pass
shai-almog Apr 20, 2026
9258954
Make material-design-font.ttf reachable to HTML5Implementation resour…
shai-almog Apr 20, 2026
c9d5170
Make TrueType font loading actually work in the JS port
shai-almog Apr 21, 2026
e550988
Implement pushClip/popClip on the JS port
shai-almog Apr 21, 2026
6986eeb
Merge branch 'master' into javascript-port-initial-work
shai-almog Apr 21, 2026
e1a33b7
Skip OrientationLockScreenshotTest on the JS port
shai-almog Apr 21, 2026
42b6225
Update STATUS.md - orientation fix landed, rendering triage captured
shai-almog Apr 21, 2026
8056ac1
Extract JS port density+ppi math into testable helper, add unit tests
shai-almog Apr 21, 2026
68156f9
STATUS: record unit-test pass localizing huge-Switch bug away from pp…
shai-almog Apr 21, 2026
016b792
Add back-tracking unit test mapping 600px pill to density+mm combo
shai-almog Apr 21, 2026
2bbceb7
Add localized unit test for JavaScriptShapePathAdapter
shai-almog Apr 21, 2026
ca4794d
Add localized unit test for JavaScriptNativeImageAdapter
shai-almog Apr 21, 2026
b1d6acd
STATUS: record three-suite unit-test pass narrowing Switch/Sheet bugs
shai-almog Apr 21, 2026
9449526
Fix Double.parseDouble in JS port: parseDblImpl was ignoring the expo…
shai-almog Apr 21, 2026
a72daa7
STATUS: record parseDouble root-cause fix
shai-almog Apr 21, 2026
669f5ae
Add SheetIsolationScreenshotTest - narrows Sheet bg bug to paint pipe…
shai-almog Apr 21, 2026
0be039d
Merge remote-tracking branch 'origin/master' into javascript-port-ini…
shai-almog Apr 21, 2026
c515b96
JS port: shrink CI viewport to 375x667, fix getTransform bug
shai-almog Apr 21, 2026
e1acb95
JS port: fix isTablet misclassification at phone-sized viewports
shai-almog Apr 21, 2026
e994702
JS port: route JSAffineTransform through field access, not JSO methods
shai-almog Apr 22, 2026
dc3d1e3
Fix JDK 8 build: use Collections.singletonList in NativeImageAdapter …
shai-almog Apr 22, 2026
a23af43
JS port: fix string-escaping and jQuery HTML-injection security issues
shai-almog Apr 22, 2026
2a8f678
JS port: forward main-thread devicePixelRatio to the worker at boot
shai-almog Apr 22, 2026
30c5bae
JS port: load app theme.res from bundle root before falling back to a…
shai-almog Apr 22, 2026
ad73e89
JS port: drop leftover PortDiag gate from JavaScriptPrimitiveRenderAd…
shai-almog Apr 22, 2026
2c0be5e
JS port: resolve Style.convertUnit fallback lazily so margins/padding…
shai-almog Apr 22, 2026
7f7b9e0
JS port: drop bootstrap_placeholder emit and spinner investigation tests
shai-almog Apr 22, 2026
dfd7e47
JS port: await HTMLImageElement.decode() in cross-origin image factory
shai-almog Apr 22, 2026
f2f2b31
JS port: prep branch for initial merge — drop isolation tests, trim S…
shai-almog Apr 22, 2026
82057c7
JS port: remove investigation-era debug logging and revert test mutat…
shai-almog Apr 22, 2026
d38ae05
JS port: drop drawContentSafely wrapper from graphics screenshot tests
shai-almog Apr 22, 2026
2ea7d63
JS port: update screenshot baseline README to reflect current state
shai-almog Apr 22, 2026
1cd5fa7
JS port: enable CN1SS_FAIL_ON_MISMATCH in screenshot CI
shai-almog Apr 22, 2026
3c8783f
JS port: restore Ubuntu-sourced screenshot baselines
shai-almog Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .github/workflows/parparvm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
pull_request:
paths:
- 'vm/**'
- 'Ports/JavaScriptPort/**'
- '!vm/**/README.md'
- '!vm/**/readme.md'
- '!vm/**/docs/**'
push:
branches: [ master, main ]
paths:
- 'vm/**'
- 'Ports/JavaScriptPort/**'
- '!vm/**/README.md'
- '!vm/**/readme.md'
- '!vm/**/docs/**'
Expand Down Expand Up @@ -79,6 +81,11 @@ jobs:
java-version: '8'
cache: 'maven'

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Run ParparVM JVM tests
working-directory: vm
run: mvn -B clean package -pl JavaAPI -am -DskipTests && mvn -B test -pl tests -am -DexcludedGroups=benchmark
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2
- name: Set up Node
if: ${{ matrix.java-version == 8 }}
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run Unit Tests
run: |
MVN_ARGS=""
Expand Down Expand Up @@ -113,6 +118,10 @@ jobs:
- name: Run SpotBugs for ByteCodeTranslator
if: ${{ matrix.java-version == 8 }}
run: mvn -B -DskipTests=true -f vm/ByteCodeTranslator/pom.xml verify
- name: Run JavaScript Port smoke integration
if: ${{ matrix.java-version == 8 }}
working-directory: vm
run: mvn -B test -pl tests -am -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dtest=JavaScriptPortSmokeIntegrationTest
- name: Generate static analysis HTML summaries
if: ${{ always() && matrix.java-version == 8 }}
env:
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/scripts-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Test JavaScript screenshot scripts

on:
pull_request:
paths:
- '.github/workflows/scripts-javascript.yml'
- 'scripts/run-javascript-browser-tests.sh'
- 'scripts/run-javascript-screenshot-tests.sh'
- 'scripts/run-javascript-headless-browser.mjs'
- 'scripts/build-javascript-port-hellocodenameone.sh'
- 'scripts/javascript_browser_harness.py'
- 'scripts/javascript/screenshots/**'
- 'scripts/lib/cn1ss.sh'
- 'scripts/common/java/**'
- 'scripts/hellocodenameone/**'
- 'Ports/JavaScriptPort/**'
- 'vm/**'
- 'maven/**'
- '!maven/core-unittests/**'
- '!docs/**'
push:
branches: [ master ]
paths:
- '.github/workflows/scripts-javascript.yml'
- 'scripts/run-javascript-browser-tests.sh'
- 'scripts/run-javascript-screenshot-tests.sh'
- 'scripts/run-javascript-headless-browser.mjs'
- 'scripts/build-javascript-port-hellocodenameone.sh'
- 'scripts/javascript_browser_harness.py'
- 'scripts/javascript/screenshots/**'
- 'scripts/lib/cn1ss.sh'
- 'scripts/common/java/**'
- 'scripts/hellocodenameone/**'
- 'Ports/JavaScriptPort/**'
- 'vm/**'
- 'maven/**'
- '!maven/core-unittests/**'
- '!docs/**'

jobs:
javascript-screenshots:
permissions:
contents: read
pull-requests: write
issues: write
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }}
GH_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }}
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/javascript-ui-tests
CN1_JS_TIMEOUT_SECONDS: "180"
CN1_JS_BROWSER_LIFETIME_SECONDS: "150"
CN1SS_SKIP_COVERAGE: "1"
CN1SS_FAIL_ON_MISMATCH: "1"
BROWSER_CMD: "node \"$GITHUB_WORKSPACE/scripts/run-javascript-headless-browser.mjs\""
steps:
- uses: actions/checkout@v4

- name: Set up Java 8 for ParparVM
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: 'maven'

- name: Prepare Codename One binaries for Maven plugin
run: |
mkdir -p ~/.codenameone
cp maven/UpdateCodenameOne.jar ~/.codenameone/

- name: Build ParparVM compiler bundle
run: mvn -B -f maven/pom.xml -pl parparvm -am -DskipTests -Dmaven.javadoc.skip=true package

- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Playwright Chromium
run: |
cd scripts
npm init -y 2>/dev/null || true
npm install playwright
npx playwright install --with-deps chromium

- name: Install Xvfb for headless Java AWT
run: sudo apt-get update && sudo apt-get install -y xvfb

- name: Setup workspace
run: xvfb-run ./scripts/setup-workspace.sh -q -DskipTests

- name: Build HelloCodenameOne JavaScript port bundle
run: |
# Use JAVA_HOME set by actions/setup-java for Java 17
# (JAVA_HOME_17_X64 is always available after setup-java@v4)
export JAVA_HOME="${JAVA_HOME_17_X64}"
export PATH="$JAVA_HOME/bin:$PATH"
echo "Using JAVA_HOME=$JAVA_HOME"
java -version

# xvfb-run is required for CSS compilation which uses java.awt
SKIP_PARPARVM_BUILD=1 xvfb-run ./scripts/build-javascript-port-hellocodenameone.sh "${GITHUB_WORKSPACE}/artifacts/javascript-ui-tests/hellocodenameone-javascript-port.zip"

- name: Locate JavaScript bundle
id: locate_bundle
run: |
set -euo pipefail
bundle="$(ls -1 \
artifacts/javascript-ui-tests/hellocodenameone-javascript-port.zip \
scripts/hellocodenameone/parparvm/target/hellocodenameone-javascript-port.zip \
2>/dev/null | head -n1 || true)"
if [ -z "$bundle" ]; then
echo "Unable to locate HelloCodenameOne JavaScript-port bundle" >&2
exit 1
fi
echo "bundle=$bundle" >> "$GITHUB_OUTPUT"

- name: Run JavaScript screenshot browser tests
run: |
mkdir -p "${ARTIFACTS_DIR}"
./scripts/run-javascript-browser-tests.sh "${{ steps.locate_bundle.outputs.bundle }}" "${GITHUB_WORKSPACE}/scripts/javascript/screenshots"

- name: Upload JavaScript screenshot artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: javascript-ui-tests
path: artifacts/javascript-ui-tests
if-no-files-found: warn
retention-days: 14
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ dependency-reduced-pom.xml
/docs/website/.venv-video-refresh/
/docs/website/.youtube-oauth-token.json
/docs/website/client_secret.json
/.playwright-cli
package-lock.json
package.json
1 change: 0 additions & 1 deletion CodenameOne/src/com/codename1/ui/Graphics.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
/// using either a paint callback or a mutable image. There is no supported way to create this
/// object directly.
public final class Graphics {

/// Rendering hint to indicate that the context should prefer to render
/// primitives in a quick way, at the cost of quality, if there is an
/// expensive operation.
Expand Down
6 changes: 6 additions & 0 deletions Ports/JavaScriptPort/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
JavaScriptPort and its dedicated fixtures are licensed under the PolyForm Noncommercial License 1.0.0.

Official license text:
[https://polyformproject.org/licenses/noncommercial/1.0.0/](https://polyformproject.org/licenses/noncommercial/1.0.0/)

This license boundary applies to files inside `Ports/JavaScriptPort/**` unless a file states otherwise.
5 changes: 5 additions & 0 deletions Ports/JavaScriptPort/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Licensed under the PolyForm Noncommercial License 1.0.0 -->

This subtree is intentionally licensed separately from the parent Codename One repository.

Files in `Ports/JavaScriptPort/**` are licensed under PolyForm Noncommercial 1.0.0 and must not inherit the parent repository's standard source-file license headers.
14 changes: 14 additions & 0 deletions Ports/JavaScriptPort/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Licensed under the PolyForm Noncommercial License 1.0.0 -->

JavaScriptPort is the browser-runtime work area for the new Codename One JavaScript port.

Scope of this bootstrap:
- imported HTML5/runtime code from the existing proprietary browser port as the behavioral/source baseline
- PolyForm-licensed port boundary under `Ports/JavaScriptPort/**`
- ParparVM-oriented smoke fixtures under `Ports/JavaScriptPort/tests/**`
- executable translator/runtime coverage through the local ParparVM test suite in `vm/tests`

License boundary:
- `Ports/JavaScriptPort/**` is licensed under PolyForm Noncommercial 1.0.0
- dedicated smoke fixtures under `Ports/JavaScriptPort/tests/**` use the same license boundary
- the rest of the repository remains under its existing licensing
75 changes: 75 additions & 0 deletions Ports/JavaScriptPort/STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-- Licensed under the PolyForm Noncommercial License 1.0.0 -->

JavaScript Port Status (ParparVM)
=================================

The JavaScript port compiles Java bytecode to JavaScript via ParparVM
(`vm/ByteCodeTranslator/`) and runs the app in a Web Worker against a host
bridge on the main thread for DOM / Canvas access.

Build
-----

```
mvn -B -f maven/pom.xml -pl parparvm -am -DskipTests package
SKIP_PARPARVM_BUILD=1 ./scripts/build-javascript-port-hellocodenameone.sh \
/tmp/hellocodenameone-js.zip
```

Test
----

```
ARTIFACTS_DIR=/tmp/js-verify \
CN1_JS_TIMEOUT_SECONDS=300 CN1_JS_BROWSER_LIFETIME_SECONDS=280 \
BROWSER_CMD='node scripts/run-javascript-headless-browser.mjs' \
./scripts/run-javascript-browser-tests.sh /tmp/hellocodenameone-js.zip \
scripts/javascript/screenshots
```

CI runs at 375×667 viewport with Playwright `deviceScaleFactor: 2` so the
density picker lands on `DENSITY_VERY_HIGH` and screenshots come out 750×1334
— phone-proportional to the iOS/Android baselines in `scripts/ios/screenshots`
and `scripts/android/screenshots`.

Screenshot baselines
--------------------

`scripts/javascript/screenshots/` holds the curated JS-port PNGs. They are
platform-specific (iOS/Android references use the native themes and physical
device DPIs; the JS port rasterises through `iOS7Theme.res` at headless
Chromium). Regenerate via a full-suite run — artifacts under
`$ARTIFACTS_DIR/*.png`.

Known limitations
-----------------

- `graphics-transform-perspective.png` and `graphics-transform-camera.png`
render blank — perspective / 3D transforms aren't implemented in the JS
impl (`Transform.isPerspectiveSupported()` returns false). Matches iOS/Android
behaviour on older devices that also skip these paths.
- `BrowserComponentScreenshotTest`, `MediaPlaybackScreenshotTest`,
`BytecodeTranslatorRegressionTest`, `BackgroundThreadUiAccessTest`,
`VPNDetectionAPITest`, `CallDetectionAPITest`,
`LocalNotificationOverrideTest`, `Base64NativePerformanceTest`, and
`AccessibilityTest` are intentionally time-limited in HTML5 mode via
`Cn1ssDeviceRunner.shouldForceTimeoutInHtml5`; their expected output is the
placeholder / spinner frame.
- `OrientationLockScreenshotTest` is the last test in the suite because it
mutates orientation state that other tests don't reset.

Entry points
------------

- `Ports/JavaScriptPort/src/main/java/com/codename1/impl/html5/HTML5Implementation.java`
— CN1 `CodenameOneImplementation` subclass.
- `Ports/JavaScriptPort/src/main/webapp/port.js` — host-side bindings and
`bindCiFallback` shims.
- `vm/ByteCodeTranslator/src/javascript/browser_bridge.js` — main-thread
host bridge handlers.
- `vm/ByteCodeTranslator/src/javascript/worker.js` /
`vm/ByteCodeTranslator/src/javascript/parparvm_runtime.js` — worker-side VM.

See `scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java`
for the suite contents and
`scripts/run-javascript-headless-browser.mjs` for the Playwright harness.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2026 Codename One and contributors.
* Licensed under the PolyForm Noncommercial License 1.0.0.
*/
package com.codename1.html5.interop;

/**
* Callback interface for async operations.
* This is a replacement for TeaVM's AsyncCallback.
*/
public interface AsyncCallback<T> {
void complete(T result);
void error(Throwable e);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2026 Codename One and contributors.
* Licensed under the PolyForm Noncommercial License 1.0.0.
*/
package com.codename1.html5.interop;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to suppress synchronization errors.
* This is a no-op stub for ParparVM builds.
* TeaVM uses this for its async/sync transformation.
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface SuppressSyncErrors {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2026 Codename One and contributors.
* Licensed under the PolyForm Noncommercial License 1.0.0.
*/
package com.codename1.html5.js;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marks a method as implemented by inline JavaScript.
* For ParparVM, the script is executed via native binding mechanism.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface JSBody {
String[] params() default {};
String script() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2026 Codename One and contributors.
* Licensed under the PolyForm Noncommercial License 1.0.0.
*/
package com.codename1.html5.js;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marks an interface as a JavaScript function type.
* Used for callback interfaces that wrap JavaScript functions.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface JSFunctor {
}
Loading
Loading