Add local ParparVM-backed JavaScript builder gated to Enterprise tier#5050
Merged
Conversation
JavaScriptBuilder mirrors the IPhoneBuilder/AndroidGradleBuilder pattern for the new ParparVM-based JS port, replacing the ad-hoc build script. Gated at the Enterprise user-level threshold (rank >= 12000) via the javascript.userLevel build hint or the CN1_USER_LEVEL env var; lower or unknown tiers see a clear licensing error before any work runs. CN1BuildMojo dispatches local-javascript builds to the new builder and explicitly bundles codenameone-core/java-runtime into the staged jar since their provided scope is non-transitive on child modules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…DEFAULT_ENCODING) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 116 screenshots: 116 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 47 screenshots: 47 matched. |
Collaborator
Author
|
Compared 116 screenshots: 116 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
buildTarget is a @parameter(required = true), so the defensive `buildTarget != null` in the local-JS check was misleading SpotBugs into flagging the existing isLocalBuildTarget(buildTarget) call as a potential null dereference. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
Picker.startEditingAsync() never returns control on the JS port — the lightweight popup never settles into the findButtonByText scan state the cancel/done scenario expects, so the inner UITimer callbacks never fire fail()/done() and the JS screenshot suite hangs for the full browser-lifetime budget (TOP_BLOCKER=unknown|none|none) on this single test. The suite-level skip in Cn1ssDeviceRunner.shouldForceTimeoutInHtml5 doesn't catch this because it sees an unexpected platform name on the JS port. CN.getPlatformName() reliably reports "HTML5" here, so self-skip from runTest() and call done() to advance the suite. Re-applies the fix from e0cd604 that was reverted in e3dd0c9 alongside unrelated diag cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
JavaScriptBuilder(inmaven/codenameone-maven-plugin/src/main/java/com/codename1/builders/) mirrorsIPhoneBuilder/AndroidGradleBuilder. It stages cn1-core + java-runtime + the user app, layersparparvm-java-api.jaron top to override stalejava.*/com.codename1.impl.*stubs, compilesPorts/JavaScriptPort/src/main/java, generates aParparVMBootstrap-based launcher, and runs ParparVM'sByteCodeTranslator javascript. Output is a zip containingworker.js/port.js/browser_bridge.js/index.html, attached as the project'swebappclassifier.javascript.userLevelbuild hint incodenameone_settings.properties, thecodename1.userLevelsystem property, and theCN1_USER_LEVELenv var. Accepts numeric ranks or symbolic tier names (trial/free/pro/enterprise/midsizeenterprise/bigcorp). Anything belowenterprise(rank 12000, matching the BuildDaemon scheme) prints a clear licensing error pointing to https://www.codenameone.com/pricing.html and returns false.CN1BuildMojo.doJavaScriptLocalBuilddispatches the newlocal-javascriptbuild target. Provided-scope deps aren't transitive, so child modules that only depend on acommonlibrary don't seecodenameone-core/java-runtimeon their compile classpath — for local-JS builds the mojo now explicitly bundles those into the staged jar so ParparVM's translator sees every referenced class.mvn cn1:build -Dcodename1.platform=javascript -Dcodename1.buildTarget=local-javascript.Test plan
local-dev-javaseprofile (mvn -pl codenameone-maven-plugin -Plocal-dev-javase install)local-javascriptbuild with no user level → printsERROR: The local JavaScript build is licensed only to Enterprise and higher tier users...and exits non-zeroCN1_USER_LEVEL=Pro→ same enterprise-required error, builder log showsuser-level=Pro (rank=11000, required>=12000)CN1_USER_LEVEL=Enterprise→ full end-to-end build onscripts/hellocodenameone/javascript, produceshellocodenameone-javascript-1.0-SNAPSHOT.zip(~7.9 MB) withHelloCodenameOne-js/{worker.js,port.js,browser_bridge.js,index.html,sw.js}and all theme/assets — 10:18 wall timebuild-javascript-port-hellocodenameone.shflow)🤖 Generated with Claude Code