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

ImageMapster does not work with Zepto #339

Closed
techfg opened this issue Jan 20, 2021 · 0 comments · Fixed by #340
Closed

ImageMapster does not work with Zepto #339

techfg opened this issue Jan 20, 2021 · 0 comments · Fixed by #340
Labels

Comments

@techfg
Copy link
Collaborator

techfg commented Jan 20, 2021

Describe the bug
When attempting to use IM with Zepto, several issues are encountered. In reviewing the lineage of Zepto support, it is not clear if it ever worked 100% but maintenance of Zepto support seemed to taper off around version 1.2.5 according to the Zepto Compatibility section of the readme.

It does not appear that Zepto is actively maintained any more so the focus of resolving these issues will target Zepto 1.2.0 (the latest version) only. Additionally, support for Zepto will likely be dropped as of ImageMapster 2.0 as the IM roadmap calls for IM to become a Native JS library with jQuery becoming a secondary usage option.

To Reproduce
Steps to reproduce the behavior:

  1. UMD Wrapper does not detect Zepto
    1. Execute grunt zepto to generate Zepto build
    2. Configure tests to use Zepto
    3. Open test runner page
    4. Encounter Uncaught ReferenceError: jQuery is not defined
  2. Change jquery.imagemapster.zepto.js to pass Zepto in to factory instead of jQuery for browser globals (factory(Zepto);)
  3. Passive event listener detection throws exception
    1. Open test runner page
    2. Encounter Uncaught TypeError: Cannot set property 'touchstart' of undefined
  4. Change jquery.imagemapster.zepto.js to bypass detecting passive listeners because Zepto does not support special events by wrapping jqueryextensions.js module with if (!window.Zepto) { ... } conditional
  5. Open test runner page
  6. Encounter Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '[object Object]'
  7. The issues at this point just keep mounting :(

Expected behavior
IM fully supports Zepto v1.2.0 and no errors/exceptions are encountered.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

techfg added a commit that referenced this issue Jan 21, 2021
techfg added a commit that referenced this issue Jan 21, 2021
Fix event listeners & zepto
Resolves #338, Resolves #339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant