blog.dopana

返回

EmDash是一个基于TypeScript和Cloudflare构建的现代CMS,被设计为WordPress的”spiritual successor”。在使用两者之后,我发现EmDash在AI时代提供了显著优势。

为什么要考虑EmDash而不是WordPress?#

WordPress已经统治Web超过20年,但它是为不同时代构建的 - 当PHP和LAMP堆栈是标准时。EmDash从一开始就考虑到serverless、TypeScript和AI代理而设计。

快速比较表#

标准EmDashWordPress
语言TypeScript / AstroPHP
HostingCloudflare Workers (serverless)任何PHP服务器
DatabaseD1 (serverless SQLite)MySQL
Plugin securitySandboxed Dynamic WorkersFull server access
EcosystemBeta v0.1 (2026)20年,60,000+ plugins
TTFB (cached)10-30ms200-500ms
Hosting cost$0/month (free tier)$25-50/month (managed)
AI integrationBuilt-in MCP serverREST API (bolt-on)

1. 安全性:Plugin Security Model#

这是考虑EmDash的最重要原因。

WordPress Plugin问题#

根据Patchstack,96%的WordPress安全漏洞来自plugins,而不是WordPress core。平均每周发现超过333个新的WordPress plugin漏洞,通常超过200个在披露时没有可用的补丁。

WordPress plugins作为PHP脚本在您的服务器上运行,具有与WordPress本身相同的权限。这意味着:

  • 对整个数据库的直接读/写访问
  • 可以读取每个post、user record、password hash
  • 可以执行任意SQL查询
  • 可以在文件系统上读取和写入文件
  • 可以发出出站HTTP请求

所有这些都默认可用,没有permission system或isolation。

EmDash Sandboxed Plugins#

EmDash在名为Dynamic Worker(V8 isolate)的隔离sandbox中运行每个plugin。每个plugin必须在manifest文件中提前声明其capabilities,类似于mobile apps请求permissions。

WordPressEmDashEmDash网站添加功能Plugin在WordPress生态系统中运行pluginDependency + Update +CompatibilitySecurity & MaintenanceSandboxed Plugin限制访问权限Isolated Runtime当plugin出现问题时抑制影响范围Development

在content保存后发送电子邮件的plugin必须准确声明两个capabilities:read:content和email:send。它不能:

  • 触摸数据库
  • 访问文件系统
  • 向任何未明确声明的域发出网络请求

如果plugin被破坏,blast radius被限制在其自己的sandbox中。它无法到达其他plugins、您的数据或您的infrastructure。

[!NOTE] Cloudflare的公告以安全性为主导 - 这是EmDash最可辩护的技术论据。

2. 基本功能#

功能上,EmDash和WordPress在基本功能上相当相似:

  • Content Management (CMS): 两者都有用于管理内容的admin interface
  • SEO: 两者都支持SEO basics(meta tags、sitemaps、structured data)
  • Blog: 两者都有带有posts、categories、tags的blog functionality
  • Media Library: 两者都有media management

对于一般内容站点,两者可以等效使用。

3. Developer Experience#

WordPress挑战#

从开发者的角度来看,WordPress相当难以使用:

  • Large codebase: 非常难以理解和修改现有代码
  • Git integration: 版本管理在plugins方面很复杂
  • Dependency management: Plugin dependencies导致conflicts
  • PHP performance: 与Node.js相比,PHP在许多情况下处于劣势
  • Update compatibility: WordPress updates可能破坏old plugins
  • Legacy codebase: 理解和修复现有WordPress代码具有挑战性

EmDash优势#

  • TypeScript: 从一开始就是type-safe
  • Modern tooling: npm、modern build systems
  • Git-native: Version control是first-class citizen
  • No legacy debt: 从一开始就是modern architecture
  • Astro SSR/SSG: 通过modern rendering strategies获得更好的performance

4. Infrastructure Costs#

