Skip to content

Commit

Permalink
chore: add message in overview (#782)
Browse files Browse the repository at this point in the history
Co-authored-by: Lev Chelyadinov <[email protected]>
  • Loading branch information
sanua356 and illright authored Feb 15, 2025
1 parent 31addca commit 83ce619
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,21 @@ Layers, slices, and segments form a hierarchy like this:

Layers are standardized across all FSD projects. You don't have to use all of the layers, but their names are important. There are currently seven of them (from top to bottom):

1. **App\*** — everything that makes the app run — routing, entrypoints, global styles, providers.
1. **App** — everything that makes the app run — routing, entrypoints, global styles, providers.
2. **Processes** (deprecated) — complex inter-page scenarios.
3. **Pages** — full pages or large parts of a page in nested routing.
4. **Widgets** — large self-contained chunks of functionality or UI, usually delivering an entire use case.
5. **Features**_reused_ implementations of entire product features, i.e. actions that bring business value to the user.
6. **Entities** — business entities that the project works with, like `user` or `product`.
7. **Shared\*** — reusable functionality, especially when it's detached from the specifics of the project/business, though not necessarily.
7. **Shared** — reusable functionality, especially when it's detached from the specifics of the project/business, though not necessarily.

_\* — these layers, **App** and **Shared**, unlike the other layers, don't have slices, and are made up of segments directly._
:::warning

Layers **App** and **Shared**, unlike other layers, do not have slices and are divided into segments directly.

However, all other layers — **Entities**, **Features**, **Widgets**, and **Pages**, retain the structure in which you must first create slices, inside which you create the segments.

:::
The trick with layers is that modules on one layer can only know about and import from modules from the layers strictly below.

### Slices {#slices}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ FSD можно внедрять в проектах и командах любо

Слои стандартизированы во всех проектах FSD. Вам не обязательно использовать все слои, но их названия важны. На данный момент их семь (сверху вниз):

1. **App\*** — всё, благодаря чему приложение запускается — роутинг, точки входа, глобальные стили, провайдеры и т. д.
1. **App** — всё, благодаря чему приложение запускается — роутинг, точки входа, глобальные стили, провайдеры и т. д.
2. **Processes** (процессы, устаревший) — сложные межстраничные сценарии.
3. **Pages** (страницы) — полные страницы или большие части страницы при вложенном роутинге.
4. **Widgets** (виджеты) — большие самодостаточные куски функциональности или интерфейса, обычно реализующие целый пользовательский сценарий.
5. **Features** (фичи) — _повторно используемые_ реализации целых фич продукта, то есть действий, приносящих бизнес-ценность пользователю.
6. **Entities** (сущности) — бизнес-сущности, с которыми работает проект, например `user` или `product`.
7. **Shared\*** — переиспользуемый код, особенно когда он отделён от специфики проекта/бизнеса, хотя это не обязательно.
7. **Shared** — переиспользуемый код, особенно когда он отделён от специфики проекта/бизнеса, хотя это не обязательно.

_\* — эти слои, **App** и **Shared**, в отличие от других слоев, не имеют слайсов и состоят из сегментов напрямую._
:::warning Важно

Слои **App** и **Shared**, в отличие от других слоев, не имеют слайсов и состоят из сегментов напрямую.

Однако для всех остальных слоёв — **Entities**, **Features**, **Widgets** и **Pages**, сохраняется структура, в которой необходимо сначала создать слайс, внутри которого создавать сегменты.

:::

Фишка слоев в том, что модули на одном слое могут знать только о модулях со слоев строго ниже, и как следствие, импортировать только с них.

Expand Down

0 comments on commit 83ce619

Please sign in to comment.