Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React18] upgrade to react 18 #142

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ Additionally, as part of this change the existing v3.x extension has been moved

| Version | Application Insights | React | Branch
|---------|-----------------------|-----------|-----------
| 17.3.5 | ^3.3.5 | >= 17.0.2 | [main](https://github.com/microsoft/applicationinsights-react-js)
| 18.0.0 | ^3.3.5 | >= 18.0.0 | [main](https://github.com/microsoft/applicationinsights-react-js)
| 17.3.5 | ^3.3.5 | >= 17.0.2 | [main](https://github.com/microsoft/applicationinsights-react-js)
| 17.3.4 | ^3.3.4 | >= 17.0.2 | [main](https://github.com/microsoft/applicationinsights-react-js)
| 17.3.3 | ^3.3.3 | >= 17.0.2 | [main](https://github.com/microsoft/applicationinsights-react-js)
| 17.3.2 | ^3.3.2 | >= 17.0.2 | [main](https://github.com/microsoft/applicationinsights-react-js)
Expand Down
6 changes: 3 additions & 3 deletions applicationinsights-react-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"jest": "^27.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^18.0.0",
Expand All @@ -73,7 +73,7 @@
},
"peerDependencies": {
"tslib": "*",
"react": ">= 17.0.1",
"react": ">= 18.0.0",
"history": ">= 4.10.1"
}
}
469 changes: 308 additions & 161 deletions common/config/rush/npm-shrinkwrap.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions sample/applicationinsights-react-sample/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@microsoft/applicationinsights-react-sample",
"version": "1.3.1",
"version": "1.3.5",
"description": "Microsoft Application Insights React plugin Sample",
"author": "Microsoft Application Insights Team",
"license": "MIT",
"dependencies": {
"@microsoft/applicationinsights-core-js": "^3.3.5",
"@microsoft/applicationinsights-react-js": "17.3.5",
"@microsoft/applicationinsights-web": "^3.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.11.2",
"web-vitals": "^3.4.0"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "11.13.2",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"react-scripts": "^5.0.1",
"typescript": "^4.3.4"
},
Expand Down
1 change: 1 addition & 0 deletions sample/applicationinsights-react-sample/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="app"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down
19 changes: 10 additions & 9 deletions sample/applicationinsights-react-sample/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from 'react';
import { BrowserRouter,Routes,Route, } from 'react-router-dom'
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import TestPage from './TestPage';
import { createRoot } from "react-dom/client";

ReactDOM.render(
<BrowserRouter>
<Routes>
<Route path="/" element={<App />} />
<Route path="/test" element={<TestPage />} />
</Routes>
</BrowserRouter>,
document.getElementById('root') as HTMLElement
const container = document.getElementById('app');
const root = createRoot(container!);
root.render(
<BrowserRouter>
<Routes>
<Route path="/" element={<App />} />
<Route path="/test" element={<TestPage />} />
</Routes>
</BrowserRouter>
);


153 changes: 64 additions & 89 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -983,12 +983,7 @@ acorn-jsx@^5.3.1:
resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==

agent-base@^7.1.0:
version "7.1.3"
resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz"
integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==

agent-base@^7.1.2:
agent-base@^7.1.0, agent-base@^7.1.2:
version "7.1.3"
resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz"
integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==
Expand Down Expand Up @@ -1017,7 +1012,7 @@ ajv-formats@~3.0.1:
dependencies:
ajv "^8.0.0"

ajv@^6.10.0, ajv@^6.12.4:
ajv@^6.10.0:
version "6.12.6"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
Expand All @@ -1027,27 +1022,17 @@ ajv@^6.10.0, ajv@^6.12.4:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

ajv@^8.0.0:
version "8.17.1"
resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz"
integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==
dependencies:
fast-deep-equal "^3.1.3"
fast-uri "^3.0.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"

ajv@^8.0.1:
version "8.11.0"
resolved "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz"
integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==
ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

ajv@^8.5.0, ajv@~8.13.0:
ajv@^8.0.0, ajv@^8.0.1, ajv@^8.5.0, ajv@~8.13.0:
version "8.13.0"
resolved "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz"
integrity sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==
Expand Down Expand Up @@ -2395,11 +2380,6 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==

fast-uri@^3.0.1:
version "3.0.6"
resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz"
integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==

fast-xml-parser@^4.4.1:
version "4.5.1"
resolved "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz"
Expand All @@ -2421,20 +2401,20 @@ fd-slicer@~1.1.0:
dependencies:
pend "~1.2.0"

figures@^3.0.0, figures@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz"
integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==
dependencies:
escape-string-regexp "^1.0.5"

[email protected]:
figures@^3.0.0, [email protected]:
version "3.0.0"
resolved "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz"
integrity sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==
dependencies:
escape-string-regexp "^1.0.5"

figures@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz"
integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==
dependencies:
escape-string-regexp "^1.0.5"

file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz"
Expand Down Expand Up @@ -2686,19 +2666,7 @@ glob-parent@^5.1.2:
dependencies:
is-glob "^4.0.1"

glob@^7.1.1, glob@^7.1.6, glob@~7.1.6:
version "7.1.7"
resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.1.3:
glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.2.3"
resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand All @@ -2710,28 +2678,28 @@ glob@^7.1.3:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.1.4:
version "7.2.3"
resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
glob@^8.0.3:
version "8.0.3"
resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz"
integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.1.1"
minimatch "^5.0.1"
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^8.0.3:
version "8.0.3"
resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz"
integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==
glob@~7.1.6:
version "7.1.7"
resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^5.0.1"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"

global-dirs@^3.0.0:
version "3.0.1"
Expand Down Expand Up @@ -4086,7 +4054,21 @@ min-indent@^1.0.0:
resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz"
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==

minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2:
minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.3, minimatch@~3.0.4:
version "3.0.8"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz"
integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
dependencies:
brace-expansion "^1.1.7"

minimatch@^3.1.1:
version "3.1.2"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"

minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
Expand All @@ -4107,20 +4089,6 @@ minimatch@^7.4.6:
dependencies:
brace-expansion "^2.0.1"

minimatch@~3.0.3:
version "3.0.8"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz"
integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
dependencies:
brace-expansion "^1.1.7"

minimatch@~3.0.4:
version "3.0.8"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz"
integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
dependencies:
brace-expansion "^1.1.7"

[email protected]:
version "4.1.0"
resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz"
Expand Down Expand Up @@ -4768,7 +4736,7 @@ pinkie@^2.0.0:
resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz"
integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==

pkg-dir@^4.2.0, [email protected]:
pkg-dir@^4.2.0:
version "4.2.0"
resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz"
integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
Expand All @@ -4782,6 +4750,13 @@ pkg-dir@^5.0.0:
dependencies:
find-up "^5.0.0"

[email protected]:
version "4.2.0"
resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz"
integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
dependencies:
find-up "^4.0.0"

please-upgrade-node@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz"
Expand Down Expand Up @@ -5826,17 +5801,17 @@ tsconfig-paths@^3.14.1:
minimist "^1.2.6"
strip-bom "^3.0.0"

tslib@^1.8.1, tslib@^1.9.0:
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.2.0:
version "2.8.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz"
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.6.2:
tslib@^2.2.0, tslib@^2.6.2:
version "2.8.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz"
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
Expand Down Expand Up @@ -6138,21 +6113,21 @@ which-pm@^2.2.0:
load-yaml-file "^0.2.0"
path-exists "^4.0.0"

which@^1.2.14, which@^1.3.1:
which@^1.2.14:
version "1.3.1"
resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
dependencies:
isexe "^2.0.0"

which@^2.0.1:
version "2.0.2"
resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
which@^1.3.1:
version "1.3.1"
resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
dependencies:
isexe "^2.0.0"

which@~2.0.2:
which@^2.0.1, which@~2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
Expand Down
Loading