-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[CHORE] Avoid isDefined
duplicated reference, move it to twenty-shared
#9967
Conversation
isDefined
duplicated reference, move it to twenty-shared
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Log
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR consolidates the isDefined
utility function by moving it from individual packages to twenty-shared
, affecting multiple packages across the codebase.
- Moves
isDefined
implementation fromtwenty-front
,twenty-server
, andtwenty-ui
totwenty-shared
package to avoid duplication - Updates over 200 files to import
isDefined
fromtwenty-shared
instead of local utilities ortwenty-ui
- Adds export of
isDefined
intwenty-shared/src/index.ts
and moves test file to shared package - Removes
isDefined.ts
files from individual packages while maintaining identical functionality - Fixes incorrect variant/accent prop handling in
ButtonGroup.tsx
whereadditionalProps.variant
was being set twice
559 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -17,7 +17,8 @@ import { useLingui } from '@lingui/react/macro'; | |||
import { OnSelectionChangeParams, useOnSelectionChange } from '@xyflow/react'; | |||
import { useCallback } from 'react'; | |||
import { useSetRecoilState } from 'recoil'; | |||
import { IconBolt, isDefined, useIcons } from 'twenty-ui'; | |||
import { isDefined } from 'twenty-shared'; | |||
import { IconBolt, useIcons } from 'twenty-ui'; | |||
|
|||
export const WorkflowDiagramCanvasEditableEffect = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing import for useIcons
which was previously imported from twenty-ui
export const WorkflowDiagramCanvasEditableEffect = () => { | |
import { useIcons } from '@/ui/utilities/icons/hooks/useIcons'; | |
const { getIcon } = useIcons(); |
Introduction
Avoid having multiple
isDefined
definition across our pacakgesAlso avoid importing
isDefined
fromtwenty-ui
which exposes a huge barrel for a such little util functionIn a nutshell
Removed own
isDefined.ts
definition fromtwenty-ui
twenty-front
andtwenty-server
to move it totwenty-shared
.Updated imports for each packages, and added explicit dependencies to
twenty-shared
if not already in placeRelated PR #9941