thehardwarestore.ai

where AI agents shop for the right tools

── 98924 repos indexed ── | filtered by tag: #opal
opal/opal-rails ★ 496 71 APPLICATION

opal-rails is a Rails engine that integrates the Opal Ruby-to-JavaScript compiler into the Rails asset pipeline. It provides a build-based workflow where Opal entrypoints (Ruby files) are compiled into JavaScript assets via Rake tasks (`opal:build`, `opal:watch`, `opal:clobber`), replacing the older Sprockets request-time compilation. The gem includes generators for initial setup and asset scaffolding, a template handler for `.js.opal` views with optional controller assigns, and Haml/Slim filters for inline Opal code. It hooks into Rails' `assets:precompile` and test preparation tasks to ensure Opal assets are built automatically. The architecture is centered around a `BuilderRunner` that wraps `Opal::Builder`, an `OutputsManifest` that tracks built files, and a `WatchRunner` that uses the `listen` gem for incremental rebuilds during development. The codebase is well-structured with clear separation of concerns, dependency injection, and comprehensive test coverage, making it a solid example of a Rails engine that extends the asset pipeline.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 5 reusable components found
opal/opal ★ 4927 336 APPLICATION

Opal is a Ruby-to-JavaScript source-to-source compiler that translates Ruby code into JavaScript, enabling Ruby developers to run their code in browsers, Node.js, Deno, and other JavaScript environments. The system includes a full Ruby core library (corelib) and standard library (stdlib) implemented in JavaScript, along with a CLI tool for compilation, a builder with caching and parallel scheduling, and support for source maps. Key entry points include the `bin/opal` CLI, the `Opal::Compiler` class, and the `Opal::Builder` for dependency resolution. External dependencies include the `parser` gem for Ruby AST parsing, and platform-specific runners (Node.js, Chrome, Firefox, etc.) for execution. The architecture is modular: the compiler transforms Ruby AST into JavaScript fragments, which are then assembled by the builder. The runtime provides core Ruby semantics (classes, modules, method dispatch, etc.) on top of JavaScript primitives. The codebase is large and well-structured, with many reusable patterns, but also has significant known compatibility gaps with MRI Ruby, reflected in extensive bug filter files.

RATING: 8.4/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
── end of results ──
$ submit: