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

Fabric update new canvas, new jsdom #5356

Merged
merged 27 commits into from
Mar 9, 2019
Merged

Fabric update new canvas, new jsdom #5356

merged 27 commits into from
Mar 9, 2019

Conversation

asturur
Copy link
Member

@asturur asturur commented Oct 29, 2018

  • update jsdom to 13
  • update canvas to 2
  • remove node 4 and 6
  • remove xmldom since JSDOM now parses XMLs too
  • update test to take care of how JSDOM request resources now
  • update visual test loop to create a new canvas and dispose it each test
  • update visual test code to do not use the requestRenderCallback
  • added NODE 11 to test matrix
  • removed allowed failures, since today all test have to pass in node as in browser
  • swapped istanbul with nyc
  • updated qunit to latest 2.9.2

package.json Outdated
@@ -60,8 +60,8 @@
"testem:ci": "testem ci"
},
"optionalDependencies": {
"canvas": "^1.6.12",
"jsdom": "^9.12.0",
"canvas": "^2.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Canvas 2.0 has some breaking changes

Copy link
Member Author

Choose a reason for hiding this comment

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

i know i know, did not read yet how to interact with new jsdom. Canvas is transparent for us

@Rosga
Copy link

Rosga commented Feb 16, 2019

This is how I use [email protected] and [email protected] in my project based an fabric.

const jsdom = require('jsdom');
const virtualWindow = new jsdom.JSDOM(
  decodeURIComponent('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E'),
  {
    features: {
      FetchExternalResources: ['img']
    },
    resources: "usable"
  }).window;
fabric.document = virtualWindow.document;
fabric.jsdomImplForWrapper = require('jsdom/lib/jsdom/living/generated/utils').implForWrapper;
fabric.nodeCanvas = require('jsdom/lib/jsdom/utils').Canvas;
fabric.window = virtualWindow;
if (typeof DOMParser === "undefined") {
  global.DOMParser = null;
}
DOMParser = require('xmldom').DOMParser;

@asturur
Copy link
Member Author

asturur commented Feb 16, 2019

why you do not open a pr, so i can close this?

@asturur
Copy link
Member Author

asturur commented Mar 3, 2019

So far so good, we are currently stopped by jsdom/jsdom#2503

If they fix this bug, we can migrate.

@asturur
Copy link
Member Author

asturur commented Mar 3, 2019

moved to jsdom 13.1
This could allow us to move forward.

@asturur
Copy link
Member Author

asturur commented Mar 3, 2019

ok we have a green build but node tests ( previously marked as possibly fail ) fail harder than before.
I would like to keep the same level of confidence, so just need a little more look.

@asturur asturur merged commit 09811bd into master Mar 9, 2019
@asturur asturur mentioned this pull request May 19, 2019
@asturur asturur deleted the fabric-update-3.x branch May 19, 2019 19:30
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants