v4 代码迁移指南
¥v4 code migration guide
Strapi v4 引入了重大更改,需要手动更新现有 Strapi 项目的代码库。
¥Strapi v4 introduces breaking changes that require manually updating the codebase of an existing Strapi project.
本指南涵盖将 Strapi v3.6.x 应用的 后端 和 前端 迁移到 Strapi v4.0.x。并围绕小的独立主题构建。
¥This guide covers migrating both the backend and the frontend of a Strapi v3.6.x application to Strapi v4.0.x. and is built around small independent topics.
迁移 Strapi 应用的后端代码是迁移前端的先决条件。
¥Migrating the backend code of a Strapi application is a prerequisite to migrating the frontend.
对于涵盖的每个主题,本指南旨在:
¥For each topic covered, this guide is designed to:
帮助你了解 Strapi v3 和 v4 之间的主要区别,
¥help you understand the main differences between Strapi v3 and v4,
通过将内置代码迁移到 Strapi v4 来帮助你解决重大变更,
¥help you resolve breaking changes by migrating built-in code to Strapi v4,
并且,只要有可能,就如何迁移自定义代码提供一些线索和起点。
¥and, whenever possible, offer some clues and starting points on how to migrate custom code.
本指南涵盖以下主题,你可以单击特定主题跳转到专用迁移文档,或单击范围以阅读后端或前端迁移的更一般性介绍:
¥The following topics are covered by this guide, and you can either click on a specific topic to jump to the dedicated migration documentation or click on a scope to read a more general introduction for the backend or the frontend migration:
范围 | 话题 |
---|---|
后端代码迁移 | |
前端代码迁移 |
本代码迁移指南并未广泛涵盖以下主题,但 Strapi v4 还介绍了:
¥The following topics are not extensively covered in this code migration guide, but Strapi v4 also introduces:
项目的新 文件结构,可以在 Strapi 代码模块 的帮助下迁移,
¥a new file structure for the project, which can be migrated with the help of Strapi codemods,
完全重写 REST 和 GraphQL API,默认情况下使用 REST API,而不是 populating 任何关系、组件、动态区域和媒体,
¥fully rewritten REST and GraphQL APIs, with the REST API not populating by default any relations, components, dynamic zones, and medias,
¥the new Entity Service and Query Engine APIs,
Strapi 设计系统 用于构建 Strapi v4 的新用户界面。
¥and the Strapi Design System which is used to build the new user interface of Strapi v4.