This document summarizes the complete modernization of Pedalboard.js from a 10+ year old Google Closure-based library to a modern TypeScript/React library.
- ✅ From Google Closure Library → Modern TypeScript
- ✅ From tartJS → Native ES6+ classes
- ✅ From Shell build scripts → Vite + NPM scripts
- ✅ From custom DOM manipulation → React components
- ✅ From Closure Compiler → TypeScript compiler + Vite bundler
- Heavy dependency on deprecated libraries (Google Closure, tartJS)
- Namespace-based organization (pb.*)
- Prototype-based inheritance
- Manual DOM manipulation
- Shell script build process
src/
├── core/ # Core classes (Stage, Board, Connectable)
├── pedals/ # Pedal implementations
│ ├── overdrive/
│ ├── delay/
│ ├── reverb/
│ ├── volume/
│ └── cabinet/
├── controls/ # UI controls (Pots, Switches, LEDs)
├── io/ # Input/Output handling
├── components/ # React UI components
├── types/ # TypeScript type definitions
└── utils/ # Utility classes
- Full type safety
- IntelliSense support
- Better developer experience
- Compile-time error checking
<PedalBoard>- Visual pedal board<Pedal>- Individual pedal UI<Knob>- Rotary controls<FootSwitch>- Toggle/momentary switches<LED>- Status indicators<AudioControls>- Input/output management
- Vite for fast development
- Hot Module Replacement (HMR)
- Optimized production builds
- Tree shaking
- Code splitting
- Promise-based async operations
- Better error handling
- Stream input improvements
- Master volume/compression
- Preset system
pb.stomp.Overdrive = function(context) {
goog.base(this, context);
};
goog.inherits(pb.stomp.Overdrive, pb.stomp.Box);
pb.stomp.Overdrive.prototype.setDrive = function(newValue) {
this.drivePot.setValue(newValue);
};export class Overdrive extends Box {
readonly name = 'overdrive';
setDrive(value: number): void {
this.drivePot.setActualValue(value);
}
}- NPM package ready (
@pedalboard/core) - Proper semantic versioning
- Tree-shakeable exports
- ESM and CommonJS builds
- Comprehensive README
- Migration guide
- TypeScript definitions
- JSDoc comments
- Example application
- Modern, responsive design
- Tailwind CSS styling
- Smooth animations
- Drag-and-drop pedal ordering
- Visual feedback for interactions
- Keyboard navigation support
- ARIA labels
- Focus management
- Screen reader friendly
- Efficient audio node management
- Proper cleanup/disposal
- Optimized render cycles
- Lazy loading capabilities
- Memory leak prevention
pedalboard.js/
├── src/ # Google Closure style sources
├── lib/ # tartJS dependency
├── dist/ # Compiled output
├── example/ # Basic HTML example
└── scripts/ # Shell build scripts
pedalboard.js/
├── src/ # TypeScript sources
│ ├── core/
│ ├── pedals/
│ ├── controls/
│ ├── io/
│ ├── components/
│ └── types/
├── example-app/ # React example app
├── public/ # Static assets
├── dist/ # Build output
└── [config files] # Modern tooling configs
- Google Closure Library
- tartJS
- Closure Compiler
- jQuery (indirect)
{
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"lucide-react": "^0.294.0",
"clsx": "^2.0.0",
"zustand": "^4.4.7"
},
"devDependencies": {
"typescript": "^5.3.3",
"vite": "^5.0.7",
"tailwindcss": "^3.3.6",
"@vitejs/plugin-react": "^4.2.0"
}
}<script src="dist/compiled.js"></script>
<script>
var stage = new pb.Stage();
var board = new pb.Board(stage.getContext());
var overdrive = new pb.stomp.Overdrive(stage.getContext());
board.addPedals([overdrive]);
stage.setBoard(board);
</script>import { Stage, Board, Overdrive } from '@pedalboard/core';
const stage = new Stage();
const board = new Board(stage.getContext());
const overdrive = new Overdrive(stage.getContext());
board.addPedals([overdrive]);
stage.setBoard(board);
// With React UI
import { PedalBoard } from '@pedalboard/core/components';
<PedalBoard board={board} />- Maintainability: Modern tooling and practices make the codebase easier to maintain
- Type Safety: TypeScript prevents runtime errors and improves code quality
- Developer Experience: Better IDE support, debugging, and documentation
- Performance: Modern build optimizations and tree shaking
- Ecosystem: Access to modern npm packages and tools
- Future-proof: Built on current web standards and practices
- Testing: Easier to test with modern testing frameworks
- Deployment: Simple deployment to modern platforms (Vercel, Netlify, etc.)
- Testing: Add comprehensive test suite using Vitest
- CI/CD: Set up GitHub Actions for automated testing and deployment
- More Pedals: Add more effect types (Chorus, Flanger, Compressor, etc.)
- Mobile Support: Optimize for mobile devices and touch interactions
- Web Workers: Move audio processing to Web Workers for better performance
- WebRTC: Add support for collaborative jamming sessions
- MIDI: Add MIDI controller support
- Presets: Expand preset system with cloud storage
The modernization of Pedalboard.js successfully transforms a decade-old library into a modern, maintainable, and extensible audio effects library. The new architecture provides a solid foundation for future development while maintaining the core functionality that made the original library valuable.