Skip to content

Commit

Permalink
perf: remove core dependency in viz & code-editor
Browse files Browse the repository at this point in the history
chore(classes): keep core alias
also change imports in core
  • Loading branch information
zettca committed Aug 5, 2024
1 parent c4a3828 commit 27ede92
Show file tree
Hide file tree
Showing 59 changed files with 166 additions and 114 deletions.
3 changes: 2 additions & 1 deletion apps/app/src/components/common/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useNavigate } from "react-router-dom";
import { useMediaQuery, useTheme } from "@mui/material";
import { useTheme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
import {
HvButton,
HvHeader,
Expand Down
85 changes: 53 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useContext } from "react";
import { useNavigate } from "react-router-dom";
import { useMediaQuery, useTheme } from "@mui/material";
import { useTheme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
import { Menu } from "@hitachivantara/uikit-react-icons";
import {
HvHeader,
Expand Down
4 changes: 1 addition & 3 deletions packages/code-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"dependencies": {
"@emotion/css": "^11.11.0",
"@hitachivantara/uikit-react-core": "^5.66.14",
"@hitachivantara/uikit-react-icons": "^5.10.5",
"@hitachivantara/uikit-react-shared": "^5.1.45",
"@hitachivantara/uikit-styles": "^5.31.0",
"@monaco-editor/react": "^4.5.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/code-editor/src/CodeEditor/CodeEditor.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createClasses } from "@hitachivantara/uikit-react-core";
import { createClasses } from "@hitachivantara/uikit-react-shared";
import { theme } from "@hitachivantara/uikit-styles";

export const { staticClasses, useClasses } = createClasses("HvCodeEditor", {
Expand Down
2 changes: 1 addition & 1 deletion packages/code-editor/src/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useEffect } from "react";
import { Editor, EditorProps, useMonaco } from "@monaco-editor/react";
import { ExtractNames, useTheme } from "@hitachivantara/uikit-react-core";
import { ExtractNames, useTheme } from "@hitachivantara/uikit-react-shared";

import { staticClasses, useClasses } from "./CodeEditor.styles";

Expand Down
2 changes: 0 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
},
"dependencies": {
"@emotion/cache": "^11.11.0",
"@emotion/css": "^11.11.2",
"@emotion/serialize": "^1.1.2",
"@emotion/utils": "^1.2.1",
"@hitachivantara/uikit-react-icons": "^5.10.5",
"@hitachivantara/uikit-react-shared": "^5.1.45",
"@hitachivantara/uikit-styles": "^5.31.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/AvatarGroup/AvatarGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children, forwardRef } from "react";
import { css } from "@emotion/css";
import { useCss } from "@hitachivantara/uikit-react-shared";
import { HvSize, theme } from "@hitachivantara/uikit-styles";

import { HvAvatar } from "../Avatar/Avatar";
Expand Down Expand Up @@ -96,6 +96,8 @@ const Overflow = ({
maxVisible,
size,
}: OverflowProps) => {
const { css } = useCss();

return (
<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/BaseDropdown/BaseDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import {
Placement,
} from "@popperjs/core";
import { DropDownXS, DropUpXS } from "@hitachivantara/uikit-react-icons";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { useControlled } from "../hooks/useControlled";
import { useDefaultProps } from "../hooks/useDefaultProps";
import { useForkRef } from "../hooks/useForkRef";
import { useTheme } from "../hooks/useTheme";
import { useUniqueId } from "../hooks/useUniqueId";
import { HvBaseProps } from "../types/generic";
import { HvTypography } from "../Typography";
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/BulkActions/BulkActions.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { HvActionsGeneric, HvActionsGenericProps } from "../ActionsGeneric";
import { HvButton, HvButtonProps, HvButtonVariant } from "../Button";
import { HvCheckBox, HvCheckBoxProps } from "../CheckBox";
import { useDefaultProps } from "../hooks/useDefaultProps";
import { useTheme } from "../hooks/useTheme";
import { HvBaseProps } from "../types/generic";
import { HvTypography } from "../Typography";
import { ExtractNames } from "../utils/classes";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from "react";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { useDefaultProps } from "../hooks/useDefaultProps";
import { useTheme } from "../hooks/useTheme";
import {
fixedForwardRef,
PolymorphicComponentRef,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
Forwards,
Fullscreen,
} from "@hitachivantara/uikit-react-icons";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { HvButton } from "../Button";
import { HvContainer } from "../Container";
import { useDefaultProps } from "../hooks/useDefaultProps";
import { useLabels } from "../hooks/useLabels";
import { useTheme } from "../hooks/useTheme";
import { HvIconButton, HvIconButtonProps } from "../IconButton";
import { HvBaseProps } from "../types/generic";
import { HvTypography } from "../Typography";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ColorPicker/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
RGBColor,
} from "react-color";
import { Hue, Saturation } from "react-color/lib/components/common";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { useDefaultProps } from "../../hooks/useDefaultProps";
import { useTheme } from "../../hooks/useTheme";
import { HvTypography } from "../../Typography";
import { ExtractNames } from "../../utils/classes";
import { Fields } from "../Fields";
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Controls/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useControlled } from "../hooks/useControlled";
import { useDefaultProps } from "../hooks/useDefaultProps";
import { HvMultiButton } from "../MultiButton";
import { HvTableInstance } from "../Table/hooks/useTable";
import { HvBaseProps, HvExtraProps } from "../types/generic";
import { HvBaseProps } from "../types/generic";
import { ExtractNames } from "../utils/classes";
import { setId } from "../utils/setId";
import { HvControlsContextProvider } from "./context/ControlsContext";
Expand All @@ -15,7 +15,7 @@ export { staticClasses as controlsClasses };

export type HvControlsClasses = ExtractNames<typeof useClasses>;

export interface HvControlsViewConfiguration extends HvExtraProps {
export interface HvControlsViewConfiguration extends Record<string, any> {
id?: string;
label?: string;
icon?: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useCallback, useMemo } from "react";
import MuiDialog, { DialogProps as MuiDialogProps } from "@mui/material/Dialog";
import { Close } from "@hitachivantara/uikit-react-icons";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { useDefaultProps } from "../hooks/useDefaultProps";
import { useTheme } from "../hooks/useTheme";
import { HvIconButton } from "../IconButton";
import { ExtractNames } from "../utils/classes";
import { getElementById } from "../utils/document";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { forwardRef, useContext, useMemo, useRef, useState } from "react";
import { Filters } from "@hitachivantara/uikit-react-icons";
import { useTheme } from "@hitachivantara/uikit-react-shared";

import { HvActionBar } from "../../ActionBar";
import { HvBaseDropdown, HvBaseDropdownProps } from "../../BaseDropdown";
import { HvButton, HvButtonVariant } from "../../Button";
import { HvFormStatus } from "../../Forms";
import { useDefaultProps } from "../../hooks/useDefaultProps";
import { useTheme } from "../../hooks/useTheme";
import { HvTypography } from "../../Typography";
import { ExtractNames } from "../../utils/classes";
import { setId } from "../../utils/setId";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Forms/FormElement/utils/FormUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { InputBaseComponentProps } from "@mui/material";
import { InputBaseComponentProps } from "@mui/material/InputBase";

import { HvFormElementContextValue } from "../context/FormElementContext";
import { HvFormElementDescriptorsContextValue } from "../context/FormElementDescriptorsContext";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/GlobalActions/GlobalActions.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSInterpolation } from "@emotion/serialize";
import type { CSSInterpolation } from "@emotion/serialize";
import { theme } from "@hitachivantara/uikit-styles";

import { createClasses } from "../utils/classes";
Expand Down
Loading

0 comments on commit 27ede92

Please sign in to comment.