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

Upgrade mjolnir.js to v3 #9144

Merged
merged 6 commits into from
Sep 26, 2024
Merged

Upgrade mjolnir.js to v3 #9144

merged 6 commits into from
Sep 26, 2024

Conversation

Pessimistress
Copy link
Collaborator

Change List

  • Upgrade mjolnir.js to v3, remove postinstall hack script that fixes hammer.js
  • Update Deck class to use v3 API - mjolnir's EventManager no longer comes with preset recognizers, they need to be explicitly defined
  • tripan event is changed to multipan and requires two fingers instead of three
  • Docs & upgrade guide

@coveralls
Copy link

coveralls commented Sep 5, 2024

Coverage Status

coverage: 91.741% (+0.004%) from 91.737%
when pulling 7f45d27 on x/mjolnir-update
into aa2537b on master.

@@ -101,12 +108,27 @@ export const UNIT = {
} as const;

export const EVENTS = {
click: {handler: 'onClick'},
tap: {handler: 'onClick'},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very common event. Could changing it break apps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous version, mjolnir defined preset recognizers and some "aliases", including tap <-> click, doubletap <-> dblclick

This is no longer the case, so I guess we want to pick one that breaks less apps?

eventManager is private and apps are not supposed to attach their own event listener. A custom Controller class has the option to listen to additional events, so in theory some will see the breaking change, but I don't imagine tap/click is utilized by many.

@@ -101,12 +108,27 @@ export const UNIT = {
} as const;

export const EVENTS = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these map declarations be properly typed now with mjolnir 3? Maybe an opportunity to make a typing pass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what types we need for this particular object. It is only used by the Deck class and doesn't have anything to do with mjolnir.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, we shouldn't have untyped objects in our code base.

@Pessimistress Pessimistress merged commit bf3d4bd into master Sep 26, 2024
4 checks passed
@Pessimistress Pessimistress deleted the x/mjolnir-update branch September 26, 2024 17:38
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.

4 participants