Add EVE (shared atom) and DOM proxy support to cljs-thread#4
Open
Add EVE (shared atom) and DOM proxy support to cljs-thread#4
Conversation
… dep Restructure this branch to use eve as an external dependency rather than a bundled eve/ subdir. The eve library now lives at SeniorCareMarket-com/eve. Changes: - deps.edn: eve/eve now a git dep (SeniorCareMarket-com/eve sha 237a6eba) - package.json: remove native addon build infra; add eve-native npm git dep; remove node-gyp-build/prebuildify/node-addon-api; remove gypfile - Remove binding.gyp (native addon is in the eve dep, not here) - Remove build.clj, cljdoc.edn (belong to the eve library) - Remove bench/ (eve benchmark data, not cljs-thread) - Remove private scripts (ccweb-setup.sh, etc.) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When eve became an external git dep, its test namespaces (eve.deftype-test, eve.map-test, etc.) are no longer on the classpath. Add the gitlibs-resolved test path to :node-test extra-paths so the thread-test runner can find them. All 317 tests pass with 31,062 assertions, 0 failures. https://claude.ai/code/session_018fBeDxZWXp5XkrsXLaa5Xf
- Remove hardcoded /root/.gitlibs paths from deps.edn aliases - Remove :main-opts from :thread-test alias (eve.test-runner is in eve repo) - Fix core.cljs require: cljs-thread.eve.shared-atom → eve.shared-atom - Strip eve repo test namespaces from thread-test-main.cljs runner, keeping only slab-tier tests that don't need the fat kernel (worker-tier tests need the discovery runner: clj -M:thread-test) node-test: 13 tests, 113 assertions, 0 failures thread-test: 5 tests, 11 assertions, 0 failures https://claude.ai/code/session_018fBeDxZWXp5XkrsXLaa5Xf
The test runner (eve.test-runner) was generic infrastructure that happened to live in the eve repo. Port it to cljs-thread.test-runner so cljs-thread can run its own tests via: clj -M:thread-test # all tests clj -M:thread-test :tier pure :node # pure tier via node clj -M:thread-test :dry-run # show test plan clj -M:thread-test :list # list discovered namespaces Discovers 23 test namespaces (6 pure, 17 worker). Pure tier: 17 tests, 127 assertions, 0 failures. https://claude.ai/code/session_018fBeDxZWXp5XkrsXLaa5Xf
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.
This PR introduces two major features to
cljs-thread:Summary
Adds EVE — a SharedArrayBuffer-backed atom system for lock-free inter-thread state sharing — and a DOM proxy layer that enables transparent DOM access from worker threads. Also includes comprehensive documentation, test infrastructure, and example applications (ray tracer and Reagami counter).
Key Changes
EVE (Shared Atoms)
src/cljs_thread/eve.cljs— Public API for creating and managing SharedArrayBuffer-backed atomssrc/cljs_thread/eve.clj— Compile-time macro support for EVE operationsresources/wasm/wasm_mem.wat,resources/wasm_slab/slab_bitmap.wat) — Low-level memory operations and slab bitmap allocation with SIMD accelerationDOM Proxy System
src/cljs_thread/dom/proxy.cljs— ES6 Proxy factory for transparent DOM access from workerssrc/cljs_thread/dom/registry.cljs— Screen-side handle registry mapping DOM objects to integer identifierssrc/cljs_thread/dom/events.cljs— Event listener forwarding between worker and screen threadssrc/cljs_thread/dom/install.cljs— Worker-side proxy installationsrc/cljs_thread/dom.cljs— Public API for DOM operations from workersinmacro, with event callbacks staying on the worker threadGo Blocks & Async Support
src/cljs_thread/go.cljandsrc/cljs_thread/go.cljs— Compile-time CPS transform for implicit go blocks@expr(deref) into parking continuations instead of blockingTesting Infrastructure
src/cljs_thread/test.cljand related modules — Unified test runner with auto-discoverytest/cljs_thread/*_test.cljs— Comprehensive test suite covering atoms, DOM proxy, async primitives, and integration scenariostest/e2e/*.spec.js) — Playwright-based browser automation testsExample Applications
ex/raytracer/) — Tile-based ray tracing usingpmapwith shared atom resultsex/reagami_counter/) — Reactive counter demonstrating shared atom updates across threadsDocumentation
doc/01-getting-started.mdthroughdoc/23-internals.md— Complete user and contributor guidesCLAUDE.md— Internal development notesCONTRIBUTING.md— Contribution guidelinesCHANGELOG.md— Version historyCore Library Updates
src/cljs_thread/core.cljs— Addedatomexport andon-whenmacro supportsrc/cljs_thread/in.cljs— Enhanced with EVE integration and improved serializationsrc/cljs_thread/macro_impl.clj— Extended macro infrastructuresrc/cljs_thread/future.cljand.cljs— Improved async handlingREADME.md— Updated to reflect new features ("Two steps closer to threads on the web")Build & Configuration
shadow-cljs.edn— Test runner configuration with auto-generated discoverydeps.edn— Updated dependencies and test aliasespackage.json— NPM configuration for E2E testing.clj-kondo/config.edn— Linter rules for new macrosNotable Implementation Details
https://claude.ai/code/session_018fBeDxZWXp5XkrsXLaa5Xf