Fabric.js Document Engine

Search documentation

Find a page or section

中文

Compatibility

View as Markdown

Tested browsers, Fabric.js versions and measured performance.

Every release runs the same browser test suite before it is published. This is the Fabric.js compatibility and performance picture for the 1.x line.

Supported environments

Supported in 1.x
Fabric.js6.x and 7.x
BrowsersCurrent Chromium, Firefox and WebKit (Safari), tested on every release
React18 and 19, through fabricjs-document-engine/react
Node.js18+ with Fabric.js 6, 20+ with Fabric.js 7. Importing, validation, migration, safety checks and storage adapters work; canvas features need a browser
PDFOptional jspdf 4 and svg2pdf.js 2.7 or later, for fabricjs-document-engine/pdf in the browser
Filtersfabricjs-document-engine/filters uses a module worker and OffscreenCanvas (Chrome 80, Firefox 114, Safari 16.4); older browsers run filters on the main thread in steps
Filtersfabricjs-document-engine/filters uses a module worker and OffscreenCanvas: Chrome 80, Firefox 114, Safari 16.4 or later. Elsewhere filters run in steps on the main thread
TextShapedIText and ShapedTextbox measure with the browser's own shaping, so results follow the installed fonts

Test results

ChromiumFirefoxWebKit (Safari engine)Node
Fabric.js 7.4Full suite passesFull suite passesFull suite passesImports, validation and migration pass
Fabric.js 6.9Full suite passesNot run separatelyNot run separatelyImports, validation and migration pass
  • The browser suite covers ids, save and load, history, safe saving, assets and fonts, recovery with IndexedDB, export, versions, migration, React, cancellation, custom objects and safety limits.
  • Fabric.js 6 and Fabric.js 7 use different default origins. Documents always store originX and originY, so a file saved with one opens correctly with the other.
  • WebKit cannot store Blob values in IndexedDB. Recovery copies keep image data as bytes, so recovery works in Safari too.

Performance

Measured with 5,000 objects (60% rectangles, 20% circles, 10% text boxes, 10% groups). The slowest browser is shown.

StepTargetWorst measured
Record one undo step after a move50 ms27 ms
A transaction restyling one object50 ms29 ms
Undo one step50 ms28 ms
Save to memory storage50 ms29 ms
Load a document1,000 ms828 ms
Checks before export50 ms22 ms

Export time is almost all Fabric.js's own rendering and the browser's image encoder. A regression test with 2,000 objects runs in every browser, so a large slowdown fails the build.

Memory

  • Undo keeps at most 100 steps and 64 MB of object data by default. Each step stores only the objects that changed.
  • Recovery keeps one copy per document, removed once a save covers every change.
  • Imported documents are limited to 50,000 objects and 100 levels of nesting.
  • Loading creates objects 100 at a time and checks six images at once, each for at most 30 seconds.
  • renderDocuments keeps two off-screen canvases by default and frees each document's objects and cache canvases after it.

Fabric.js problems the engine works around

Each one was reproduced on Fabric.js 6.9 and 7.4, and a test guards the workaround.

Problem in Fabric.jsIssueWhat the engine does
No PDF export#5906PDF export
Curved text in SVG ignores pathAlign and draws lines straight#6958SVG export
SVG exports link to images by URL#1980svg.embedImages
Imported SVG moves when elements lie outside the viewBox#10916SVG import
Large documents block the page while they load#9632Loading in chunks, with progress
A failed image gives no reason#11074failure.reason on every missing image
Cloned groups and selections land in the wrong place#2974createClipboard
dispose() does not free canvas memory in browsers#4848renderDocuments frees canvases itself
Textbox grows past its width with long words#2376BoundedTextbox
No vertical text#511VerticalText
Cursor drifts in Arabic and with ligatures#4815ShapedIText
Android keyboards put text and styles in the wrong place#6588attachMobileTextInput
Changing text from code leaves styles on old letters#6133createTextCommands
Imported SVG loses its groups#899preserveGroups
Image filters freeze the page#9532Filters in a worker
Every frame redraws every object#9847Dirty regions

Full measurements for each browser are in the compatibility results on GitHub. The Fabric.js compatibility promises for 1.x are summarized on the releases page.

Fabric.js compatibility | Fabric.js Document Engine