Skip to content

[WIP] docs: discourage the Widgets layer#933

Open
Gaic4o wants to merge 2 commits into
feature-sliced:mainfrom
Gaic4o:widgets
Open

[WIP] docs: discourage the Widgets layer#933
Gaic4o wants to merge 2 commits into
feature-sliced:mainfrom
Gaic4o:widgets

Conversation

@Gaic4o

@Gaic4o Gaic4o commented Jul 17, 2026

Copy link
Copy Markdown
Member

Background

This PR updates the FSD documentation to remove the Widgets layer from the set of layers recommended by default.

After discussions with the FSD Core team, we decided that new projects should no longer be encouraged to actively adopt the Widgets layer. This does not mean that the Widgets layer is being removed or prohibited. Existing projects that already use Widgets without significant issues do not need to change their structure. The layer can still be retained when it fits the needs of the project.

The Widgets layer was originally intended for independent UI blocks that compose multiple entities and features. In real frontend applications, however, UI blocks rarely handle presentation alone. They often include data fetching, state management, event handling, and other logic related to user flows. As a result, the responsibilities of the Features layer and the Widgets layer tend to overlap.

This overlap makes it difficult to decide whether a particular piece of code belongs in Features or Widgets. As a project grows, the boundary between the two layers can become even less clear.

For this reason, the updated documentation removes Widgets from the default layer structure. Most code that would previously have been placed in Widgets should instead be organized in Features around user flows and actions. Depending on its responsibility, some code may also belong in App when it is related to application-wide composition or initialization. Code that is reusable and independent of business context may belong in Shared.

There are still cases where Widgets previously provided a natural place for composing multiple Features into a complex UI flow. In these situations, the documentation will recommend considering other composition approaches first. This may include composing the Features in a higher layer, separating responsibilities differently, or exposing interfaces that allow each Feature to be composed externally.

The Widgets related content in the Code Smells & Issues section will remain for now. This content may still be useful for projects that already use the Widgets layer and need guidance on related problems.

Please feel free to leave a comment if you have any questions, suggestions, or concerns about this PR.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
pr-fsd ✅ Ready (View Log) Visit Preview ad7d288

@Gaic4o Gaic4o changed the title [WIP] docs: deprecate the Widgets layer [WIP] docs: discourage the Widgets layer Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant