-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Add react-is package #12199
Merged
Merged
Add react-is package #12199
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
12d7a8c
Authoritative brand checking library
sebmarkbage f44c668
Patched up react-is and added some tests and docs
bvaughn 0f92bd3
Updated react-is version number to mirror other packages
bvaughn c91ef08
Fix export for tests
bvaughn 78c264d
Prettier
bvaughn cbffbd1
Add umd files to package
bvaughn 88d1dd4
typeOf returns symbols; symbols exported for switch/case
bvaughn b8f67c2
README tweaks
bvaughn 784fffc
Added broader isElement() tests
bvaughn 7b060d3
Replaced default exports with named exports
bvaughn 70bccd8
Added results.json
bvaughn b4ff653
Updated README
bvaughn 54588e4
Removed UMD target from react-is bundle
bvaughn 21a64bd
Documentation nits
bvaughn a06e6f7
Re-enabled UMD build for react-is
bvaughn b22a7b7
Made fragment/async/strict mode checks more strict
bvaughn ef0a900
Adjusted typeOf() to be more efficient
bvaughn f111111
Added a couple of additional tests
bvaughn 9c8385c
Removed unnecessary, nested not-null check
bvaughn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prettier
- Loading branch information
commit 78c264d14acf8a273f1da51371a2e3c2766bdf08
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this correctly right away since it's not a legacy package.
Let's remove the default export here and only provide named exports. That's how we make it work with tree shaking, too (when we provide an ES build output).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, I'm saying this file shouldn't need to use CommonJS at all. Just re-export
*
from the source.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Okay.
I'm curious: Why didn't we follow that pattern with other new packages (like
react-reconciler
)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was some reason but I don't remember straight away.
It's not very important in case of the reconciler though because it provides just one function.
react-is
, on the other hand, provides a bunch, and is expected to grow.Call/Return does avoid the
.default
hack:react/packages/react-call-return/index.js
Line 12 in 29e8924
If there's some issue with top-level ES import (maybe there was) then the above is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. This makes sense. Thanks for the suggestion. 😄
It's been updated.