v5.0.0 #50
rgrove
announced in
Announcements
v5.0.0
#50
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
parse-xml is now an ES module. The API is completely unchanged, but the package format and the minimum supported Node.js version have changed. See below for details.
Breaking Changes
parse-xml is now an ES module. The package sets
"type": "module"and ships ESM rather than CommonJS.If you already use
import, you don't need to change anything:Using
require()also still works in Node.js 22+ thanks torequire(esm):There are two cases that will require a change: bundlers or runtimes that can't resolve ESM at all will no longer work, and if your own project is CommonJS and written in TypeScript, you'll need TypeScript 5.8 or later with
"module": "nodenext". Older versions of TypeScript and configs using"module": "node16"don't supportrequire(esm)and will report an error.Node.js 22.12.0 is now the minimum supported version (up from 14.0.0, which hadn't actually been tested in some time).
The package now has an
exportsmap, so only its public API can be imported. The root entry and theXml*node classes are unaffected:But
Parser,StringScanner,syntax, andtypesare no longer importable. These were never documented as public or exported from the package's entry point so this is unlikely to affect most people.The browser bundle at
dist/browser.jsis now ESM rather than CommonJS. This is the file bundlers pick up via thebrowserfield, so it should be transparent. As an added bonus, it's also 1.1 KB smaller now.The minified global bundle at
dist/global.min.jsis unchanged, so loading parse-xml from a CDN with a<script>element and using theparseXmlglobal works exactly as before.Other Changes
Full Changelog: v4.2.3...v5.0.0
This discussion was created from the release v5.0.0.
All reactions