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

Refactor LayoutMeasuring into MeasuringConfiguration #379

Merged
merged 2 commits into from
Jul 22, 2021

Conversation

clauderic
Copy link
Owner

@clauderic clauderic commented Jul 22, 2021

This refactor allows consumers to configure how to measure both droppable and draggable nodes.

The layoutMeasuring prop of DndContext has been renamed to measuring.

The options that could previously be passed to the layoutMeasuring prop now need to be passed as:

<DndContext
- layoutMeasuring={options}
+ measuring={{
+   droppable: options
+ }}

The LayoutMeasuring type has been renamed to MeasuringConfiguration. The LayoutMeasuringStrategy and LayoutMeasuringFrequency enums have also been renamed to MeasuringStrategy and MeasuringFrequency.

This refactor allows consumers to configure how to measure both droppable and draggable nodes. By default, @dnd-kit ignores transforms when measuring draggable nodes. This beahviour can now be configured:

import {
  DndContext,
  getBoundingClientRect,
  MeasuringConfiguration,
} from '@dnd-kit/core';
const measuringConfig: MeasuringConfiguration = {
  draggable: {
    measure: getBoundingClientRect,
  },
};
function App() {
  return <DndContext measuring={measuringConfig} />
}

This refactor allows consumers to configure how to measure both droppable and draggable nodes.
@changeset-bot
Copy link

changeset-bot bot commented Jul 22, 2021

🦋 Changeset detected

Latest commit: ed6a6c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@dnd-kit/core Major
@dnd-kit/modifiers Major
@dnd-kit/sortable Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2021

Size Change: +300 B (0%)

Total Size: 61.7 kB

Filename Size Change
packages/core/dist/core.cjs.development.js 16.3 kB +112 B (+1%)
packages/core/dist/core.cjs.production.min.js 10.3 kB +87 B (+1%)
packages/core/dist/core.esm.js 16.1 kB +101 B (+1%)
ℹ️ View Unchanged
Filename Size
packages/accessibility/dist/accessibility.cjs.development.js 640 B
packages/accessibility/dist/accessibility.cjs.production.min.js 486 B
packages/accessibility/dist/accessibility.esm.js 503 B
packages/accessibility/dist/index.js 148 B
packages/core/dist/index.js 141 B
packages/modifiers/dist/index.js 144 B
packages/modifiers/dist/modifiers.cjs.development.js 837 B
packages/modifiers/dist/modifiers.cjs.production.min.js 613 B
packages/modifiers/dist/modifiers.esm.js 760 B
packages/sortable/dist/index.js 144 B
packages/sortable/dist/sortable.cjs.development.js 3.9 kB
packages/sortable/dist/sortable.cjs.production.min.js 2.55 kB
packages/sortable/dist/sortable.esm.js 3.78 kB
packages/utilities/dist/index.js 144 B
packages/utilities/dist/utilities.cjs.development.js 1.64 kB
packages/utilities/dist/utilities.cjs.production.min.js 989 B
packages/utilities/dist/utilities.esm.js 1.54 kB

compressed-size-action

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.

1 participant