Repository navigation
⚠ BREAKING CHANGES
-
MaxRectsPacker,MaxRectsBinandOversizedElementBindefault
TtoIRectangleInputrather thanRectangle, sobins[i].rects[i]is no longer
theRectangleclass unless the caller names it.IRectangleInputjoins the public
type exports, andIBin.rectsisIRectangleInput[].- test: pin every widened input, not just the packer's
The fixture passed a coordinate-free rect through
MaxRectsPackeralone, so the
other three places this change widens —MaxRectsBin.add, theOversizedElementBin
constructor andRectangle.Clone— were not covered by any package-level check.Each of the four is now asserted, and each was measured to bite: narrowing any one of
them back (Rectangle.ClonetoIRectangle, either bin to its former constraint and
default, or the packer's default toRectangle) makesverify:packagefail under
bundler, and restoring it passes. The packer's default reports 3 errors, the other
three 1 each.- test: pin the generic on the results, not just on the inputs
The previous fixture checked the widened input contract but not the
outgoing one:sheets.rects[0].labelreads throughIRectangleInput's
index signature, which types any field asany, so it kept compiling
whenget rects()was widened toIRectangleInput[]. Measured by
widening the getter andBin.rectsin turn: the field read stayed
silent both times.Only an explicit array annotation pins the generic.
packedSheets,
binRectsandspritescover the packer's getter,Bin.rectsand a
coordinate-free custom type in one line each, and each of the three
fails verify:package on its own mutant (2, 1 and 3 errors) while the
restored build passes. -
tags: non-exclusive add() no longer assigns the first rect tag to bin.tag or emits that automatic label from save(). Read rect tags or assign bin metadata explicitly; loaded and explicit labels remain preserved.
docs(plan): record the non-exclusive tag fix pull request
docs(plan): retire the tag task as its implementation lands
-
data: preserve caller data and isolate packing snapshots (#127)
-
the exports map is exhaustive, so deep imports into the
package (maxrects-packer/dist/..., maxrects-packer/src/...) no longer resolve
and fail with ERR_PACKAGE_PATH_NOT_EXPORTED. Import the package by name,
which now resolves per format.- docs: describe both verify:package type fixtures
verify:package compiles two fixtures now: the ESM one under bundler,
node16 and nodenext, and the CommonJS .cts one under node16 and
nodenext. compatibility.md and the development.md command table read as
if both fixtures ran under all three modes.- docs: correct the deep-import and dual-package claims
The troubleshooting page said deep imports "now fail with
ERR_PACKAGE_PATH_NOT_EXPORTED in Node and TypeScript alike". That is a Node
Features
Bug Fixes
- accept the rects the guides actually pass (#131) (907b008), references #46
- accept the two-argument oversized bin construction in the types (#77) (d082270)
- clone: preserve oversized placeholder state (#126) (6c34d9e)
- data: preserve caller data and isolate packing snapshots (#127) (155757f)
- geom: serialize a rect to its public shape (#132) (fd89826), references #53
- give the published declarations explicit .js extensions (#78) (203bb96)
- guard rect.data before accessing .tag to prevent TypeError (#105) (e9359d9), references #91 #91
- keep rotated rects and their bins consistent (#76) (adcf88b)
- keep the saved free space of an oversized loaded bin (#114) (ba456a5), closes #113
- let a custom clone() keep the properties it defines (#80) (202a9f6)
- make clone() copy its rects instead of sharing them (#79) (e884d35), references #width #x
- point the README icon at an absolute URL (#120) (45cb7ce), closes #102
- replay rotated rects in the orientation the caller handed them over in (#121) (8584fe3)
- restore an oversized loaded bin at its own index (#112) (51d6cae), closes #89, references #89 #89
- restore Node CJS/ESM entry points and modernize the dev toolchain (#68) (c228385)
- restore the documented TypeScript exports and gate the suite's measurements (#75) (12a4a36), references #68
- stop calling post-ES5 runtime APIs in the published bundles (#110) (c18fd9c), closes #107, references #107
- stop invalid padding arithmetic from retrying place() forever (#122) (1c889cf), references #43
- tags: stop labelling non-exclusive bins automatically (#124) (3f0afa9)
What's Changed
- chore: modernize toolchain (oxc, TypeScript 7 side-by-side) + fix broken Node CJS entry by @soimy in #68
- chore: globalize contributor documentation and retire stale files by @soimy in #69
- build(deps): resolve the typescript alias correctly in package-lock.json by @soimy in #70
- test: migrate the test suite from jest + ts-jest to vitest 4 by @soimy in #71
- test: make the monkey tests reproducible and de-duplicate the spec bodies by @soimy in #72
- test: cover the behaviour the coverage report was hiding by @soimy in #73
- docs: record the deferred work in DEFERRED_WORK.md by @soimy in #74
- fix: restore the documented TypeScript exports and gate the suite's measurements by @soimy in #75
- fix: keep rotated rects and their bins consistent by @soimy in #76
- fix: accept the two-argument oversized bin construction in the types by @soimy in #77
- fix: give the published declarations explicit .js extensions by @soimy in #78
- fix: make clone() copy its rects instead of sharing them by @soimy in #79
- fix: let a custom clone() keep the properties it defines by @soimy in #80
- docs: track the documentation source and ignore only its build output by @soimy in #82
- docs: move the guide content into the site by @soimy in #83
- ci: build, review and deploy the documentation site by @soimy in #84
- build: retire the old TypeDoc theme and its assets by @soimy in #85
- chore: drop the gh-pages publish fallback by @soimy in #88
- ci: move the workflows to the current action majors by @soimy in #87
- fix: guard rect.data before accessing .tag to prevent TypeError by @Jah-yee in #105
- ci: keep changelog text and tag names out of the release script by @soimy in #109
- fix: stop calling post-ES5 runtime APIs in the published bundles by @soimy in #110
- test: forward Block's constructor arguments and pin the geometry by @soimy in #111
- fix: restore an oversized loaded bin at its own index by @soimy in #112
- fix: keep the saved free space of an oversized loaded bin by @soimy in #114
- test: give the efficiency table suite a load-tolerant timeout by @soimy in #115
- docs: link the deferred-work ledger to its issues by @soimy in #116
- fix: point the README icon at an absolute URL by @soimy in #120
- fix: replay rotated rects in the orientation the caller handed them over in by @soimy in #121
- fix: stop invalid padding arithmetic from retrying place() forever by @soimy in #122
- docs(ci): reconcile the completed action-major upgrade by @soimy in #125
- fix(clone): preserve oversized placeholder state by @soimy in #126
- fix(tags)!: stop labelling non-exclusive bins automatically by @soimy in #124
- test: assert add and addArray return values by @soimy in #123
- fix(data)!: preserve caller data and isolate packing snapshots by @soimy in #127
- docs: drop the unreferenced custom heading anchors by @soimy in #128
- feat!: add an exports map with per-format declarations by @soimy in #129
- build(deps): clear the four Dependabot alerts in the docs tree by @soimy in #130
- fix!: accept the rects the guides actually pass by @soimy in #131
- fix(geom): serialize a rect to its public shape by @soimy in #132
- ci: publish releases to npm through OIDC trusted publishing by @soimy in #133
- ci: mark hyphenated release tags as GitHub pre-releases by @soimy in #134
- docs: bring the release page and the guide current for 3.0.0 by @soimy in #135
- docs: add an upgrade guide for 3.0 by @soimy in #136
New Contributors
Full Changelog: v2.7.4...v3.0.0