Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix a section in the Next.js guide and add an example #699

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {
metadata: cfg.metadata,

imageZoom: {
selector: ".markdown :not(a) > img",
options: {
background: "rgb(255 255 255 / 0.3)",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,26 @@ To comply with the principles of FSD, you should treat the NextJS `app` folder i
to resolve a conflict with the NextJS `pages` folder.

The approach is to move the NextJS `app` folder to the root folder of the project and import the FSD pages into the NextJS `app` folder. This saves
the FSD project structure inside the `src` folder.
the FSD project structure inside the `src` folder. You should still also add the `pages` folder to the root, because the App router is compatible with the Pages router.

```sh
```
├── app # NextJS app folder
├── pages # Stub NextJS pages folder
│ ├── README.md # Description of why this folder exists
├── src
│ ├── app # FSD app folder
│ ├── entities
│ ├── features
│ ├── pages
│ ├── pages # FSD app folder
│ ├── shared
│ ├── widgets
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)][ext-app-router-stackblitz]

## See also {#see-also}

- [(Thread) About the pages directory in NextJS](https://t.me/feature_sliced/3623)

[project-knowledge]: /docs/about/understanding/knowledge-types
[ext-app-router-stackblitz]: https://stackblitz.com/edit/stackblitz-starters-aiez55?file=README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,26 @@ App Router стал стабильным в NextJS версии 13.4. App Router
для устранения конфликта с папкой `pages` NextJS.

Подход заключается в перемещении папки `app` NextJS в корневую папку проекта и импорте страниц FSD в папку `app` NextJS. Это сохраняет
структуру проекта FSD внутри папки `src`.
структуру проекта FSD внутри папки `src`. Вам также стоит добавить в корневую папку проекта папку `pages`, потому что App Router совместим с Pages Router.

```sh
```
├── app # Папка app (NextJS)
├── pages # Пустая папка pages (NextJS)
│ ├── README.md # Описание того, зачем нужна эта папка
├── src
│ ├── app # Папка app (FSD)
│ ├── entities
│ ├── features
│ ├── pages
│ ├── pages # Папка pages (FSD)
│ ├── shared
│ ├── widgets
```

[![Открыть в StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)][ext-app-router-stackblitz]

## См. также {#see-also}

- [(Тред) Про pages директорию в NextJS](https://t.me/feature_sliced/3623)

[project-knowledge]: /docs/about/understanding/knowledge-types
[ext-app-router-stackblitz]: https://stackblitz.com/edit/stackblitz-starters-aiez55?file=README.md
Loading