Skip to content

Commit

Permalink
chore: React 18 migration (#21)
Browse files Browse the repository at this point in the history
* Remove yarn.lock

* Add missing canvas-confetti dependency

* Run `lint:fix` to automatically fix formatting

Caleydo/cohort#693

* Fix remaining eslint errors

* Remove `|| true` to show eslint errors

Caleydo/cohort#693

* Rename `App` to `Coral`

Caleydo/cohort#693

* Remove content of index.ts

* Use dependent branch

* React 18

* Use react18 branches

* Also for ordino

* Use correct dependent branch

* tsconfig

* Test tsconfig

* Revert tsconfig

* Pin deps

* Update package.json

---------

Co-authored-by: Holger Stitz <[email protected]>
Co-authored-by: Michael Pühringer <[email protected]>
  • Loading branch information
3 people authored May 17, 2023
1 parent 5bafd45 commit dbaac5e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@
"react-router-dom": "^5.2.0",
"visyn_scripts": "git+ssh://[email protected]/datavisyn/visyn_scripts.git#develop"
},
"resolutions": {
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.0",
"react": "~18.2.0",
"react-dom": "~18.2.0"
},
"devDependencies": {
"@types/react": "^16.14.6",
"@types/react-dom": "^16.9.5",
"@types/react-router-dom": "^5.1.7",
"mkdirp": "0.5.1",
"tslint": "~5.20.1",
Expand Down
5 changes: 2 additions & 3 deletions src/initialize.welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'ordino/dist/robots.txt';

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { HashRouter, Switch, Route } from 'react-router-dom';
import { RouterScrollToTop } from 'coral';
import { DatasetsPage, Error404Page, FeaturesPage, HelpPage, HomePage, NewsPage, PublicationPage } from './pages';

ReactDOM.render(
createRoot(document.querySelector('#welcome')).render(
<HashRouter>
<RouterScrollToTop />
{/* A <Switch> looks through its children <Route>s and
Expand Down Expand Up @@ -45,5 +45,4 @@ ReactDOM.render(
</Route>
</Switch>
</HashRouter>,
document.querySelector('#welcome'),
);
2 changes: 1 addition & 1 deletion src/pages/components/SourceCodeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useAsync } from 'visyn_core';
import { useAsync } from 'visyn_core/hooks';
import { AppMetaDataUtils } from 'tdp_core';

export function SourceCodeCard() {
Expand Down
2 changes: 1 addition & 1 deletion src/phovea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
IOrdinoLogoDesc,
IStartMenuTabShortcutDesc,
} from 'ordino';
import { IRegistry, PluginRegistry } from 'visyn_core';
import { IRegistry, PluginRegistry } from 'visyn_core/plugin';
import { EXTENSION_POINT_CUSTOMIZED_LOGIN_FORM } from 'tdp_core';

export default function (registry: IRegistry) {
Expand Down
2 changes: 1 addition & 1 deletion src/phovea_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the new BSD license, available at http://caleydo.org/license
**************************************************************************** */

import { PluginRegistry } from 'visyn_core';
import { PluginRegistry } from 'visyn_core/plugin';
import reg from './phovea';

/**
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"extends": "visyn_scripts/config/tsconfig.template.json",
{ "extends": "visyn_scripts/config/tsconfig.template.json",
"compilerOptions": {
"outDir": "./dist",
"moduleResolution": "node",
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"tsd.d.ts"
]
}
}

0 comments on commit dbaac5e

Please sign in to comment.