react-component / react-component/field-form

[bug] Incorrect implement for type RecursivePartial

Open
#390 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1k
Forks
286
Avg merge
4d 16h
Merged PRs (30d)
1

Description

In file src/interface.ts ,the implement of type RecursivePartial is incorrect.

For example:

// mock nominal type
type DomainId = string & {
  readonly __nominal: unique symbol;
};
// TS 4.6  type A is {id?: undefined;} rather than {id?: DomainId}
type A = RecursivePartial<{
  id:DomainId
}>

You can find better implement in ts-essentials

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the RecursivePartial definition in src/interface.ts and compare its behavior with the ts-essentials implementation linked in the issue. Use the DomainId example from the report to check that the partial type preserves DomainId rather than reducing it to undefined; done means the reported TypeScript 4.6 result is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.