From a6e5edba24685654a55d7dc8ca971c27584283a6 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 5 Sep 2022 13:28:24 +0100 Subject: [PATCH] build: use react 18 --- package.json | 4 ++-- src/cljs/athens/core.cljs | 9 ++++++--- yarn.lock | 35 ++++++++++++++++------------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 233bdd0048..138842bcb0 100644 --- a/package.json +++ b/package.json @@ -125,11 +125,11 @@ "luxon": "^2.0.2", "nedb": "^1.8.0", "polished": "^4.1.3", - "react": "17.0.1", + "react": "18.2.0", "react-codemirror2": "^7.2.1", "react-colorful": "^5.4.0", "react-day-picker": "^7.4.10", - "react-dom": "17.0.1", + "react-dom": "18.2.0", "react-error-boundary": "^3.1.4", "react-force-graph-2d": "^1.19.0", "react-highlight.js": "1.0.7", diff --git a/src/cljs/athens/core.cljs b/src/cljs/athens/core.cljs index db91b1c4bc..81eba06940 100644 --- a/src/cljs/athens/core.cljs +++ b/src/cljs/athens/core.cljs @@ -3,6 +3,7 @@ ["@sentry/integrations" :as integrations] ["@sentry/react" :as Sentry] ["@sentry/tracing" :as tracing] + ["react-dom/client" :refer [createRoot]] [athens.coeffects] [athens.common.logging :as log] [athens.components] @@ -22,7 +23,7 @@ [datalog-console.integrations.datascript :as datalog-console] [goog.dom :refer [getElement]] [re-frame.core :as rf] - [reagent.dom :as r-dom])) + [reagent.core :as r])) (goog-define SENTRY_DSN "") @@ -34,13 +35,15 @@ (log/info "dev mode"))) +(defonce react-root (createRoot (getElement "app"))) + + (defn ^:dev/after-load mount-root [first-boot?] (rf/clear-subscription-cache!) (when-not first-boot? (router/init-routes!)) - (r-dom/render [views/main] - (getElement "app"))) + (.render react-root (r/as-element [views/main]))) (defn sentry-on? diff --git a/yarn.lock b/yarn.lock index 6816e0a439..23888ff525 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12271,14 +12271,13 @@ react-docgen@^5.0.0: node-dir "^0.1.10" strip-indent "^3.0.0" -react-dom@17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6" - integrity sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug== +react-dom@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.1" + scheduler "^0.23.0" react-draggable@^4.4.3: version "4.4.3" @@ -12478,14 +12477,6 @@ react-window@^1.8.6: "@babel/runtime" "^7.0.0" memoize-one ">=3.1.1 <6" -react@17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127" - integrity sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - react@17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" @@ -12494,6 +12485,13 @@ react@17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" +react@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + read-config-file@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/read-config-file/-/read-config-file-6.2.0.tgz#71536072330bcd62ba814f91458b12add9fc7ade" @@ -12984,13 +12982,12 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -scheduler@^0.20.1: - version "0.20.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" - integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" schema-utils@2.7.0: version "2.7.0"