Replace Rhino JS engine with QuickJS4J (WebAssembly-based)#1512
Draft
andreaTP wants to merge 1 commit into
Draft
Replace Rhino JS engine with QuickJS4J (WebAssembly-based)#1512andreaTP wants to merge 1 commit into
andreaTP wants to merge 1 commit into
Conversation
Replace Mozilla Rhino with QuickJS4J (QuickJS compiled to WebAssembly via Chicory), providing a naturally sandboxed JS execution environment without the need for custom AST validation or sandbox wrappers. Key changes: - Add quickjs4j dependencies and annotation processor - Remove Rhino dependency and all sandbox infrastructure (SandboxContextFactory, SandboxWrapFactory, SandboxNativeJavaObject/List/Map, ScriptValidation, JSNodeVisitor, JSSymbol, JSErrorReporter, JSON) - Create annotated @builtins API classes (SimpleHttpClientApi, ExtensionUtilsApi, LogApi, ConsoleApi, ExtensionLoggerApi, InternalApi) for type-safe host bindings - Rewrite ScriptingExecutionService to use Engine/Runner with generated Builtins - Switch serialization from GSON to Jackson (Json.OBJECT_MAPPER) throughout - Add JS_PRELUDE shims for backward compatibility (HashMap, GSON, variadic wrappers for console/log/ExtensionUtils.format/computeHMAC) - Rewrite bundled mailchimp.js and sample.js for pure JS compatibility (no Java.type, no method calls on serialized objects) - Fix test scripts for QuickJS strict mode (var declarations, JSON.parse) All 815 tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1512 +/- ##
============================================
- Coverage 58.23% 58.13% -0.10%
+ Complexity 4579 4542 -37
============================================
Files 598 592 -6
Lines 23741 23630 -111
Branches 2122 2092 -30
============================================
- Hits 13825 13738 -87
+ Misses 8622 8602 -20
+ Partials 1294 1290 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Replace Mozilla Rhino with QuickJS4J (QuickJS compiled to WebAssembly via Chicory), providing a naturally sandboxed JS execution environment without the need for custom AST validation or sandbox wrappers.
Key changes:
All 815 tests pass.