Coder Social home page Coder Social logo

Comments (7)

followbl avatar followbl commented on May 29, 2024 1

@jhildenbiddle extremely detailed response - makes total sense what you laid out. Will test out your solution and report back for 💩 's and giggles

from canvas-size.

jhildenbiddle avatar jhildenbiddle commented on May 29, 2024

Thanks for filing the issue, @followbl. Happy to take a look at this. Let me see what I come up with over the weekend and I'll report back.

from canvas-size.

jhildenbiddle avatar jhildenbiddle commented on May 29, 2024

Apologies for the delayed response, @followbl.

In my limited testing with the Pixel 5 VM on BrowserStack I experienced inconsistent results: both the JSBin and CodeSandbox demos failed and completed successfully when reloaded several times. Here are the results of my testing:

🎉 Test 1: PASS (Pixel 5 VM + JSBin demo)

pixel5-1

⚠️ Test 2: FAIL (Pixel 5 VM + Codesandbox demo)

pixel5-2

🎉 Test 3: PASS (Pixel 5 VM + Codesandbox demo)

pixel5-3

Given these inconsistent results, my assumption would have been that the Browserstack VM is not as reliable as testing on real hardware. Since your users are experiencing issue on real hardware I can only assume that platform itself is unstable when rendering large canvas elements. This isn't totally unexpected given the hardware limitations on mobile devices and the RAM requirements of rendering large in-memory canvas elements.

Fortunately, there is an easy fix: limit the maximum canvas size used for testing. Since this issue is only affecting mobile devices, use the mobile test results available in the README.md to find a suitable max value.

const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

const canvasLimitation = await canvasSize.maxArea({
  max: isMobile ? 8192 : null,
  usePromise: true,
  useWorker: false,
});

Using this approach I was able to reload a modified JSBin demo multiple times without issue.

Hope this helps!

from canvas-size.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.