Comments (7)
@jhildenbiddle extremely detailed response - makes total sense what you laid out. Will test out your solution and report back for
from canvas-size.
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.
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:
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)
- Memory leak HOT 15
- Tests fail on latest macOS / Safari HOT 10
- maxArea causes hard crash of Google Chrome on Samsung Galaxy S20+ HOT 5
- doesn't work on firefox HOT 1
- Test process questions HOT 1
- Performing multiple measurement on Safari for iOS will exceed memory limit HOT 7
- Chrome allows undetected 65535x1 HOT 4
- Webworker not working [chrome 84.0.4147.125/linux] HOT 5
- Webpack optimize CanvasTest error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvas-size.