decaporg / decaporg/decap-cms

Types for registerWidget don't match the implementation

Open
#7,410 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**

The types for `registerWidget` only specify a single signature, but the implementation allows two additional ways of registering widgets, which are both actively used throughout the codebase.

**Why this matters**

Currently, `decap-cms-app` registers all widgets eagerly at once, which results in very large bundle sizes. I would like to provide an alternative, more modular approach, but this requires the types to match in the first place.

**What to do**

Stay tuned for a PR or possibly an update to #7402

Contributor guide

Open the contributing guide

Research direction

Start at the registerWidget type declaration and implementation, then inspect the existing usages throughout the codebase. Done means the types represent all three registration forms supported by the implementation and those current usages type-check successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.