Skip to content

✨ Bento amp-image-slider#35783

Merged
dethstrobe merged 98 commits intoampproject:mainfrom
rtCamp:add/bento/amp-image-slider
Apr 12, 2022
Merged

✨ Bento amp-image-slider#35783
dethstrobe merged 98 commits intoampproject:mainfrom
rtCamp:add/bento/amp-image-slider

Conversation

@AnuragVasanwala
Copy link
Copy Markdown
Contributor

@AnuragVasanwala AnuragVasanwala commented Aug 24, 2021

Goal of the PR is to create Bento amp-image-slider.

Checklist

  • Add amp-image-slider
  • Add types
  • Add type annotations
  • Add test case
  • Add npm: true and wrapper : "bento" to bundles.config.extension.json
  • Update Storybook - AMP and Preact
  • latestVersion precedes options
  • Lint, Prettify new amp-image-slider

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 26, 2021

This pull request introduces 2 alerts when merging ae4a181 into 84ce446 - view on LGTM.com

new alerts:

  • 2 for Variable not declared before use

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 1, 2021

This pull request introduces 2 alerts when merging 41dc19f into 9779166 - view on LGTM.com

new alerts:

  • 2 for Variable not declared before use

@caroqliu caroqliu self-requested a review September 7, 2021 14:32
AnuragVasanwala and others added 13 commits September 8, 2021 18:21
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Services should not be used in the Preact component.

Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-Authored-By: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
@caroqliu caroqliu self-requested a review September 15, 2021 19:56
Preact component should not be creating any elements with DOM APIs. Preferring JSX instead. This is an experimental code for my storybook test.
Comment on lines +377 to +380
unlisten(unlistenMouseMove?.current);
unlisten(unlistenMouseUp?.current);
unlistenMouseMove.current = listen(window, 'mousemove', onMouseMove);
unlistenMouseUp.current = listen(window, 'mouseup', onMouseUp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you just instantly assigning the ref, why unlist it beforehand?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have ported this logic from the 0.1 version component.

// In case, clear up remnants
// This is to prevent right mouse button down when left still down
this.unlisten_(this.unlistenMouseMove_);
this.unlisten_(this.unlistenMouseUp_);
this.unlistenMouseMove_ = listen(
this.win,
'mousemove',
this.onMouseMove_.bind(this)
);
this.unlistenMouseUp_ = listen(
this.win,
'mouseup',
this.onMouseUp_.bind(this)
);

I have updated the above logic with this one.

if ( unlistenMouseMove.current === null ) {
  unlistenMouseMove.current = listen(window, 'mousemove', onMouseMove);
}
if ( unlistenMouseUp.current === null ) {
  unlistenMouseUp.current = listen(window, 'mouseup', onMouseUp);
}

Please guide me If I am missing anything

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dethstrobe Please let us know if we are missing something.

@AnuragVasanwala
Copy link
Copy Markdown
Contributor Author

AnuragVasanwala commented Apr 6, 2022

Hi @dethstrobe 👋🏻

Would you please review this PR and provide necessary feedback.

Also, to resolve CircleCI dependency check, I have added src/service/timer-impl.js to allowList for extensions/amp-image-slider/1.0/component.js.

src/service/timer-impl.js is required for Gesture Service, otherwise calling to Gesture.get() results in following error:

Uncaught Error: Expected service timer to be registered

Please let me know if I am missing something.

Commit Ref: ee9efef

@dethstrobe dethstrobe requested a review from caroqliu April 12, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants