Packwerk 回顾

This article was originally posted on the Rails at Scale blog.

本文最初发布在Rails at Scale 博客上。

In September, 2020, our team at Shopify released a Ruby gem named Packwerk, a tool to enforce boundaries and modularize Rails applications. Since its release, Packwerk has taken on a life of its own, inspiring blog posts, conference talks, and even an entire gem ecosystem. Its popularity is an indication that Packwerk clearly filled a void in the Rails community.

2020年9月,我们在Shopify团队发布了一个名为Packwerk的Ruby gem,这是一个用于强制实施边界和模块化Rails应用程序的工具。自发布以来,Packwerk已经成为一个独立的存在,激发了博客文章、会议演讲,甚至是整个gem生态系统。它的受欢迎程度表明Packwerk在Rails社区中填补了一个空白。

Packwerk is a static analysis tool, similar to tools like Rubocop and Sorbet. Applied to a codebase, it analyzes constant references to help decouple code and organize it into well-defined packages.

Packwerk是一种静态分析工具,类似于Rubocop和Sorbet等工具。应用于代码库时,它分析常量引用,帮助解耦代码并将其组织成明确定义的软件包。

But Packwerk is more than just a tool. Over the years, Packwerk’s approach to modularity has come to embody distinct and sometimes conflicting perspectives on code organization and its evolution. Packwerk’s feedback can change the entire trajectory of a codebase to a degree that distinguishes it from other tools of its kind.

但Packwerk不仅仅是一个工具。多年来,Packwerk对模块化的方法已经成为了不同且有时相互冲突的代码组织和演进观点的体现。Packwerk的反馈可以改变整个代码库的发展轨迹,这使其与其他同类工具有所区别。

This retrospective is our effort, as the team that developed Packwerk at Shopify, to shine a light on our learnings working with the tool, concerns about its use, and hopes for its future.

这篇回顾是我们作为Shopify开发Packwerk的团队的努力,旨在阐明我们在使用该工具时的经验教训,对其使用的担忧以及对其未来的期望。

Origins of Packwerk

Packwerk的起源

Packwerk as a Dependency Management Tool

Packwerk作为依赖管理工具

“I know who you are and because of that I know what you do.” This knowledge is a dependency that raises the cost of change. – Sandi Metz, Practical Object-Oriented Design in Ruby

“我知道你是谁,正因为如此我知道你在做什么。” 这种知识是一种增加变更成本的依赖关系。- Sandi Metz,《Ruby实践面向对象设计》

Sandi Metz’ quote above captures the spirit from which Packwerk was born. The premise is simple. To use Packwerk, you must firs...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.125.0. UTC+08:00, 2024-05-06 06:02
浙ICP备14020137号-1 $访客地图$