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.js | 6.x and 7.x |
| Browsers | Current Chromium, Firefox and WebKit (Safari), tested on every release |
| React | 18 and 19, through fabricjs-document-engine/react |
| Node.js | 18+ with Fabric.js 6, 20+ with Fabric.js 7. Importing, validation, migration, safety checks and storage adapters work; canvas features need a browser |
Optional jspdf 4 and svg2pdf.js 2.7 or later, for fabricjs-document-engine/pdf in the browser | |
| Filters | fabricjs-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 |
| Filters | fabricjs-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 |
| Text | ShapedIText and ShapedTextbox measure with the browser's own shaping, so results follow the installed fonts |
Test results
| Chromium | Firefox | WebKit (Safari engine) | Node | |
|---|---|---|---|---|
| Fabric.js 7.4 | Full suite passes | Full suite passes | Full suite passes | Imports, validation and migration pass |
| Fabric.js 6.9 | Full suite passes | Not run separately | Not run separately | Imports, 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
originXandoriginY, so a file saved with one opens correctly with the other. - WebKit cannot store
Blobvalues 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.
| Step | Target | Worst measured |
|---|---|---|
| Record one undo step after a move | 50 ms | 27 ms |
| A transaction restyling one object | 50 ms | 29 ms |
| Undo one step | 50 ms | 28 ms |
| Save to memory storage | 50 ms | 29 ms |
| Load a document | 1,000 ms | 828 ms |
| Checks before export | 50 ms | 22 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.
renderDocumentskeeps 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.js | Issue | What the engine does |
|---|---|---|
| No PDF export | #5906 | PDF export |
Curved text in SVG ignores pathAlign and draws lines straight | #6958 | SVG export |
| SVG exports link to images by URL | #1980 | svg.embedImages |
| Imported SVG moves when elements lie outside the viewBox | #10916 | SVG import |
| Large documents block the page while they load | #9632 | Loading in chunks, with progress |
| A failed image gives no reason | #11074 | failure.reason on every missing image |
| Cloned groups and selections land in the wrong place | #2974 | createClipboard |
dispose() does not free canvas memory in browsers | #4848 | renderDocuments frees canvases itself |
| Textbox grows past its width with long words | #2376 | BoundedTextbox |
| No vertical text | #511 | VerticalText |
| Cursor drifts in Arabic and with ligatures | #4815 | ShapedIText |
| Android keyboards put text and styles in the wrong place | #6588 | attachMobileTextInput |
| Changing text from code leaves styles on old letters | #6133 | createTextCommands |
| Imported SVG loses its groups | #899 | preserveGroups |
| Image filters freeze the page | #9532 | Filters in a worker |
| Every frame redraws every object | #9847 | Dirty 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.