Path aliases, better lazyWebpack (#268)

This commit is contained in:
Ven 2022-11-28 13:37:55 +01:00 committed by GitHub
parent 7a4402f142
commit bad96b7887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
138 changed files with 572 additions and 547 deletions

View file

@ -16,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "../../../Vencord";
import { Settings } from "@api/settings";
import { Review } from "../entities/Review";
import { authorize, showToast } from "./Utils";

View file

@ -16,12 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../../../utils/constants";
import Logger from "../../../utils/Logger";
import { openModal } from "../../../utils/modal";
import { Settings } from "../../../Vencord";
import { findByProps } from "../../../webpack";
import { FluxDispatcher, React, SelectedChannelStore, Toasts, UserUtils } from "../../../webpack/common";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import Logger from "@utils/Logger";
import { openModal } from "@utils/modal";
import { findByProps } from "@webpack";
import { FluxDispatcher, React, SelectedChannelStore, Toasts, UserUtils } from "@webpack/common";
import { Review } from "../entities/Review";
export async function openUserProfileModal(userId: string) {

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { classes, LazyComponent } from "../../../utils/misc";
import { findByProps } from "../../../webpack";
import { classes, LazyComponent } from "@utils/misc";
import { findByProps } from "@webpack";
export default LazyComponent(() => {
const { button, dangerous } = findByProps("button", "wrapper", "disabled");

View file

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { classes, LazyComponent } from "../../../utils/misc";
import { filters, findBulk } from "../../../webpack";
import { Alerts, UserStore } from "../../../webpack/common";
import { classes, LazyComponent } from "@utils/misc";
import { filters, findBulk } from "@webpack";
import { Alerts, UserStore } from "@webpack/common";
import { Review } from "../entities/Review";
import { deleteReview, reportReview } from "../Utils/ReviewDBAPI";
import { canDeleteReview, openUserProfileModal, showToast } from "../Utils/Utils";

View file

@ -16,14 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { classes, useAwaiter } from "@utils/misc";
import { findLazy } from "@webpack";
import { Forms, Text, UserStore } from "@webpack/common";
import type { KeyboardEvent } from "react";
import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc";
import { Forms, Text, UserStore } from "../../../webpack/common";
import { addReview, getReviews } from "../Utils/ReviewDBAPI";
import ReviewComponent from "./ReviewComponent";
const Classes = lazyWebpack(m => typeof m.textarea === "string");
const Classes = findLazy(m => typeof m.textarea === "string");
export default function ReviewsView({ userId }: { userId: string; }) {
const [reviews, _, isLoading, refetch] = useAwaiter(() => getReviews(userId), []);

View file

@ -16,13 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "@api/settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { Button, UserStore } from "@webpack/common";
import { User } from "discord-types/general";
import ErrorBoundary from "../../components/ErrorBoundary";
import { Devs } from "../../utils/constants";
import definePlugin, { OptionType } from "../../utils/types";
import { Settings } from "../../Vencord";
import { Button, UserStore } from "../../webpack/common";
import ReviewsView from "./components/ReviewsView";
import { getLastReviewID } from "./Utils/ReviewDBAPI";
import { authorize, showToast } from "./Utils/Utils";