diff --git a/.changeset/typescript-esm-only.md b/.changeset/typescript-esm-only.md deleted file mode 100644 index 55d134a1e..000000000 --- a/.changeset/typescript-esm-only.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"react-element-to-jsx-string": major ---- - -Convert the source code from Flow to TypeScript and publish the package as an ES module only. - -**Breaking changes** - -- The package is published as an ES module only, and the CommonJS build is removed. CommonJS code can still `require()` it and read the default export from `.default`: - - ```js - const reactElementToJSXString = require("react-element-to-jsx-string").default; - ``` - -- Node.js 24 or later is required. In browsers, the code targets ES2020. -- Flow type definitions (`.js.flow` files) are no longer published. - -**Other changes** - -- TypeScript types are generated from the source and included in the package, replacing the hand-written `index.d.ts`. The `Options` type is still exported, and `inlineFunction` and `preserveFunctionLineBreak` are now typed too. -- An invalid date nested in an object or array prop is printed as `Invalid Date` instead of throwing an error. -- An object created with `Object.create({})` is no longer formatted as a plain object. diff --git a/CHANGELOG.md b/CHANGELOG.md index bab61f913..f2b2beca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # react-element-to-jsx-string +## 19.0.0 + +### Major Changes + +- 62db2f7: Convert the source code from Flow to TypeScript and publish the package as an ES module only. + + **Breaking changes** + + - The package is published as an ES module only, and the CommonJS build is removed. CommonJS code can still `require()` it and read the default export from `.default`: + + ```js + const reactElementToJSXString = require("react-element-to-jsx-string").default; + ``` + + - Node.js 24 or later is required. In browsers, the code targets ES2020. + - Flow type definitions (`.js.flow` files) are no longer published. + + **Other changes** + + - TypeScript types are generated from the source and included in the package, replacing the hand-written `index.d.ts`. The `Options` type is still exported, and `inlineFunction` and `preserveFunctionLineBreak` are now typed too. + - An invalid date nested in an object or array prop is printed as `Invalid Date` instead of throwing an error. + - An object created with `Object.create({})` is no longer formatted as a plain object. + # [18.0.0](https://github.com/algolia/react-element-to-jsx-string/compare/v17.0.1...v18.0.0) (2026-10-07) diff --git a/package.json b/package.json index a4b6aa7b5..89e36fecf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-element-to-jsx-string", - "version": "18.0.0", + "version": "19.0.0", "description": "Turn a ReactElement into the corresponding JSX string.", "packageManager": "pnpm@12.9.1", "type": "module",