WordPress Hosting#

对于不需要大量流量的一般内容站点:

  • Server/hosting cost: $5-20/month是typical
  • Managed hosting: $25-50/month
  • 需要维护server、PHP updates、MySQL optimization
  • 需要caching layers、CDN setup

Cloudflare上的EmDash#

EmDash使用Cloudflare infrastructure:

  • Free tier: 许多use cases可以在free tier内运行
  • Serverless: 没有server可以crash或patch
  • Global edge: 在全球300+ data centers运行
  • Deployment: git push - Cloudflare自动build和deploy
  • No operating system: 没有OS需要patch
  • No MySQL optimization: D1在edge处理database

Trade-off: locked到Cloudflare ecosystem。但对于许多站点,这是cost和performance benefits的acceptable trade-off。

5. AI时代Development Costs#

在AI-driven development时代,EmDash具有显著优势:

WordPress挑战#

  • Plugin dependency: 通常必须依赖现有plugins
  • Legacy codebase: AI难以理解massive WordPress codebase
  • Update issues: Plugin updates可能破坏现有logic
  • Complex debugging: 理解现有plugin logic具有挑战性

EmDash优势#

  • Custom development: 不需要完全依赖plugins
  • Modern stack: AI在TypeScript/Astro codebase上工作得更好
  • Flexible architecture: 可以准确build所需内容
  • Optimized solutions: 可以为特定requirements优化performance
  • No legacy debt: 使用modern patterns fresh start

6. AI Agent Content Management#

这是EmDash的主要优势。

EmDash MCP Support#

EmDash具有built-in MCP (Model Context Protocol) server,允许AI agents:

  • 直接从CMS创建内容
  • Programmatic更新内容
  • 通过AI agents管理内容
  • 超越传统admin UI的新CMS usage patterns

WordPress AI Integration#

WordPress可以与AI agents集成,但:

  • 需要build REST API integration
  • 需要custom plugins
  • 需要additional infrastructure
  • Not native - bolt-on solution

[!TIP] EmDash是AI-native - MCP support从day one开始就是built-in。

7. User Permission Management#

EmDash具有更简单、更直观的permission system:

UserRoleSubscriberContributorAuthorEditorAdmin查看已发布内容创建内容需要批准创建、编辑、发布自己的内容管理团队范围的内容访问所有功能Users / Settings / Plugins /Schema

EmDash permissions是:

  • 更直观
  • 更容易理解
  • 配置更简单
  • 与modern RBAC patterns更好地aligned

8. 备份#

WordPress的备份可能会非常复杂。你需要同时备份数据库和文件。每次更新内容或插件时,都必须重新备份一次。当网站逐渐变大,达到 3 GB 或 5 GB 时,你往往需要借助外部工具来备份数据。仅仅做一个简单的备份就需要耗费大量时间,这成了许多 WordPress 用户的痛点。

而 EmDash 的备份则要简单得多。你可以直接使用 git 来备份整个站点,包括上传的文件。你的数据库本质上只是一个单独的 SQLite 文件。每次执行 git commit,你就拥有了站点的完整备份。备份就像执行一次 git push 一样简单,而恢复也如同 git checkout 一样轻松。

Conclusion: 为什么选择EmDash?#

我不是因为”EmDash比WordPress有更多功能”而被吸引。主要原因是:

  1. Modern Architecture: Cloudflare + TypeScript + Sandboxed Plugins + AI-native
  2. Security First: Plugin sandboxing解决了fundamental WordPress security problem
  3. Performance: 具有global distribution的serverless edge deployment
  4. Developer Experience: Modern tooling、type-safe、git-native
  5. Cost Effective: 许多use cases可以在free tier上运行
  6. AI Native: AI agents的built-in MCP support
  7. No Legacy Debt: 使用2026 standards fresh start

EmDash是”今天从scratch构建的WordPress” - 这是一件好事。

参考文献#