Major
-
Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0
. -
Added a new
is-plain-obj
dependency that is ESM. -
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
-
Public modules are now individually listed in the package
files
andexports
fields. -
Removed
./package
from the packageexports
field; the fullpackage.json
filename must be used in arequire
path. -
Removed the package main index module; deep imports must be used.
-
Shortened public module deep import paths, removing the
/public/
. -
The API is now ESM in
.mjs
files instead of CJS in.js
files, accessible viaimport
but notrequire
. -
Implemented TypeScript types via JSDoc and
@deno-types
comments, fixing #7. -
Changed the function
extractFiles
parameters. The previously thirdisExtractableFile
parameter has been renamedisExtractable
, is now the second parameter, and no longer defaults to the functionisExtractableFile
to avoid a redundant import when a custom function is specified. -
The function
extractFiles
now does basic runtime argument type validation. -
The function
extractFiles
now also deep clones “plain” objects that aren’tObject
instances (e.g.Object.create(null)
). -
Removed out of the box React Native support. The class
ReactNativeFile
is no longer exported, or matched by the functionisExtractableFile
.This class was bloating non React Native environments with an extra module, increasing bundle sizes when building and adding an extra step to ESM loading waterfalls in browsers.
It’s the responsibility of Facebook to adhere to web standards and implement spec-complaint
File
,Glob
, andFormData
globals in the React Native environment.In the meantime, React Native projects can manually implement a class
ReactNativeFile
and match it with a custom functionisReactNativeFile
for use with the functionextractFiles
.
Patch
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Check TypeScript types via a new package
types
script. - Removed the
jsdoc-md
dev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section. - Reorganized the test file structure.
- Test the bundle sizes for public modules individually.
- Use a new
assertBundleSize
function to assert module bundle size in tests:- Failure message contains details about the bundle size and how much the limit was exceeded.
- Errors when the surplus is greater than 25% of the limit, suggesting the limit should be reduced.
- Resolves the minified bundle and its gzipped size for debugging in tests.
- Fixed an
extractFiles
function test bug. - Added an
extractFiles
function test clarifying that object properties withSymbol
keys don’t get cloned. - Configured Prettier option
singleQuote
to the default,false
. - Updated the package description.
- Documentation tweaks.
- Added a
license.md
MIT License file, fixing #19 via #20. - Amended the changelog entry for v10.0.0.