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

Demo lags? #1715

Closed
OmgImAlexis opened this issue Jul 18, 2021 · 2 comments · Fixed by marko-js/website#63
Closed

Demo lags? #1715

OmgImAlexis opened this issue Jul 18, 2021 · 2 comments · Fixed by marko-js/website#63
Labels
type:unverified bug A bug report that has not been verified

Comments

@OmgImAlexis
Copy link

Marko Version: x.x.x

Not sure as it's on the main website.

Details

I was trying the demo out.

Expected Behavior

The demo to at least be performant enough to handle rapid clicks from the user.

Actual Behavior

The demo lags to the point of it showing clicks when my cursor wasn't even on the button.

Possible Fix

Not sure?

Your Environment

  • Environment name and version (e.g. Chrome 39, node.js 5.4): N/A
  • Operating System and version (desktop or mobile): Safari 14.1 on macOS 11.3.1.
  • Link to your project: N/A

Steps to Reproduce

  1. Goto https://markojs.com
  2. Scroll down to the example
  3. Click a bunch on the button
  4. Profit?
broken_makojs.mp4
@OmgImAlexis OmgImAlexis added the type:unverified bug A bug report that has not been verified label Jul 18, 2021
@taylor-hunt-kr
Copy link

Can confirm this happens in Safari — on the same machine in Firefox, runs smoothly.

If I add visibility:hidden to the two DOM-powered animations in the sections beneath, Safari has no problem. Looking at those animations, they’re doing things like modifying width instead of transform, which is almost certainly tying up the main thread with reflow.

@tigt
Copy link
Contributor

tigt commented Jul 21, 2021

Also can confirm this does not happen in Chrome, so seems specific to Safari.

Some futzing around in DevTools suggests the fix is to animate transform: scaleX() on <div.demo-page-progress/> instead of width:

The parts that pop in already use opacity for showing/hiding, so they’re already GPU-accelerated. I made this PR to fix it: marko-js/website#63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:unverified bug A bug report that has not been verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants