npm / earcut
earcut
What changed in earcut 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
3 breaking1 new APIs and options5 performance1 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initearcut 315 changes
Breaking changes 3
The package is published as an ES module and no longer supports CommonJS; use v2.2.4 if you need compatibility.
The legacy UMD browser bundle exposes the main function as
earcut.default.Modern ES syntax drops IE11 support; developers can transpile on their end to keep support.
New APIs and options 1
Adds a function that refines an arbitrary triangulation, including earcut output, into a constrained Delaunay triangulation, improving triangulation quality at a small runtime and bundle-size cost.
Performance 5
Adds a small microoptimization for big input.
Speeds up refine slightly.
Improves refine performance; the reported regression changes from +50% to +38%.
Performance improves by another 6%.
Triangulation of large polygons with holes is significantly faster; the representative fixture drops from ~1000 ms to ~475 ms.
Tooling 1
Adds first-class TypeScript types via strict JSDoc.
Fixes and other changes 5
Fixes cases where deviation worked incorrectly for zero-area polygons.
Fixes a v3.2 regression that retained more memory than necessary in some cases.
Fixes an edge case that could cause an infinite loop on near-cocircular points.
Fixes cases where refine leaves quads in a non-Delaunay state.
Fixes edge cases where hole self-tangencies could produce incorrect triangulation.