Skip to content

Migrate playground from CheerpJ to TeaVM#1

Merged
CommanderTvis merged 1 commit into
masterfrom
teavm
May 25, 2026
Merged

Migrate playground from CheerpJ to TeaVM#1
CommanderTvis merged 1 commit into
masterfrom
teavm

Conversation

@CommanderTvis

Copy link
Copy Markdown
Member

Summary

  • Drop CheerpJ; compile the rell3 bridge to JS ahead-of-time with TeaVM 0.12.0
  • Replace Bun with com.github.node-gradle.node + pnpm 10.20.0 + Vite 8 (Monaco loads via ?worker query imports)
  • Switch the Rell coordinate to 0.16.0-SNAPSHOT (resolved from the official GitLab Maven repo)
  • Add a TeaVM ClassHolderTransformer plugin (MissingMethodInjector) that grafts ~140 missing JDK methods/fields onto teavm-classlib classes, replaces JVM-only method bodies (e.g. Rt_RellVersion.getBuildProperties) with silent stubs at compile time, and wires an SLF4J no-op shim through the T-prefix renamer
  • Add a Vitest-based "Rell survival kit" (39 tests) under :web:vitestRun that loads the TeaVM bridge JS and exercises arithmetic, strings, control flow, functions, collections, structs/enums, nullables, stdlib, error surfaces, and REPL session continuity
  • Fix REPL init flake: retry ReplInterpreter.create() up to three times in both ReplSession and ModuleSession (the first JVM-in-JS touch of jOOQ/Jackson/kotlin-reflect static-init throws non-deterministically per worker) and surface the captured channel events instead of an opaque repl:not_ready

Test plan

  • ./gradlew :bridge:generateJavaScript :bridge:copyTeavmToWeb produces web/public/teavm/rell-playground-bridge.js
  • ./gradlew :web:vitestRun — 39/39 green against the GitLab snapshot
  • ./gradlew :web:viteDev and click Run in Chrome — verify first-click no longer hits repl:not_ready and that print(...) round-trips

🤖 Generated with Claude Code

@CommanderTvis
CommanderTvis force-pushed the teavm branch 2 times, most recently from b0df8f0 to 4ed3fc9 Compare May 24, 2026 23:44
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CommanderTvis
CommanderTvis merged commit a7fcfc3 into master May 25, 2026
3 checks passed
@CommanderTvis
CommanderTvis deleted the teavm branch May 25, 2026 01:12
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