Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flatten React-DnD Directory Structure (#3038)
* 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
- Loading branch information
1 parent
120a6bf
commit 0f6e8c5
Showing
75 changed files
with
2,993 additions
and
1,716 deletions.
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
Binary file removed
BIN
-33.4 KB
.yarn/cache/react-shallow-renderer-npm-16.14.1-b8a4f845ff-d52cb869e2.zip
Binary file not shown.
Binary file removed
BIN
-306 KB
.yarn/cache/react-test-renderer-npm-17.0.1-21555db1f4-6ec269430b.zip
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
releases: | ||
dnd-core: major | ||
react-dnd: major | ||
react-dnd-documentation: major | ||
react-dnd-examples-decorators: major | ||
react-dnd-examples-hooks: major | ||
react-dnd-html5-backend: major | ||
react-dnd-test-backend: major | ||
react-dnd-test-utils: major | ||
react-dnd-touch-backend: major |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
35 changes: 6 additions & 29 deletions
35
packages/dnd-core/src/DragDropManagerImpl.ts → ...d-core/src/classes/DragDropManagerImpl.ts
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
10 changes: 5 additions & 5 deletions
10
packages/dnd-core/src/DragDropMonitorImpl.ts → ...d-core/src/classes/DragDropMonitorImpl.ts
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { DragDropManagerImpl } from './classes/DragDropManagerImpl' | ||
import { DragDropManager, BackendFactory } from './interfaces' | ||
import { createStore, Store } from 'redux' | ||
import { reduce, State } from './reducers' | ||
import { DragDropMonitorImpl } from './classes/DragDropMonitorImpl' | ||
import { HandlerRegistryImpl } from './classes/HandlerRegistryImpl' | ||
|
||
export function createDragDropManager( | ||
backendFactory: BackendFactory, | ||
globalContext: unknown = undefined, | ||
backendOptions: unknown = {}, | ||
debugMode = false, | ||
): DragDropManager { | ||
const store = makeStoreInstance(debugMode) | ||
const monitor = new DragDropMonitorImpl(store, new HandlerRegistryImpl(store)) | ||
const manager = new DragDropManagerImpl(store, monitor) | ||
const backend = backendFactory(manager, globalContext, backendOptions) | ||
manager.receiveBackend(backend) | ||
return manager | ||
} | ||
|
||
function makeStoreInstance(debugMode: boolean): Store<State> { | ||
// TODO: if we ever make a react-native version of this, | ||
// we'll need to consider how to pull off dev-tooling | ||
const reduxDevTools = | ||
typeof window !== 'undefined' && | ||
(window as any).__REDUX_DEVTOOLS_EXTENSION__ | ||
return createStore( | ||
reduce, | ||
debugMode && | ||
reduxDevTools && | ||
reduxDevTools({ | ||
name: 'dnd-core', | ||
instanceId: 'dnd-core', | ||
}), | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './interfaces' | ||
export * from './factories' | ||
export * from './createDragDropManager' |
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
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
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
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
Oops, something went wrong.