From 4138db487c77e0fcf5585398b669f4d353b64a61 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 21 Sep 2022 22:48:54 -0400 Subject: [PATCH] Upgrade to Inferno v8. Fixes #731 --- .eslintrc.json | 3 +- package.json | 15 +- src/shared/components/app/app.tsx | 2 +- src/shared/components/app/footer.tsx | 20 +- src/shared/components/app/navbar.tsx | 104 ++-- src/shared/components/app/no-match.tsx | 2 +- .../components/comment/comment-form.tsx | 6 +- .../components/comment/comment-node.tsx | 338 +++++------ .../components/common/banner-icon-header.tsx | 2 +- .../components/common/comment-sort-select.tsx | 2 +- .../components/common/data-type-select.tsx | 2 +- src/shared/components/common/html-tags.tsx | 7 +- src/shared/components/common/icon.tsx | 6 +- .../components/common/image-upload-form.tsx | 27 +- .../components/common/listing-type-select.tsx | 2 +- .../components/common/markdown-textarea.tsx | 142 +++-- src/shared/components/common/paginator.tsx | 6 +- .../common/registration-application.tsx | 9 +- src/shared/components/common/sort-select.tsx | 14 +- src/shared/components/common/symbols.tsx | 4 +- .../components/community/communities.tsx | 66 +- .../components/community/community-form.tsx | 116 ++-- .../components/community/community-link.tsx | 2 +- src/shared/components/community/community.tsx | 68 +-- .../components/community/create-community.tsx | 6 +- src/shared/components/community/sidebar.tsx | 112 ++-- src/shared/components/home/admin-settings.tsx | 47 +- src/shared/components/home/home.tsx | 113 ++-- src/shared/components/home/instances.tsx | 12 +- src/shared/components/home/legal.tsx | 2 +- src/shared/components/home/login.tsx | 40 +- src/shared/components/home/setup.tsx | 53 +- src/shared/components/home/signup.tsx | 138 +++-- src/shared/components/home/site-form.tsx | 201 +++--- src/shared/components/home/site-sidebar.tsx | 34 +- src/shared/components/modlog.tsx | 574 ++++++++++-------- src/shared/components/person/inbox.tsx | 143 +++-- .../components/person/password-change.tsx | 37 +- .../components/person/person-details.tsx | 7 +- src/shared/components/person/profile.tsx | 121 ++-- .../person/registration-applications.tsx | 34 +- src/shared/components/person/reports.tsx | 58 +- src/shared/components/person/settings.tsx | 425 +++++++------ src/shared/components/person/verify-email.tsx | 9 +- src/shared/components/post/create-post.tsx | 39 +- src/shared/components/post/metadata-card.tsx | 55 +- src/shared/components/post/post-form.tsx | 209 ++++--- src/shared/components/post/post-listing.tsx | 349 ++++++----- src/shared/components/post/post-listings.tsx | 2 +- src/shared/components/post/post.tsx | 113 ++-- .../create-private-message.tsx | 27 +- .../private_message/private-message-form.tsx | 62 +- .../private_message/private-message.tsx | 39 +- src/shared/components/search.tsx | 155 ++--- src/shared/utils.ts | 2 +- yarn.lock | 547 ++++++++++++----- 56 files changed, 2501 insertions(+), 2229 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 4e05f0c5..0c9a5f46 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,8 @@ ], "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "plugin:inferno/recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { diff --git a/package.json b/package.json index a430314b..b88a251c 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,13 @@ "emoji-short-name": "^2.0.0", "express": "~4.18.1", "i18next": "^21.8.14", - "inferno": "^7.4.11", - "inferno-create-element": "^7.4.11", + "inferno": "^8.0.3", + "inferno-create-element": "^8.0.3", "inferno-helmet": "^5.2.1", - "inferno-hydrate": "^7.4.11", + "inferno-hydrate": "^8.0.3", "inferno-i18next-dess": "^0.0.1", - "inferno-router": "^7.4.11", - "inferno-server": "^7.4.11", + "inferno-router": "^8.0.3", + "inferno-server": "^8.0.3", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", "markdown-it": "^13.0.1", @@ -55,7 +55,7 @@ "@babel/plugin-proposal-decorators": "^7.18.9", "@babel/plugin-transform-runtime": "^7.18.9", "@babel/plugin-transform-typescript": "^7.18.8", - "@babel/preset-env": "7.18.9", + "@babel/preset-env": "7.19.1", "@babel/preset-typescript": "^7.18.6", "@babel/runtime": "^7.18.9", "@sniptt/monads": "^0.5.10", @@ -74,6 +74,7 @@ "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", "eslint": "^8.20.0", + "eslint-plugin-inferno": "^7.31.8", "eslint-plugin-prettier": "^4.2.1", "husky": "^8.0.1", "import-sort-style-module": "^6.0.0", @@ -95,7 +96,7 @@ "typescript": "^4.7.4", "webpack": "5.74.0", "webpack-cli": "^4.10.0", - "webpack-dev-server": "4.9.3", + "webpack-dev-server": "4.11.1", "webpack-node-externals": "^3.0.0" }, "engines": { diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index 72119a8d..960f6bad 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -42,7 +42,7 @@ export class App extends Component { none: <>, })} -
+
{routes.map(({ path, exact, component: C, ...rest }) => ( { render() { return ( -