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

Typescript refactor #2685

Merged
merged 169 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
848ac6f
deps: install typescript
goto-bus-stop Mar 14, 2023
867689b
Use typescript for the prerendered html
goto-bus-stop Mar 15, 2023
e919ee2
Type a few common user components
goto-bus-stop Mar 15, 2023
e8a8347
Use redux-toolkit
goto-bus-stop Mar 15, 2023
b8ec3fe
Add a type declaration to base selector functions
goto-bus-stop Mar 15, 2023
31c885e
Add typed useDispatch and useSelector
goto-bus-stop Mar 15, 2023
033ad7a
Remove default values from reducer action parameters
goto-bus-stop Mar 15, 2023
3d8ae4a
Typed useStore hook
goto-bus-stop Mar 15, 2023
bdd898f
Use the typed redux hooks everywhere
goto-bus-stop Mar 15, 2023
26be88d
Move all constants files to ts
goto-bus-stop Mar 15, 2023
fdf9f5e
Use typescript files for active overlay
goto-bus-stop Mar 15, 2023
78a8a27
Use redux slice features for active overlay
goto-bus-stop Mar 15, 2023
6770268
Add types for config reducer
goto-bus-stop Mar 15, 2023
55d3051
Add types to the booth/history state
goto-bus-stop Mar 15, 2023
bb20148
Add types to the chat messages reducer
goto-bus-stop Mar 15, 2023
f22edce
Add types to small reducers
goto-bus-stop Mar 15, 2023
25bb113
Add types to the playlists reducer
goto-bus-stop Mar 15, 2023
c27d80d
Partially convert WebSocket interactions to typescript
goto-bus-stop Mar 15, 2023
a1f6b73
Add types to more reducers
goto-bus-stop Mar 15, 2023
c0bb59f
Add types to dialogs
goto-bus-stop Mar 16, 2023
61b24f7
Use typescript types in the SearchBar
goto-bus-stop Mar 16, 2023
5f76bf8
deps: update typescript
goto-bus-stop Mar 17, 2023
8310d88
Add types to chat components
goto-bus-stop Mar 18, 2023
eb0d948
async fn
goto-bus-stop Mar 19, 2023
3c7d75b
Assert some types to make it pass
goto-bus-stop Mar 19, 2023
383fff9
Declare useTranslator()
goto-bus-stop Mar 19, 2023
0a5317e
Work on types in media list
goto-bus-stop Mar 19, 2023
8266db8
Merge branch 'default' into typescript
goto-bus-stop Mar 20, 2023
a6cb648
Use swr for the history list
goto-bus-stop Mar 20, 2023
f62ab33
Add types to more media list components
goto-bus-stop Mar 20, 2023
9efdc87
Remove room history from redux state
goto-bus-stop Mar 20, 2023
f5df6b5
Do not eagerly load active playlist
goto-bus-stop Mar 20, 2023
40dcf92
Move search request into the panel component
goto-bus-stop Mar 20, 2023
9129ddb
Add types to ConnectionIndicator
goto-bus-stop Mar 20, 2023
07e926e
Move room history fetching implementation to a shared hook
goto-bus-stop Mar 21, 2023
c1b8a05
Use SWR for playlist state in mobile drawer
goto-bus-stop Mar 21, 2023
7388138
a few types
goto-bus-stop Mar 21, 2023
f9ccdbc
Use RTK slice for booth state
goto-bus-stop Mar 21, 2023
7601a3d
support different types in MediaList
goto-bus-stop Mar 23, 2023
5ef0bc0
Make the overlay types work
goto-bus-stop Mar 23, 2023
248b071
Fix AddToPlaylistAction types
goto-bus-stop Mar 23, 2023
8b5e9a1
make a BaseRowProps type...
goto-bus-stop Mar 23, 2023
2a1272f
Add return type to addMediaMenu
goto-bus-stop Mar 23, 2023
c964919
Use a redux slice for chat messages
goto-bus-stop Mar 23, 2023
fff1c39
Refetch /now after the page was hidden
goto-bus-stop Mar 23, 2023
c8dd0a7
Fix import in <Motd/>
goto-bus-stop Mar 23, 2023
b818ce0
Fix lint
goto-bus-stop Mar 23, 2023
13aab8b
use deepmerge instead of structuredClone
goto-bus-stop Mar 23, 2023
1543bc7
Move settings state to a redux slice
goto-bus-stop Mar 23, 2023
96b1807
Use swr for YouTube imports
goto-bus-stop Mar 23, 2023
9c58b3d
Fix mutation in playlists reducer
goto-bus-stop Mar 23, 2023
8cbc1a9
move suspense boundary
goto-bus-stop Mar 23, 2023
3ccf114
Add types to form components
goto-bus-stop Mar 23, 2023
daed106
Add types to media sources
goto-bus-stop Mar 23, 2023
6b68877
Add types to entry class
goto-bus-stop Mar 23, 2023
de10bb6
Add types to the room user list
goto-bus-stop Mar 24, 2023
9bffcd5
Add types to waitlist
goto-bus-stop Mar 24, 2023
00000ac
Remove rowProps support from media list
goto-bus-stop Mar 24, 2023
6e884bc
Fix settings
goto-bus-stop Mar 24, 2023
91544cc
Write soundcloud player with hooks
goto-bus-stop Mar 24, 2023
e160865
Fix settings test
goto-bus-stop Mar 24, 2023
a38cfc7
Fix chat reducer tests
goto-bus-stop Mar 24, 2023
2564d50
Fix booth reducer test
goto-bus-stop Mar 24, 2023
f1c9965
Add types to MediaSearchStore
goto-bus-stop Mar 24, 2023
184cc06
Fix soundcloud player props
goto-bus-stop Mar 24, 2023
fb9e564
Type most chat actions?
goto-bus-stop Mar 25, 2023
2796567
lint
goto-bus-stop Mar 25, 2023
cd4c349
fix url
goto-bus-stop Mar 25, 2023
ab548ed
Use createAsyncThunk for login
goto-bus-stop Mar 25, 2023
70c663d
uwFetch
goto-bus-stop Mar 25, 2023
d43ce7f
lint <video/>
goto-bus-stop Mar 26, 2023
0ca5238
Delete unused action constants
goto-bus-stop Mar 31, 2023
b5c6704
Move chat notifications into extraReducers
goto-bus-stop Apr 7, 2023
3cb0e9f
pkg: add typecheck npm script
goto-bus-stop Apr 7, 2023
0cec44c
Fix login
goto-bus-stop Apr 7, 2023
4a1bc23
Use advance.type
goto-bus-stop Apr 7, 2023
fb4256e
remove LOAD_VOTES
goto-bus-stop Apr 7, 2023
7bfc093
Move theme state to a redux slice
goto-bus-stop Apr 7, 2023
0c68360
Move waitlist state to a redux slice
goto-bus-stop Apr 7, 2023
1bcec4b
Move import/search panel state into playlists reducer
goto-bus-stop Apr 7, 2023
f5fab96
add type for json-api errors
goto-bus-stop Apr 8, 2023
2a360f2
Write users reducer as a redux slice
goto-bus-stop Apr 8, 2023
3efa25e
Delete unused action type constants
goto-bus-stop Apr 8, 2023
66034ba
Move username changes to an async thunk
goto-bus-stop Apr 8, 2023
b30857d
Write initState as an async thunk
goto-bus-stop Apr 8, 2023
82d04d5
use flattened media type in chat notif…
goto-bus-stop Apr 8, 2023
4e16e10
fix getting socket token from initState
goto-bus-stop Apr 8, 2023
98da49d
move socket action handlers to a listener middleware
goto-bus-stop Apr 10, 2023
8878cd5
break some recursive types
goto-bus-stop Apr 10, 2023
6f722e1
handle undefined
goto-bus-stop Apr 10, 2023
891ae76
deps: update
goto-bus-stop Apr 10, 2023
977cf5d
markdown.tsx
goto-bus-stop Apr 11, 2023
3792e4e
Use createAsyncThunk for updating MOTD
goto-bus-stop Apr 11, 2023
797d487
update tests to new reducers
goto-bus-stop Apr 11, 2023
2156afd
remove eager loadPlaylist call when selecting a playlist
goto-bus-stop Apr 11, 2023
391d3ba
Remove jest-fetch-mock
goto-bus-stop Apr 12, 2023
5b566ad
use vitest
goto-bus-stop Apr 12, 2023
6101fad
fixup! use vitest
goto-bus-stop Apr 12, 2023
fb45a8f
deps: install vitest coverage tool
goto-bus-stop Apr 12, 2023
b5104a1
handle moderator waitlist moves
goto-bus-stop Apr 12, 2023
44910d4
Move active import source type selector into the reducer file
goto-bus-stop Apr 13, 2023
4ae953a
Reduce cyclical imports
goto-bus-stop Apr 13, 2023
eae6b2f
use eslint-plugin-vitest
goto-bus-stop Apr 13, 2023
e19c747
toEqual → toBe where possible
goto-bus-stop Apr 13, 2023
25dd8c0
include jsx tests in vitest
goto-bus-stop Apr 13, 2023
a254c5f
move add media menu state to a slice
goto-bus-stop Apr 13, 2023
09be64b
Move addToPlaylistMenu selectors into the reducer file
goto-bus-stop Apr 13, 2023
4e51b32
move most settings code into the reducer
goto-bus-stop Apr 13, 2023
3890f4c
fix types in AddToPlaylistAction
goto-bus-stop Apr 14, 2023
285f99c
Hardcode media source reducer for now
goto-bus-stop Apr 14, 2023
d636060
import vi
goto-bus-stop Apr 14, 2023
75559a5
use async thunk for importing playlist from youtube
goto-bus-stop Apr 14, 2023
dfa41ce
Fix imports
goto-bus-stop Apr 14, 2023
0955928
Rewrite playlists reducer as a redux slice
goto-bus-stop Apr 19, 2023
f2fc8b6
createPlaylist as an async thunk
goto-bus-stop Apr 20, 2023
de7d05d
deps: update vite
goto-bus-stop Apr 21, 2023
8ce786e
fix playlist reducer types
goto-bus-stop Apr 22, 2023
f4f1dd1
update getMediaSource() type
goto-bus-stop Apr 22, 2023
bbbb932
deps: add explicit jsdom dependency
goto-bus-stop Apr 22, 2023
bb43dbe
port addMedia to an async thunk
goto-bus-stop Apr 22, 2023
02723e8
fix new playlist item type
goto-bus-stop Apr 22, 2023
873c51a
build: remove custom babel config
goto-bus-stop Apr 22, 2023
d0fda77
remove old search actions
goto-bus-stop Apr 22, 2023
d44acf9
line length
goto-bus-stop Apr 24, 2023
38f0348
remove obsolete user actions
goto-bus-stop Apr 24, 2023
d0e15f4
lint uwave.tsx
goto-bus-stop Apr 24, 2023
c41f810
deps: update stylelint config
goto-bus-stop Apr 25, 2023
6b81636
deps: update p-map
goto-bus-stop Apr 25, 2023
55ea75a
deps: update rimraf
goto-bus-stop Apr 25, 2023
def3bec
build: allow for-of
goto-bus-stop Apr 25, 2023
3a6dd5c
build: lint passes
goto-bus-stop Apr 25, 2023
6881541
deps: update vitest
goto-bus-stop May 8, 2023
d54fea4
deps: update escape-string-regexp
goto-bus-stop May 8, 2023
d186f02
fix preview player size
goto-bus-stop May 9, 2023
a39bec8
Fix some media source types
goto-bus-stop May 9, 2023
225c4ef
fix one settings crash
goto-bus-stop May 9, 2023
7c917bb
make notification settings work
goto-bus-stop May 9, 2023
0e1f67f
deps: update get-port
goto-bus-stop Jun 9, 2023
03eabf9
deps: update vitest
goto-bus-stop Jun 9, 2023
bbbd868
deps: update vitest
goto-bus-stop Jun 24, 2023
ac97ed2
deps: update eslint-plugin-jest-dom
goto-bus-stop Jun 24, 2023
9105663
deps: npm update
goto-bus-stop Jun 24, 2023
0a00629
deps: update emojibase-data
goto-bus-stop Jun 24, 2023
a810f2f
Remove obsolete `@nest` from CSS files
goto-bus-stop Jun 28, 2023
c106ab9
deps: update dependencies
goto-bus-stop Jul 7, 2023
7a5f869
deps: update vitest
goto-bus-stop Aug 22, 2023
01838c5
deps: update clsx
goto-bus-stop Aug 22, 2023
a24046c
deps: update vite to v5
goto-bus-stop Nov 24, 2023
9e9eb7e
deps: update react-virtual
goto-bus-stop Nov 24, 2023
2e4eda1
deps: update testing deps
goto-bus-stop Nov 24, 2023
8ea4394
Fix type checking
goto-bus-stop Nov 25, 2023
fca4a81
2.0.0-alpha.25
goto-bus-stop Nov 25, 2023
d75cdd2
Bubble up errors during load
goto-bus-stop Nov 25, 2023
5403d64
Use size from playlist metadata in panels
goto-bus-stop Nov 25, 2023
22e0a87
Address some crashes in playlist items
goto-bus-stop Nov 25, 2023
e4f079f
2.0.0-alpha.26
goto-bus-stop Nov 25, 2023
99c7c04
Remove serverEmotes config reducer leftovers
goto-bus-stop Nov 25, 2023
92afc32
2.0.0-alpha.27
goto-bus-stop Nov 25, 2023
813f380
Fix closing settings manager
goto-bus-stop Dec 1, 2023
b92da55
Handle user having no active playlist
goto-bus-stop Dec 1, 2023
04f7576
Fix merging currently playing media object
goto-bus-stop Dec 1, 2023
4481c84
Typecheck indexed access, fixing some playlist state bugs
goto-bus-stop Dec 1, 2023
6e49f0d
deps: update u-wave-parse-chat-markup to support deduped emote names
goto-bus-stop Dec 1, 2023
7c9b98b
2.0.0-alpha.28
goto-bus-stop Dec 1, 2023
ed25ffb
Untyped action :skull:
goto-bus-stop Dec 1, 2023
471c6e6
youtube: allow keyboard control of preview player
goto-bus-stop Dec 1, 2023
2eed550
deps: update jsdom
goto-bus-stop Dec 1, 2023
c3c018d
Lint fixes
goto-bus-stop Dec 2, 2023
e0a9650
Merge branch 'default' into typescript
goto-bus-stop Dec 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 55 additions & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
'use strict';

