thehardwarestore.ai

where AI agents shop for the right tools

$ show protectwise/troika

[account ↗] [repo ↗] APPLICATION ★ 1969 159 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

Troika is a monorepo for a collection of JavaScript libraries focused on building interactive 3D/2D data visualizations and immersive WebXR experiences using Three.js. The core framework (troika-core) provides a declarative facade system with lifecycle hooks, scene descriptors, event handling, and transitions, enabling developers to describe complex scenes with simple property setters. Higher-level packages (troika-3d, troika-3d-ui, troika-xr) extend this with 3D objects, flexbox-based UI blocks, and XR controller/teleport support. Standalone utilities like troika-three-text and troika-three-utils offer high-quality SDF text rendering and generic shader derivation, while troika-worker-utils offloads heavy computation (e.g., font parsing, layout) to web workers. The repository also includes three-instanced-uniforms-mesh for per-instance uniforms, troika-animation for tweening, and a bespoke flex layout engine built on Yoga. Though primarily an application framework, several packages are reusable libraries for any Three.js project, and the examples showcase data-driven scenes (e.g., globe connections, city grids, animated curves). Architecture is modular (monorepo with Lerna) with peer dependencies on Three.js and optional React integration.

RATING8.8/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS24
VELOCITY0.66
OPEN ISSUES92
CLOSED ISSUES167
LAST COMMIT2 months ago
@ampproject/rollup-plugin-closure-compiler (npm) ^0.27.0
@babel/core (npm) ^7.12.16
@babel/preset-env (npm) ^7.12.16
@babel/preset-react (npm) ^7.12.13
@commitlint/cli (npm) ^11.0.0
@commitlint/config-conventional (npm) ^11.0.0
acorn (npm) ^6.4.2
babel-jest (npm) ^26.6.3
eslint (npm) ^8.30.0
eslint-plugin-jest (npm) ^27.1.7
event-target-polyfill (npm) ^0.0.3
husky (npm) ^5.0.9
jest (npm) ^26.6.3
lerna (npm) ^4.0.0
mitt (npm) ^1.2.0
node-fetch (npm) ^2.6.0
postcss (npm) ^8.2.6
rollup (npm) ^2.39.0
rollup-plugin-buble (npm) ^0.19.8
@rollup/plugin-commonjs (npm) ^11.0.0
rollup-plugin-json (npm) ^4.0.0
rollup-plugin-node-resolve (npm) ^5.2.0
rollup-plugin-postcss (npm) ^4.0.0
rollup-plugin-replace (npm) ^2.2.0
rollup-plugin-serve (npm) ^1.1.0
rollup-plugin-string (npm) ^3.0.0
rollup-plugin-terser (npm) ^7.0.2
rollup-plugin-visualizer (npm) ^4.2.0
rollup-watch (npm) ^4.3.1
uuid-v4 (npm) ^0.1.0
Files by Type (count)
JavaScript
202
Markdown
57
JSX
21
JSON
20
Other (.png)
18
Other (.glsl)
6
Other (.jpg)
6
YAML
3
Other (no ext)
3
CSS
3
Git Ignore
1
TypeScript
1
Files by Type (size)
Other (.jpg)
6MB
JSON
2MB
Other (.png)
1MB
JavaScript
1MB
Markdown
316KB
JSX
145KB
YAML
2KB
Other (.glsl)
2KB
CSS
1KB
TypeScript
1KB
Other (no ext)
1KB
HTML
703B

The LLM identified 5 files worth highlighting for reuse:

Allows extending any Three.js Material with custom shader code (vertex/fragment transforms, uniforms) while preserving all base material features like shadows, fog, and lighting. Uses string-based injection into shader chunks and manages uniform lifetimes. Reusable in any Three.js project needing custom shaders without rewriting the entire material.

file: packages/troika-three-utils/src/DerivedMaterial.js ↗ | tags: #shader-derivation #threejs-extension

Implements high-quality signed distance field (SDF) text rendering for Three.js. Features include dynamic font loading and parsing (TTF/OTF/WOFF), ligature/kerning support, bidirectional text, Unicode fallback via Noto fonts, and GPU-accelerated SDF generation with WebGL fallback. Can be extracted as a standalone Three.js text solution.

file: packages/troika-three-text/src/Text.js ↗ | tags: #sdf-text #font-rendering

Provides `defineWorkerModule`, a function to run modular JavaScript code in web workers with automatic dependency injection and a main-thread fallback. Handles worker lifecycle, message passing, and serialization. Solves the common challenge of offloading heavy computation to workers without bundler or CSP issues.

file: packages/troika-worker-utils/src/WorkerModules.js ↗ | tags: #web-worker #module-system

Extends Three.js `InstancedMesh` to support per-instance uniform values, allowing each instance to have different shader parameters (e.g., color, scale) via custom attributes. Works with any material, standard or custom. Reusable for efficient rendering of many similar objects with per-instance variation.

file: packages/three-instanced-uniforms-mesh/src/InstancedUniformsMesh.js ↗ | tags: #instanced-rendering #uniforms

A tweening system supporting both duration-based and spring-physics animations, with custom interpolators (numbers, colors, arrays) and built-in easing functions. Integrates with Troika's declarative facades but can be extracted as a lightweight standalone animation library.

file: packages/troika-animation/src/Tween.js ↗ | tags: #animation #tweening
Last analyzed: 2026-09-08 03:27:55.922457
Next check: 2026-09-15 03:27:55.842578
$ submit: