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

Misc Update #2

Merged
merged 11 commits into from Feb 19, 2016
Merged

Misc Update #2

merged 11 commits into from Feb 19, 2016

Conversation

aldendaniels
Copy link
Collaborator

I forked zan and made a variety of changes to support my use-case. Changes include:

  1. Update custom error messages to match the React PropType form
  2. Support chaining type.isOptional.isRequired.isOptional...
  3. Add static inspection methods to types: inspectIsOptional() and inspectArgs()
  4. Rename createCustomChecker() to createSimpleChecker(). Add .isOptional handling and inspection methods.
  5. Add createCustomChecker() method that makes it easy to add .isOptional handling and inspection methods to custom type checkers. Used internally for exactShape().

If you'd like to merge these changes then please review. Once reviewed, I'll also update the documentation. Otherwise I'm happy to work off my fork.

 Also:
  - Allow replacing `zan check` with custom text
  - Make error message in custom checkers match react built-in
PropTypes.node is quite useful, so we shouldn't override this with element.
Rename old createCustomChecker() method to createSimpleChecker()
Also add createCustomCheckerCreator method
... Since this is not handled outside
@kolodny
Copy link
Owner

kolodny commented Feb 16, 2016

looks good, I want to take a closer look before I merge

@aldendaniels
Copy link
Collaborator Author

👍 Look forward to hearing your feedback

On Tuesday, February 16, 2016, Moshe Kolodny notifications@github.com
wrote:

looks good, I want to take a closer look before I merge


Reply to this email directly or view it on GitHub
#2 (comment).

Sent from my iPhone

@aldendaniels
Copy link
Collaborator Author

@kolodny - Any timeframe for when you'll be able to get to this. I'm going to be publishing a library that depends on the updated version of zan, but would like to hold off until this is reviewed and merged.

@kolodny kolodny merged commit 1510940 into kolodny:master Feb 19, 2016
kolodny added a commit that referenced this pull request Feb 19, 2016
@kolodny
Copy link
Owner

kolodny commented Feb 19, 2016

Sorry, I meant to get around to this sooner, this looks great. Thanks!

It's published to 3.0.0

@aldendaniels
Copy link
Collaborator Author

@kolodny Thanks! This is great. Note, however, that the docs are now outdated.

@kolodny
Copy link
Owner

kolodny commented Feb 19, 2016

That's true, do you want to work on that?

@aldendaniels
Copy link
Collaborator Author

@kolodny Yeah, I'm fine making the update. Would you consider making me a contributor to the repo so I can do so on a branch? I won't merge w/out review.

@kolodny
Copy link
Owner

kolodny commented Feb 19, 2016

Done!

@aldendaniels
Copy link
Collaborator Author

👍

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.

None yet

2 participants