Skip to content

Commit

Permalink
Merge branch 'feature-sliced:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sanua356 authored Dec 26, 2024
2 parents d533dd6 + 12ea564 commit ac2c49c
Show file tree
Hide file tree
Showing 155 changed files with 16,652 additions and 2,782 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"login": "sergeysova",
"name": "Sergey Sova",
"avatar_url": "https://avatars.githubusercontent.com/u/5620073?v=4",
"profile": "https://sova.dev/",
"profile": "https://sergeysova.com/",
"contributions": [
"blog",
"doc",
Expand Down
3 changes: 1 addition & 2 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module.exports = {
extends: [
"stylelint-config-standard-scss",
"stylelint-config-recommended",
"stylelint-config-standard-scss",
"stylelint-config-recess-order",
],
rules: {
"color-hex-length": "long",
"at-rule-no-unknown": true,
"selector-class-pattern": null,
},
};
65 changes: 60 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,71 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Since last release][since-last-release]
<!-- ## [Since last release][since-last-release] -->

### Added
## [2.1.0] - 2024-10-31

The new revision of Feature-Sliced Design is here! The main difference with FSD 2.0 is the new approach to decomposition — “pages first”.

### What's “pages-first”?

You do “pages first” by keeping more code in pages. For example, large blocks of UI, forms and data logic that are not reused on other pages should now stay in the slice of the page that they are used in. The division by segments (`ui`, `api`, `model`, etc.) still applies to all this code, and we encourage you to further split and organize code into folders inside of segments — don't just pile all the code into a single file.

In the same way, widgets are no longer just a compositional layer, instead they should also store code that isn't currently needed outside of that widget, including its own stores, business logic, and API interactions.

When you have a need to reuse code in several widgets or pages, consider putting it in Shared. If that code involves business logic (i. e. managing specific modal dialogs), consider breaking it up into infrastructural code, like the modal manager, and the business code, like the content of the modals. The infrastructure can then go to Shared, and the content can stay in the pages that use this infrastructure.

### How is it different?

In FSD 2.0 we explained how to identify entities and features in your application, and then combine them in widgets and pages. Over time we started disliking this approach, mostly for the following reasons:

- Code cohesion is much worse in this approach
- You need to jump around several folders just to make changes to a single user flow
- Unused code is harder to delete because it's somewhere else
- Finding entities and features is still an advanced skill that needs to be developed over time
- It requires understanding of the business context, which not all developers want to bother with
- On the other hand, splitting by pages is natural and requires little training
- Different developers have different understandings of these concepts, which leads to everyone having their own idea of FSD, which causes conflict and misunderstanding

### Is it hard to migrate from FSD 2.0?

