Version 12.0.0
Major
-
Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0. -
Added a new
is-plain-objdependency 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
filesandexportsfields. -
Removed
./packagefrom the packageexportsfield; the fullpackage.jsonfilename must be used in arequirepath. -
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
.mjsfiles instead of CJS in.jsfiles, accessible viaimportbut notrequire. -
Implemented TypeScript types via JSDoc and
@deno-typescomments, fixing #7. -
Changed the function
extractFilesparameters. The previously thirdisExtractableFileparameter has been renamedisExtractable, is now the second parameter, and no longer defaults to the functionisExtractableFileto avoid a redundant import when a custom function is specified. -
The function
extractFilesnow does basic runtime argument type validation. -
The function
extractFilesnow also deep clones “plain” objects that aren’tObjectinstances (e.g.Object.create(null)). -
Removed out of the box React Native support. The class
ReactNativeFileis 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, andFormDataglobals in the React Native environment.In the meantime, React Native projects can manually implement a class
ReactNativeFileand match it with a custom functionisReactNativeFilefor use with the functionextractFiles.
Patch
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Check TypeScript types via a new package
typesscript. - Removed the
jsdoc-mddev 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
assertBundleSizefunction 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
extractFilesfunction test bug. - Added an
extractFilesfunction test clarifying that object properties withSymbolkeys don’t get cloned. - Configured Prettier option
singleQuoteto the default,false. - Updated the package description.
- Documentation tweaks.
- Added a
license.mdMIT License file, fixing #19 via #20. - Amended the changelog entry for v10.0.0.