module.exports = {
extends: ['airbnb', 'airbnb/hooks'],
extends: ['airbnb', 'airbnb/hooks', 'plugin:import/typescript'],

plugins: ['compat', 'react-hooks'],
parserOptions: {
ecmaVersion: 2022,
ecmaFeatures: {
// Ideally this would only be done for .jsx files, but eslint-plugin-import
// has trouble with the overrides?
jsx: true,
},
},

rules: {
'arrow-body-style': 'off',
'no-underscore-dangle': ['error', { allow: ['_id'] }],
// Modify eslint-config-airbnb's rule to allow ForOfStatement
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],

'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
}],
// Not true anymore
'react/react-in-jsx-scope': 'off',
'react/no-unused-prop-types': ['error', { skipShapeProps: true }],
'react/forbid-prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
Expand All @@ -27,6 +48,13 @@ module.exports = {
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
}],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],

'jsx-a11y/control-has-associated-label': [
'warn',
require('eslint-config-airbnb/rules/react-a11y')
.rules['jsx-a11y/control-has-associated-label'][1],
],
},

settings: {
Expand All @@ -47,6 +75,25 @@ module.exports = {
},

overrides: [
{
files: ['**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
},

{
files: ['src/reducers/*'],
rules: {
// Reducers use default params differently
'default-param-last': 'off',
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsFor: ['state'],
}],
},
},

{
files: ['src/**/*.{js,jsx}'],
rules: {
Expand All @@ -65,8 +112,8 @@ module.exports = {
},
{
files: ['**/__tests__/**/*.{js,jsx}'],
plugins: ['eslint-plugin-jest', 'eslint-plugin-jest-dom', 'eslint-plugin-testing-library'],
extends: ['plugin:jest/recommended', 'plugin:jest-dom/recommended', 'plugin:testing-library/react'],
plugins: ['eslint-plugin-vitest', 'eslint-plugin-jest-dom', 'eslint-plugin-testing-library'],
extends: ['plugin:vitest/recommended', 'plugin:jest-dom/recommended', 'plugin:testing-library/react'],
env: {
jest: true,
},
Expand Down
124 changes: 0 additions & 124 deletions babel.config.cjs

This file was deleted.

12 changes: 0 additions & 12 deletions jest.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "u-wave-web",
"version": "2.0.0-alpha.24",
"version": "2.0.0-alpha.28",
"description": "Web client for üWave servers.",
"author": "Renée Kooi <[email protected]>",
"license": "MIT",
Expand Down
Loading
Loading