Skip to content

Commit

Permalink
update to react@18 and @cfaester/enzyme-adapter-react-18
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyAlford committed Jul 1, 2024
1 parent d57525a commit d0eede5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 49 deletions.
Binary file modified bun.lockb
Binary file not shown.
79 changes: 37 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,58 @@
"repository": "TroyAlford/react-jsx-parser",
"version": "1.29.0",
"dependencies": {
"@types/jsdom": "^16.2.6",
"acorn": "^8.0.5",
"acorn-jsx": "^5.3.1",
"browserslist": "^4.14.5",
"core-js": "^3.8.3"
"acorn": "^8.12.0",
"acorn-jsx": "^5.3.2",
"browserslist": "^4.23.1",
"core-js": "^3.37.1"
},
"devDependencies": {
"@babel/core": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/plugin-transform-typescript": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.12.13",
"@babel/runtime-corejs3": "^7.12.13",
"@babel/core": "^7.24.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-typescript": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/runtime-corejs3": "^7.24.7",
"@cfaester/enzyme-adapter-react-18": "^0",
"@happy-dom/global-registrator": "^14.12.3",
"@types/acorn": "^4.0.5",
"@types/enzyme": "^3.10.8",
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"@types/acorn": "^4.0.6",
"@types/enzyme": "^3.10.18",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"babel-loader": "^8.3.0",
"concurrently": "^5.3.0",
"cross-env": "^7.0.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.19.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^26.6.3",
"jest-cli": "^26.6.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"mkdirp": "^1.0.4",
"postinstall-postinstall": "^2.1.0",
"react": "^16",
"react-dom": "^16",
"source-map-explorer": "^2.5.2",
"terser-webpack-plugin": "^5.1.1",
"typescript": "^4.1.3",
"webpack": "^5.21.2",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2"
"react": "^18",
"react-dom": "^18",
"source-map-explorer": "^2.5.3",
"terser-webpack-plugin": "^5.3.10",
"typescript": "^4.9.5",
"webpack": "^5.92.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^3.11.3"
},
"optionalDependencies": {
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.0"
"@types/react": "^18",
"@types/react-dom": "^18"
},
"peerDependencies": {
"react": ">=17",
"react-dom": ">=17"
"react": ">=18",
"react-dom": ">=18"
},
"resolutions": {
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"browserslist": "^4.14.5",
"extend": "^3.0.2",
"merge": "^1.2.1"
Expand All @@ -84,7 +79,7 @@
"postinstall": "npx patch-package",
"prebuild": "mkdirp ./dist && rm -rf ./dist/*",
"sourcemap": "yarn build && source-map-explorer ./dist/es5/react-jsx-parser.min.js",
"test": "yarn lint && jest",
"test": "lint && test",
"types": "tsc -p ./tsconfig.json -d --emitDeclarationOnly"
},
"contributors": [
Expand Down
9 changes: 5 additions & 4 deletions source/demo.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable no-console */
import React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
// @ts-expect-error - untyped output file
import JsxParser from '../dist/umd/react-jsx-parser.min'

ReactDOM.render(
const root = createRoot(document.querySelector('#root')!)

root.render(
<JsxParser
autoCloseVoidElements
jsx={`
<img src="http://placekitten.com/300/500">
<img src="https://picsum.photos/300/500">
<div className="foo">bar</div>
`}
onError={console.error}
showWarnings
/>,
document.querySelector('#root'),
)
4 changes: 2 additions & 2 deletions source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>react-jsx-parser demo</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script defer src="react-jsx-parser-demo.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/enzyme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import Adapter from '@cfaester/enzyme-adapter-react-18'
/* eslint-enable import/no-extraneous-dependencies */

Enzyme.configure({ adapter: new Adapter() })

0 comments on commit d0eede5

Please sign in to comment.