This is a non-breaking change, so you don’t even necessarily need to migrate your current FSD projects to FSD 2.1, but we still think the new way of thinking will lead to a more cohesive and less opinionated structure. We’ve compiled a few steps you can take in [the migration guide](https://feature-sliced.design/docs/guides/migration/from-v2-0).

- New article about how to use FSD with Next.js (#644).
### What else happened since the last release?

The cross-import notation (`@x`) that was an experimental proposal for a long time has now been standardized! Its official name is **Public API for cross-imports**. You can use it to create explicit connections between entities. There's [a new section in our documentation all about this new notation](https://feature-sliced.design/docs/reference/public-api#public-api-for-cross-imports).

Another exciting new thing in the FSD ecosystem is our architectural linter, [Steiger](https://github.com/feature-sliced/steiger). It's still in active development, but it is production-ready.

A couple more minor clarifications to the docs were made as well:

1. Application-aware things like the route constants, the API calls, or company logo, are now explicitly allowed in Shared. Business logic is still not allowed, but these things are not considered to be business logic.
2. Imports between segments in App and Shared were always allowed, but it's been made explicit too.

And here's what happened to the documentation website:

#### Added

- Slightly rewritten and expanded overview page to give some details about FSD right away (#685).
- New partial translations: Korean (#739, #736, #735, #742, #732, #730, #715), Japanese (#728).
- The tutorial was rewritten. Technical details were stripped out, more FSD theory has been added (#665).
- Guides on how to deal with common frontend issues like page layouts (#708), types (#701), authentication (#693).
- Guides on how to use FSD with Nuxt (#710, #689, #683, #679), SvelteKit (#698), Next.js (#699, #664, #644), and TanStack Query (#673).
- A new feedback widget, powered by PushFeedback! Go give it a try and let us know what you think of the new pages (#695).
- Comparison of FSD with Atomic Design (#671).

#### Changed

- The migration guide from a custom architecture (formerly known as "from legacy") has been actualized (#725).

#### Removed

- The decomposition cheatsheet is now unlisted for an undefined period of time. It proved to be more harmful than useful, but maybe it can be saved later (#649).

## [2.0.0] - 2023-10-01

> **Note**
> This release note is retrospective, meaning that prior to this release, the Feature-Sliced Design project did not keep a changelog. Below is a summary of the most prominent recent changes, but there is no FSD v1. Prior to FSD, there has been a project called ["Feature Slices"](https://featureslices.dev/v1.0.html), and it is considered to be the v1 of FSD.
> This release note is retrospective, meaning that prior to this release, the Feature-Sliced Design project did not keep a changelog. Below is a summary of the most prominent recent changes, but there is no FSD v1. Prior to FSD, there has been a project called ["Feature Slices"](https://feature-sliced.github.io/featureslices.dev/v1.0.html), and it is considered to be the v1 of FSD.
### Deprecated

Expand All @@ -41,5 +95,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The overview page has been rewritten to be more concise and informative (#512, #515, #516).
- FSD has updated its branding, and there are now guidelines to the brand usage. The standard spelling of the name is now "Feature-Sliced Design" (#496, #499, #500, #465).

[since-last-release]: https://github.com/feature-sliced/documentation/compare/v2.0.0...HEAD
[since-last-release]: https://github.com/feature-sliced/documentation/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/feature-sliced/documentation/releases/tag/v2.1.0
[2.0.0]: https://github.com/feature-sliced/documentation/releases/tag/v2.0.0
3 changes: 3 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
- [Russian docs version](i18n/ru)
- [English docs version](i18n/en)
- [Uzbek docs version](i18n/uz)
- [Japanese docs version](i18n/ja)

## Installation

Expand All @@ -20,6 +21,8 @@ pnpm install
pnpm start # for default locale
pnpm start:ru # for RU locale
pnpm start:en # for EN locale
pnpm start:uz # for UZ locale
pnpm start:ja # for JA locale
```

> About [docusaurus/i18n commands](https://docusaurus.io/docs/i18n/git#translate-the-files)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<table>
<tbody>
<tr>
<td align="center" valign="top" width="20%"><a href="https://sova.dev/"><img src="https://avatars.githubusercontent.com/u/5620073?v=4?s=100" width="100px;" alt="Sergey Sova"/><br /><sub><b>Sergey Sova</b></sub></a><br /><a href="#blog-sergeysova" title="Blogposts">📝</a> <a href="https://github.com/feature-sliced/documentation/commits?author=sergeysova" title="Documentation">📖</a> <a href="#example-sergeysova" title="Examples">💡</a> <a href="#ideas-sergeysova" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-sergeysova" title="Project Management">📆</a> <a href="#question-sergeysova" title="Answering Questions">💬</a> <a href="#infra-sergeysova" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#research-sergeysova" title="Research">🔬</a> <a href="#eventOrganizing-sergeysova" title="Event Organizing">📋</a> <a href="#tutorial-sergeysova" title="Tutorials">✅</a> <a href="#talk-sergeysova" title="Talks">📢</a> <a href="#maintenance-sergeysova" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="20%"><a href="https://sergeysova.com/"><img src="https://avatars.githubusercontent.com/u/5620073?v=4?s=100" width="100px;" alt="Sergey Sova"/><br /><sub><b>Sergey Sova</b></sub></a><br /><a href="#blog-sergeysova" title="Blogposts">📝</a> <a href="https://github.com/feature-sliced/documentation/commits?author=sergeysova" title="Documentation">📖</a> <a href="#example-sergeysova" title="Examples">💡</a> <a href="#ideas-sergeysova" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-sergeysova" title="Project Management">📆</a> <a href="#question-sergeysova" title="Answering Questions">💬</a> <a href="#infra-sergeysova" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#research-sergeysova" title="Research">🔬</a> <a href="#eventOrganizing-sergeysova" title="Event Organizing">📋</a> <a href="#tutorial-sergeysova" title="Tutorials">✅</a> <a href="#talk-sergeysova" title="Talks">📢</a> <a href="#maintenance-sergeysova" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="20%"><a href="https://t.me/ilya_azin"><img src="https://avatars.githubusercontent.com/u/42924400?v=4?s=100" width="100px;" alt="Ilya Azin"/><br /><sub><b>Ilya Azin</b></sub></a><br /><a href="https://github.com/feature-sliced/documentation/commits?author=azinit" title="Documentation">📖</a> <a href="#example-azinit" title="Examples">💡</a> <a href="#ideas-azinit" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-azinit" title="Project Management">📆</a> <a href="#question-azinit" title="Answering Questions">💬</a> <a href="https://github.com/feature-sliced/documentation/pulls?q=is%3Apr+reviewed-by%3Aazinit" title="Reviewed Pull Requests">👀</a> <a href="#infra-azinit" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#userTesting-azinit" title="User Testing">📓</a> <a href="#design-azinit" title="Design">🎨</a> <a href="#tutorial-azinit" title="Tutorials">✅</a> <a href="#talk-azinit" title="Talks">📢</a> <a href="#maintenance-azinit" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="20%"><a href="https://github.com/Rin-Akaia-eth"><img src="https://avatars.githubusercontent.com/u/8805308?v=4?s=100" width="100px;" alt="Rin 🦊🪐😈 Akaia"/><br /><sub><b>Rin 🦊🪐😈 Akaia</b></sub></a><br /><a href="https://github.com/feature-sliced/documentation/commits?author=Rin-Akaia-eth" title="Documentation">📖</a> <a href="#content-Rin-Akaia-eth" title="Content">🖋</a> <a href="#ideas-Rin-Akaia-eth" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-Rin-Akaia-eth" title="Answering Questions">💬</a> <a href="#translation-Rin-Akaia-eth" title="Translation">🌍</a> <a href="#talk-Rin-Akaia-eth" title="Talks">📢</a> <a href="#maintenance-Rin-Akaia-eth" title="Maintenance">🚧</a> <a href="#research-Rin-Akaia-eth" title="Research">🔬</a></td>
<td align="center" valign="top" width="20%"><a href="https://github.com/AlexandrHoroshih"><img src="https://avatars.githubusercontent.com/u/32790736?v=4?s=100" width="100px;" alt="Alexander Khoroshikh"/><br /><sub><b>Alexander Khoroshikh</b></sub></a><br /><a href="https://github.com/feature-sliced/documentation/commits?author=AlexandrHoroshih" title="Documentation">📖</a> <a href="#ideas-AlexandrHoroshih" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-AlexandrHoroshih" title="Answering Questions">💬</a> <a href="https://github.com/feature-sliced/documentation/pulls?q=is%3Apr+reviewed-by%3AAlexandrHoroshih" title="Reviewed Pull Requests">👀</a> <a href="#tool-AlexandrHoroshih" title="Tools">🔧</a> <a href="#security-AlexandrHoroshih" title="Security">🛡️</a> <a href="#talk-AlexandrHoroshih" title="Talks">📢</a> <a href="#tutorial-AlexandrHoroshih" title="Tutorials">✅</a> <a href="#maintenance-AlexandrHoroshih" title="Maintenance">🚧</a></td>
Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/docusaurus/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const presets = [
showLastUpdateTime: true,
versions: {
current: {
label: `v2.0.0 🍰`,
label: `v2.1`,
},
},
sidebarItemsGenerator,
Expand Down
5 changes: 4 additions & 1 deletion config/docusaurus/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { DEFAULT_LOCALE } = require("./consts");
/** @type {import('@docusaurus/types').DocusaurusConfig["i18n"]} */
const i18n = {
defaultLocale: DEFAULT_LOCALE,
locales: ["ru", "en", "uz", "kr"],
locales: ["ru", "en", "uz", "kr", "ja"],
localeConfigs: {
ru: {
label: "Русский",
Expand All @@ -17,6 +17,9 @@ const i18n = {
kr: {
label: "한국어",
},
ja: {
label: "日本語",
},
},
};

Expand Down
4 changes: 2 additions & 2 deletions config/docusaurus/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const navbar = {
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
to: "https://featureslices.dev/v1.0.html",
to: "https://feature-sliced.github.io/featureslices.dev/v1.0.html",
label: "v1.0",
},
{
to: "https://featureslices.dev/v0.1.html",
to: "https://feature-sliced.github.io/featureslices.dev/v0.1.html",
label: "v0.1",
},
{
Expand Down
36 changes: 30 additions & 6 deletions config/docusaurus/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const SECTIONS = {
},
MIGRATION: {
shortPath: "/docs/guides/migration",
fullPath: "/docs/guides/migration/from-legacy",
fullPath: "/docs/guides/migration/from-custom",
},
};

Expand Down Expand Up @@ -109,17 +109,17 @@ const LEGACY_ROUTES = [
{
title: "Decouple of entities",
from: "/docs/concepts/decouple-entities",
to: "/docs/reference/isolation/decouple-entities",
to: "/docs/reference/layers#import-rule-on-layers",
},
{
title: "Low Coupling & High Cohesion",
from: "/docs/concepts/low-coupling",
to: "/docs/reference/isolation/coupling-cohesion",
to: "/docs/reference/slices-segments#zero-coupling-high-cohesion",
},
{
title: "Cross-communication",
from: "/docs/concepts/cross-communication",
to: "/docs/reference/isolation",
to: "/docs/reference/layers#import-rule-on-layers",
},
{
title: "App splitting",
Expand Down Expand Up @@ -249,7 +249,7 @@ const LEGACY_ROUTES = [
{
title: "Migration from Legacy",
from: "/docs/guides/migration-from-legacy",
to: "/docs/guides/migration/from-legacy",
to: "/docs/guides/migration/from-custom",
},
],
},
Expand All @@ -264,6 +264,30 @@ const LEGACY_ROUTES = [
},
],
},
{
group: "Rename 'legacy' to 'custom'",
details:
"'Legacy' is derogatory, we don't get to call people's projects legacy",
children: [
{
title: "Rename 'legacy' to custom",
from: "/docs/guides/migration/from-legacy",
to: "/docs/guides/migration/from-custom",
},
],
},
{
group: "Deduplication of Reference",
details:
"Cleaned up the Reference section and deduplicated the material",
children: [
{
title: "Isolation of modules",
from: "/docs/reference/isolation",
to: "/docs/reference/layers#import-rule-on-layers",
},
],
},
];

// @returns { from, to }[]
Expand Down Expand Up @@ -314,7 +338,7 @@ const _TOTAL_ROUTES = [
"/docs/guides/examples/theme",
"/docs/guides/examples/types",
"/docs/guides/examples/white-labels",
"/docs/guides/migration/from-legacy",
"/docs/guides/migration/from-custom",
"/docs/guides/migration/from-v1",
"/docs/guides/tech/with-nextjs",
"/docs/",
Expand Down
3 changes: 3 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ module.exports = {
darkTheme: prismThemes.oneDark,
},
},
future: {
experimental_faster: true,
},
};

// Remove configs if there are not secrets passed
Expand Down
2 changes: 1 addition & 1 deletion i18n/en/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version.label": {
"message": "v2.0.0 🍰",
"message": "v2.1",
"description": "The label for version current"
},
"sidebar.getstartedSidebar.category.Tutorials": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can ask your question in our [Telegram chat][telegram], [Discord community][

### Is there a toolkit or a linter?

There is an official ESLint config — [@feature-sliced/eslint-config][eslint-config-official], and an ESLint plugin — [@conarti/eslint-plugin-feature-sliced][eslint-plugin-conarti], created by Aleksandr Belous, a community member. You're welcome to contribute to these projects or start your own!
Yes! We have a linter called [Steiger][ext-steiger] to check your project's architecture and [folder generators][ext-tools] through a CLI or IDEs.

### Where to store the layout/template of pages?

Expand Down Expand Up @@ -58,10 +58,10 @@ Rather yes than no

Answered [here](/docs/guides/examples/auth)

[ext-steiger]: https://github.com/feature-sliced/steiger
[ext-tools]: https://github.com/feature-sliced/awesome?tab=readme-ov-file#tools
[import-rule-layers]: /docs/reference/layers#import-rule-on-layers
[reference-entities]: /docs/reference/layers#entities
[eslint-config-official]: https://github.com/feature-sliced/eslint-config
[eslint-plugin-conarti]: https://github.com/conarti/eslint-plugin-feature-sliced
[motivation]: /docs/about/motivation
[telegram]: https://t.me/feature_sliced
[discord]: https://discord.gg/S8MzWTUsmp
Expand Down
Loading

0 comments on commit ac2c49c

Please sign in to comment.