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

v0.3.0 #7

Merged
merged 17 commits into from
Mar 24, 2024
Merged

v0.3.0 #7

merged 17 commits into from
Mar 24, 2024

Conversation

niklasramo
Copy link
Owner

@niklasramo niklasramo commented Mar 21, 2024

This update is a big overhaul in all areas of the library. There are multiple breaking changes.

Summary

  • Update dependencies. Most notably Eventti and Tikki were bumped to their latest major versions, which cause breaking changes.
  • Update tests and karma config.
  • Update GitHub workflows.
  • Update docs.
  • Add new utility: createSnapModifier.
  • Update Sensor interface to match the new Eventti API.
  • Restructure the Draggable, DraggableDrag and DraggableDragItem internals. This also means some breaking changes as some props were renamed and moved around.

Breaking Changes

  • As Eventti dependency was bumped from 3.0.0 to 4.0.0 we can't anymore use the existing API as is for unbinding event listeners. Eventti doesn't allow anymore unbinding a listener with the listener reference only, it requires you to provide the listener id always. However, if you use the listener as the listenerId when binding the listener then you can unbind the listener using the listener reference also, just like before. This is a breaking change however and it reflects to all on and off APIs throughout the library (including the Sensor interface). This is a step towards a more strict and predictable event emitter pattern so I like to believe the change is justified.
  • DraggableDragItem properties pX and pY were removed in favour of position property which has x and y properties.
  • DraggableDragItem properties x and y were removed in favour of clientRect property, which is an object that has left, top, width, height properties.
  • We are now using cached client rect width and height instead of computing it on every frame during auto scrolling. The cached dimensions are stored in DraggableDragItem's clientRect property (width and height).
  • DraggableDrag properties were renamed:
    • nextMoveEvent -> event
    • prevMoveEvent -> prevEvent
  • DraggableDrag isStarted property was removed as it's not needed anymore.

@niklasramo niklasramo merged commit eeaa462 into main Mar 24, 2024
1 check passed
@niklasramo niklasramo deleted the dev branch March 24, 2024 21:29
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