Migration Guide: Three.js 0.182.0 → 0.183.2
Date: March 10, 2026Commit: 8b93772 This guide covers breaking changes and migration steps for upgrading from Three.js 0.182.0 to 0.183.2.
Overview
Hyperscape upgraded to Three.js 0.183.2 to gain access to the latest WebGPU features, performance improvements, and bug fixes. This upgrade includes one breaking change in the TSL (Three Shading Language) API.Breaking Changes
1. TSL API: atan2 renamed to atan
Change: The atan2 function in TSL exports has been renamed to atan to match GLSL/WGSL conventions.
Migration:
packages/shared/src/materials/LeafMaterialTSL.ts- Updatedatan2→atan
atan2, you must update them to use atan instead.
2. TSL Type Aliases
Change: Added typed node aliases for better TypeScript support in TSL shaders. New Exports (added topackages/shared/src/extras/three/three.ts):
3. InstancedBufferAttribute Type Cast
Change: Fixed type compatibility forInstancedBufferAttribute in HealthBars system.
Migration:
packages/shared/src/systems/client/HealthBars.ts- Added type cast for instancedBufferAttribute
InstancedBufferAttribute with Three.js geometry. Add type cast if you encounter type errors.
Package Updates
All packages have been updated to use Three.js 0.183.2:packages/shared/package.jsonpackages/client/package.jsonpackages/asset-forge/package.jsonpackages/impostors/package.jsonpackages/procgen/package.json- Root
package.json(overrides)
Benefits of Upgrade
Performance Improvements
- Faster WebGPU shader compilation
- Improved memory management for large scenes
- Better GPU resource utilization
WebGPU Enhancements
- More stable WebGPU device handling
- Better error messages for GPU issues
- Improved compatibility with latest GPU drivers
TSL Improvements
- Better TSL shader compilation
- More consistent GLSL/WGSL naming conventions
- Improved type safety for shader nodes
Bug Fixes
- Fixed various WebGPU rendering artifacts
- Improved texture handling
- Better geometry attribute management
Testing Your Migration
After upgrading, verify your custom shaders and materials:-
Check for
atan2usage: -
Run the test suite:
-
Visual verification:
- Start the game:
bun run dev - Check that all materials render correctly
- Verify post-processing effects (bloom, tone mapping) work
- Test in both development and production builds
- Start the game:
-
Check for TypeScript errors:
Rollback Instructions
If you need to rollback to Three.js 0.182.0:-
Update package.json files:
-
Revert TSL changes:
-
Reinstall dependencies:
Additional Resources
- Three.js 0.183.0 Release Notes
- Three.js 0.183.1 Release Notes
- Three.js 0.183.2 Release Notes
- Three.js TSL Documentation
- CLAUDE.md - Development guide with recent changes
- AGENTS.md - AI assistant instructions with changelog
Support
If you encounter issues with the upgrade:- Check the Troubleshooting section above
- Review the Three.js GitHub Issues
- Check Hyperscape Discord for community support
- File an issue in the Hyperscape repository