Skip to content

Font Library: remove context completely #58428

@t-hamano

Description

@t-hamano

The original main purpose of context is to resolve redundant props passing as mentioned in this document. However, the tree of font-library-related components is not that deep, and there are many contexts that are once used and are never used.

These contexts should be able to be removed entirely by passing props or using an ad-hoc approach.

Not using a provider makes it easier to completely separate the modal dialog and the typography panel and delegate control of opening and closing modal dialog to a data store, as attempted in #58350.

Eventually, it will be easier to trigger the Font Library modal dialog via the command palette, as suggested in #54880.

The only concern, as mentioned in this comment, is that the initial state of the Font Library modal dialog is also context-managed. To solve this, we will need to add an argument to openModal in the interfaces package that defines the initial state.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions