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
Flatten React-DnD Directory Structure #3038
Merged
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## main #3038 +/- ##
==========================================
+ Coverage 40.81% 45.19% +4.38%
==========================================
Files 253 248 -5
Lines 3788 3790 +2
Branches 768 770 +2
==========================================
+ Hits 1546 1713 +167
+ Misses 2241 2076 -165
Partials 1 1
|
darthtrevino
changed the title
Refactor React-DnD's internal Package Structure
Flatten React-DnD Directory Structure
Feb 18, 2021
This was referenced Mar 15, 2021
darthtrevino
added a commit
that referenced
this pull request
Feb 3, 2022
* refactor: break out react-dnd's internal package structure * chore: cut major semver due to re-layout * fix: remove extraneous deps * fix: jest tests * chore: cut semver * fix: tsconfig updates * refactor: roll pkgs back into react-dnd using a flattened folder structure * refactor: update DragDropManager construction; fix tests/linting * chore: update semver document * ci: remove redundant build script * build: nvm * fix: top-level build steps
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.
The scope of this PR has changed quite a bit. Separate packages helped to clarify top-level concerns, but practically this is problematic. It would bifurcate whether library-authors would use
@react-dnd/core
orreact-dnd
, and resolving context types would become a nightmare. Instead this just reorganizes the existing react-dnd package around these high-level concerns and flattens the directory structure a bit.The primary driver of this refactor is separating the hooks-based API from the decorators-based API. The decorators pattern is a little flakier, but has been around much longer. It requires some dependencies that the hooks API does not. They are basically independent surface areas achieving the same thing. We will still publishreact-dnd
with both the hooks and decorator API, but these APIs will have the ability to be consumed independently of each other.New Packages:
### Public Facing@react-dnd/hooks
- The Hooks API@react-dnd/decorators
- The Decorators API@react-dnd/core
- Context Types, Provider API (required peer of hooks/decorators)### Internal@react-dnd/internal
- Common internal components (not intended for client usage)@react-dnd/types
(to eliminate dep cycle between core/internals. Re-experted by core)