Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor]: remove unused codes in util/propTypes #2288

Merged
merged 1 commit into from Jan 5, 2020

Conversation

@golopot
Copy link
Contributor

golopot commented May 25, 2019

UnionTypeDefinition.children had a inconvenient type unknown[]|true. It turned out children === true never happens, so the related codes can be removed.

 - remove useless handling of `instanceOf` and `oneOf`

There is no special treatment of `Proptypes.{instanceOf, oneOf}` types
so they might as well be handled as unrecognized types.
};
for (let i = 0, j = annotation.types.length; i < j; i++) {
const type = buildTypeAnnotationDeclarationTypes(annotation.types[i], parentName, seen);
// keep only complex type

This comment has been minimized.

Copy link
@ljharb

ljharb May 25, 2019

Collaborator

can you track down why this was added in the first place? it seems like something that might be important.

This comment has been minimized.

Copy link
@golopot

golopot May 28, 2019

Author Contributor

children === true comes from b8e0a4e . But it does not help me understand why it is needed.

This comment has been minimized.

Copy link
@ljharb

ljharb Dec 13, 2019

Collaborator

cc @phpnode any insight here?

This comment has been minimized.

Copy link
@phpnode

phpnode Jan 4, 2020

Contributor

no recollection, sorry :(

@ljharb
ljharb approved these changes Jan 5, 2020
@ljharb ljharb force-pushed the golopot:simplify-union-type branch from 011d7b0 to d02bb9a Jan 5, 2020
@ljharb ljharb merged commit d02bb9a into yannickcr:master Jan 5, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.007%) to 97.556%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.