Skip to content

Commit

Permalink
chore: purge redux in favour of react hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Sep 25, 2022
1 parent 1274047 commit 4f4ec5a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 135 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[![Test](https://github.com/tadayosi/hawtio-next/actions/workflows/test.yml/badge.svg)](https://github.com/tadayosi/hawtio-next/actions/workflows/test.yml)

A Hawtio reimplementation based on TypeScript + React + Redux.
A Hawtio reimplementation based on TypeScript + React.
16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@
"@types/node": "^16.11.39",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/react-redux": "^7.1.24",
"@types/react-router-dom": "^5.3.3",
"@types/redux-thunk": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-markdown": "^8.0.3",
"react-redux": "^8.0.2",
"react-router-dom": "^5.3.3",
"react-scripts": "5.0.1",
"typescript": "^4.8.3",
"typescript-fsa": "^3.0.0",
"typescript-fsa-reducers": "^1.2.2",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.24.0",
"eslint-plugin-import": "^2.26.0"
},
"resolutions": {
"@types/react": "17.0.45"
},
Expand All @@ -56,11 +58,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.24.0",
"eslint-plugin-import": "^2.26.0"
}
}
6 changes: 1 addition & 5 deletions src/hawtio/Hawtio.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { render, screen } from '@testing-library/react'
import { Provider } from 'react-redux'
import { Hawtio } from './Hawtio'
import { store } from './store'

test('renders page', () => {
render(
<Provider store={store}>
<Hawtio />
</Provider>
<Hawtio />
)
const example = screen.queryByText('Hawtio')
expect(example).toBeInTheDocument()
Expand Down
18 changes: 0 additions & 18 deletions src/hawtio/reducer.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/hawtio/state.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/hawtio/store.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/hawtio/ui/types.ts

This file was deleted.

10 changes: 1 addition & 9 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@
import { bootstrap } from '@hawtio/core'
import { Hawtio } from '@hawtio/Hawtio'
import { registerPlugins } from '@hawtio/plugins'
import { store } from '@hawtio/store'
import '@patternfly/react-core/dist/styles/base.css'
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { registerExamples } from './examples'
import './index.css'
import { reportWebVitals } from './reportWebVitals'

// TODO: debugging
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).store = store

// Bootstrap Hawtio
registerPlugins()
registerExamples()
bootstrap()

ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
<Hawtio />
</Provider>
<Hawtio />
</React.StrictMode>,
document.getElementById('root')
)
Expand Down
39 changes: 6 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64"
integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==

"@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1":
"@types/hoist-non-react-statics@^3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
Expand Down Expand Up @@ -2317,16 +2317,6 @@
dependencies:
"@types/react" "^17"

"@types/react-redux@^7.1.24":
version "7.1.24"
resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.24.tgz#6caaff1603aba17b27d20f8ad073e4c077e975c0"
integrity sha512-7FkurKcS1k0FHZEtdbbgN8Oc6b+stGSfZYjQGicofJ0j4U0qIn/jaSvnP2pLwZKiai3/17xqqxkkrxTgN8UNbQ==
dependencies:
"@types/hoist-non-react-statics" "^3.3.0"
"@types/react" "*"
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"

"@types/react-router-dom@^5.3.3":
version "5.3.3"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83"
Expand All @@ -2337,9 +2327,9 @@
"@types/react-router" "*"

"@types/react-router@*":
version "5.1.18"
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.18.tgz#c8851884b60bc23733500d86c1266e1cfbbd9ef3"
integrity sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g==
version "5.1.19"
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.19.tgz#9b404246fba7f91474d7008a3d48c17b6e075ad6"
integrity sha512-Fv/5kb2STAEMT3wHzdKQK2z8xKq38EDIGVrutYLmQVVLe+4orDFquU52hQrULnEHinMKv9FSA6lf9+uNT1ITtA==
dependencies:
"@types/history" "^4.7.11"
"@types/react" "*"
Expand All @@ -2353,13 +2343,6 @@
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/redux-thunk@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/redux-thunk/-/redux-thunk-2.1.0.tgz#bc2b6e972961831afb82a9bf4f06726e351f9416"
integrity sha1-vCtulylhgxr7gqm/TwZybjUflBY=
dependencies:
redux-thunk "*"

"@types/[email protected]":
version "1.17.1"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
Expand Down Expand Up @@ -8383,12 +8366,12 @@ redent@^3.0.0:
indent-string "^4.0.0"
strip-indent "^3.0.0"

redux-thunk@*, redux-thunk@^2.4.1:
redux-thunk@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714"
integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q==

redux@^4.0.0, redux@^4.1.2:
redux@^4.1.2:
version "4.2.0"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13"
integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==
Expand Down Expand Up @@ -9477,16 +9460,6 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript-fsa-reducers@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/typescript-fsa-reducers/-/typescript-fsa-reducers-1.2.2.tgz#1e2c8e8a50ca3e09e0d6fdf2a3b42bdd17de8094"
integrity sha512-IQ2VsIqUvmzVgWNDjxkeOxX97itl/rq+2u82jGsRdzCSFi9OtV4qf1Ec1urvj/eDlPHOaihIL7wMZzLYx9GvFg==

typescript-fsa@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/typescript-fsa/-/typescript-fsa-3.0.0.tgz#3ad1cb915a67338e013fc21f67c9b3e0e110c912"
integrity sha512-xiXAib35i0QHl/+wMobzPibjAH5TJLDj+qGq5jwVLG9qR4FUswZURBw2qihBm0m06tHoyb3FzpnJs1GRhRwVag==

typescript@^4.8.3:
version "4.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88"
Expand Down

0 comments on commit 4f4ec5a

Please sign in to comment.