Title
Request: Browser-compatible bundle for Java/GraalVM integration
Description
I'm working on a Java wrapper for the AsyncAPI parser using GraalVM's JavaScript engine. The current @asyncapi/parser package (v3.6.0) cannot be bundled for use in GraalVM because it depends on Node.js-specific APIs (fetch, Headers, etc.) that aren't available in GraalVM's JavaScript environment.
Current Situation
- The old bundle-es5.js only supports AsyncAPI 2.4.0
- The new @asyncapi/parser v3.x requires fetch API and browser globals
- When bundled with webpack, it fails with:
TypeError: Cannot set property 'Headers' of undefined
Request
Could you provide or help create a browser-compatible bundle that:
- Supports both AsyncAPI v2.x and v3.x
- Works in environments without fetch API (or includes polyfills)
- Can run in GraalVM's JavaScript engine
- Doesn't depend on Node.js-specific modules
Use Case
Java applications that need to parse AsyncAPI documents without spawning Node.js processes or using native V8 bindings (which don't support macOS ARM).
Alternative Solutions Considered
- Using Playwright/Puppeteer (too heavy)
- Using J2V8 (no macOS ARM support)
- Creating custom bundle with webpack (fails due to fetch dependency)
Environment
- GraalVM JS engine via javax.script
- Target: Java 11+
- Platform: macOS ARM, Linux, Windows
Would appreciate guidance on:
- How to properly bundle the parser for non-browser/non-Node environments
- If there's an existing standalone bundle
- If this use case is supported
Title
Request: Browser-compatible bundle for Java/GraalVM integration
Description
I'm working on a Java wrapper for the AsyncAPI parser using GraalVM's JavaScript engine. The current @asyncapi/parser package (v3.6.0) cannot be bundled for use in GraalVM because it depends on Node.js-specific APIs (fetch, Headers, etc.) that aren't available in GraalVM's JavaScript environment.
Current Situation
TypeError: Cannot set property 'Headers' of undefinedRequest
Could you provide or help create a browser-compatible bundle that:
Use Case
Java applications that need to parse AsyncAPI documents without spawning Node.js processes or using native V8 bindings (which don't support macOS ARM).
Alternative Solutions Considered
Environment
Would appreciate guidance on: