A Packwerk Retrospective - Shopify
Feb 7, 2024

Summary
This post is a retrospective on Packwerk, detailing its origins as a dependency management tool, its later adoption and subsequent removal of 'privacy checks' which were misused as an API design tool, and its weaknesses and blind spots such as not seeing dynamic constants, relying on Zeitwerk autoload directories, and not seeing dependencies outside the app directory. It also describes an effort to isolate the 'Platform Essentials' package, which revealed a bug in Packwerk and highlighted the need for inversion of control to resolve violations, often making code harder to understand.
More from the Code Modularity and Boundary Enforcement trail
- Focus On Behavior, Not State, for a More Maintainable Codebase - Shopify
- Building a Business System Integration and Automation Platform at Shopify - Shopify
- Shopify-Made Patterns in Our Rails Apps - Shopify
- Remove Circular Dependencies by Using Dependency Injection and the Repository Pattern in Ruby - Shopify
- Adopting Sorbet at Scale - Shopify