Merged
Conversation
Ethan-Arrowood
pushed a commit
to Ethan-Arrowood/react
that referenced
this pull request
Dec 8, 2017
* Reorder imports * Record sizes
NMinhNguyen
referenced
this pull request
in enzymejs/react-shallow-renderer
Jan 29, 2020
* Reorder imports * Record sizes
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I want to group package-level imports separately from imports reaching into other packages. I think this provides a better mental picture of what’s being shared between renderers. We were also sort of doing this with
fbjsanyway before, now we just have more packages.I think this is especially useful in DOM client code where there’s a mix of local DOM-specific
../eventsand globalevents/references. Same with local../sharedand globalshared/.In the past we used the “separate import” convention for lowercase modules like
isCustomElementbut I don’t see much sense in this grouping. It doesn’t convey a real semantic difference.Finally, I don’t care too strongly about this. Not enough to enforce it via lint yet. But after ES modules are done, and we don‘t have weird
requires in__DEV__blocks I’d be happy to automatically enforce it with an autofix lint rule that would run right before Prettier.I verified FB and open source bundles still work.