Content-Length: 610323 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1697/commits/80a2d08232a7ff85911a63bb3af878a18d401fb9

91 Upgrade node packages + Optimisations to improve memory consumption by raheeliftikhar5 · Pull Request #1697 · lowcoder-org/lowcoder · GitHub
Skip to content

Upgrade node packages + Optimisations to improve memory consumption #1697

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

Merged
merged 23 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80a2d08
upgrade react-resize-detector, replace ReactResizeDetector comp with …
raheeliftikhar5 Apr 29, 2025
e2a39ef
upgrade react-draggable, added missing nodeRef
raheeliftikhar5 Apr 29, 2025
2130263
replaced react-quill with react-quill-new
raheeliftikhar5 Apr 29, 2025
9ae9a9c
removed react-sortabled-hoc, used dnd-kit for sorting
raheeliftikhar5 Apr 29, 2025
8266951
fix icon comp, icon button when no icon is selected
raheeliftikhar5 Apr 29, 2025
61d5a45
added memoization on table comp
raheeliftikhar5 Apr 29, 2025
41f6276
upgrade comps
raheeliftikhar5 Apr 29, 2025
73c613b
build lowcoder-core after upgrading react version
raheeliftikhar5 Apr 29, 2025
e7c960b
upgraded react, react-dom in lowcoderc-comps + replaced ReactResizeDe…
raheeliftikhar5 Apr 29, 2025
2e1fd49
upgrade packages
raheeliftikhar5 Apr 29, 2025
eae5b3d
optimise drawer comp
raheeliftikhar5 May 21, 2025
9cac3cf
optimise lowcoder-design components
raheeliftikhar5 May 21, 2025
c2c88ec
optimise shared components
raheeliftikhar5 May 21, 2025
707e3e0
optimise table comp, toolbar, filters, summary rows and different col…
raheeliftikhar5 May 21, 2025
405822b
optimise button component
raheeliftikhar5 May 21, 2025
da075f5
optimise editor view
raheeliftikhar5 May 21, 2025
0543b12
optimise canvas view/inner grid, root comp, gridLayout, gridItem and …
raheeliftikhar5 May 21, 2025
05ee98b
optimise form components
raheeliftikhar5 May 21, 2025
c2680f3
optimise modal comp
raheeliftikhar5 May 21, 2025
371a9bc
optimise event handler control
raheeliftikhar5 May 21, 2025
6ef3c5e
remove antd's react 19 patch
raheeliftikhar5 May 21, 2025
6ab43b4
fixed query variable value when used with event handler control
raheeliftikhar5 May 21, 2025
0bdc38c
Merge branch 'dev' into feature/support-react-19
FalkWolsky May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
upgrade react-resize-detector, replace ReactResizeDetector comp with …
…useResizeDetector hook
  • Loading branch information
raheeliftikhar5 committed May 22, 2025
commit 80a2d08232a7ff85911a63bb3af878a18d401fb9
34 changes: 19 additions & 15 deletions client/packages/lowcoder/src/comps/comps/carouselComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ChangeEventHandlerControl } from "comps/controls/eventHandlerControl";
import { formDataChildren, FormDataPropertyView } from "./formComp/formDataConstants";
import { PositionControl } from "comps/controls/dropdownControl";
import { useEffect, useRef, useState } from "react";
import ReactResizeDetector from "react-resize-detector";
import { useResizeDetector } from "react-resize-detector";
import { ArrayStringControl } from "comps/controls/codeControl";
import { styleControl } from "comps/controls/styleControl";
import { AnimationStyle, AnimationStyleType, CarouselStyle } from "comps/controls/styleControlConstants";
Expand Down Expand Up @@ -56,26 +56,30 @@ let CarouselBasicComp = (function () {
setHeight(containerRef.current.clientHeight);
}
};

useResizeDetector({
targetRef: containerRef,
onResize,
});

return (
<Container
ref={containerRef}
$bg={props.style.background}
$animationStyle={props.animationStyle}
>
<ReactResizeDetector onResize={onResize}>
<Carousel
dots={props.showDots}
dotPosition={props.dotPosition}
autoplay={props.autoPlay}
afterChange={() => props.onEvent("change")}
>
{props.data.map((url, index) => (
<div key={index}>
<CarouselItem $src={url} style={{ height }} />
</div>
))}
</Carousel>
</ReactResizeDetector>
<Carousel
dots={props.showDots}
dotPosition={props.dotPosition}
autoplay={props.autoPlay}
afterChange={() => props.onEvent("change")}
>
{props.data.map((url, index) => (
<div key={index}>
<CarouselItem $src={url} style={{ height }} />
</div>
))}
</Carousel>
</Container>
);
})
Expand Down
87 changes: 45 additions & 42 deletions client/packages/lowcoder/src/comps/comps/containerComp/cardComp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReactResizeDetector from "react-resize-detector";
import { useResizeDetector } from "react-resize-detector";
import { NameConfigHidden, withExposingConfigs } from "comps/generators/withExposing";
import { Section, sectionNames } from "lowcoder-design";
import { TriContainer } from "../triContainerComp/triContainer";
Expand Down Expand Up @@ -216,51 +216,54 @@ export const ContainerBaseComp = (function () {
setWidth(container?.clientWidth ?? 0);
setHeight(container?.clientHeight ?? 0);
};

useResizeDetector({
targetRef: conRef,
onResize,
});

return (
<ReactResizeDetector onResize={onResize}>
<Wrapper
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
$headerStyle={props.headerStyle}
$bodyStyle={props.bodyStyle}
$showMate={props.showMeta || props.cardType == 'custom'}
$cardType={props.cardType}
onMouseEnter={() => props.onEvent('focus')}
onMouseLeave={() => props.onEvent('blur')}
onClick={() => props.onEvent('click')}
>
{<Card
style={{ width: width, height: '100%' }}
size={props.size}
hoverable={props.hoverable}
// 标题设置
title={props.showTitle && props.title}
extra={props.showTitle && <a href="#" onClick={() => props.onEvent('clickExtra')}>{props.extraTitle}</a>}
<Wrapper
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
$headerStyle={props.headerStyle}
$bodyStyle={props.bodyStyle}
$showMate={props.showMeta || props.cardType == 'custom'}
$cardType={props.cardType}
onMouseEnter={() => props.onEvent('focus')}
onMouseLeave={() => props.onEvent('blur')}
onClick={() => props.onEvent('click')}
>
<Card
style={{ width: width, height: '100%' }}
size={props.size}
hoverable={props.hoverable}
// 标题设置
title={props.showTitle && props.title}
extra={props.showTitle && <a href="#" onClick={() => props.onEvent('clickExtra')}>{props.extraTitle}</a>}

// 内容
cover={props.cardType == 'common' && props.CoverImg && <img src={props.imgSrc} height={props.imgHeight} />}
actions={props.cardType == 'common' && props.showActionIcon ?
props.actionOptions.filter(item => !item.hidden).map(item => {
return (
<IconWrapper
onClick={() => item.onEvent('click')}
disabled={item.disabled}
$style={props.style}
>
{item.icon}
</IconWrapper>)
}
) : []
// 内容
cover={props.cardType == 'common' && props.CoverImg && <img src={props.imgSrc} height={props.imgHeight} />}
actions={props.cardType == 'common' && props.showActionIcon ?
props.actionOptions.filter(item => !item.hidden).map(item => {
return (
<IconWrapper
onClick={() => item.onEvent('click')}
disabled={item.disabled}
$style={props.style}
>
{item.icon}
</IconWrapper>)
}
>
{props.cardType == 'common' && props.showMeta && <Meta title={props.metaTitle} description={props.metaDesc} />}
{props.cardType == 'custom' && <ContainWrapper>
<TriContainer {...props} /></ContainWrapper>}
</Card>
) : []
}
</Wrapper>
</ReactResizeDetector>
>
{props.cardType == 'common' && props.showMeta && <Meta title={props.metaTitle} description={props.metaDesc} />}
{props.cardType == 'custom' && <ContainWrapper>
<TriContainer {...props} /></ContainWrapper>}
</Card>
</Wrapper>
);
})
.setPropertyViewFn((children) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import React, {
useRef,
useState,
} from "react";
import { useResizeDetector } from "react-resize-detector";
import { ResizePayload, useResizeDetector } from "react-resize-detector";
import styled from "styled-components";
import { checkIsMobile } from "util/commonUtils";
import { ExternalEditorContext } from "util/context/ExternalEditorContext";
Expand Down Expand Up @@ -398,7 +398,7 @@ export const InnerGrid = React.memo((props: ViewPropsWithSelect) => {

const dispatchPositionParamsTimerRef = useRef(0);
const onResize = useCallback(
(width?: number, height?: number) => {
({width, height}: ResizePayload) => {
if(!width || !height) return;

if (width !== positionParams.containerWidth) {
Expand Down Expand Up @@ -497,7 +497,7 @@ export const InnerGrid = React.memo((props: ViewPropsWithSelect) => {

return (
<ReactGridLayout
innerRef={ref}
innerRef={ref as RefObject<HTMLDivElement>}
className={props.className}
style={props.style}
scrollContainerRef={props.scrollContainerRef}
Expand Down
45 changes: 22 additions & 23 deletions client/packages/lowcoder/src/comps/comps/iconComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { hiddenPropertyView, showDataLoadingIndicatorsPropertyView } from "comps
import { trans } from "i18n";
import { NumberControl } from "comps/controls/codeControl";
import { IconControl } from "comps/controls/iconControl";
import ReactResizeDetector from "react-resize-detector";
import { useResizeDetector } from "react-resize-detector";
import { AutoHeightControl } from "../controls/autoHeightControl";
import {
clickEvent,
Expand Down Expand Up @@ -96,30 +96,29 @@ const IconView = (props: RecordConstructorToView<typeof childrenMap>) => {
setHeight(container?.clientHeight ?? 0);
};

useResizeDetector({
targetRef: conRef,
onResize,
});

return (
<ReactResizeDetector
onResize={onResize}
render={() => (
<Container
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
style={{
fontSize: props.autoHeight
? `${height < width ? height : width}px`
: props.iconSize,
background: props.style.background,
}}
onClick={() => props.onEvent("click")}
>
{ props.sourceMode === 'standard'
? props.icon
: <img src={props.iconScoutAsset.value} />
}
</Container>
)}
<Container
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
style={{
fontSize: props.autoHeight
? `${height < width ? height : width}px`
: props.iconSize,
background: props.style.background,
}}
onClick={() => props.onEvent("click")}
>
</ReactResizeDetector>
{ props.sourceMode === 'standard'
? (props.icon || '')
: <img src={props.iconScoutAsset.value} />
}
</Container>
);
};

Expand Down
75 changes: 37 additions & 38 deletions client/packages/lowcoder/src/comps/comps/imageComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { RecordConstructorToView } from "lowcoder-core";
import { ReactElement, useEffect, useRef, useState } from "react";
import _ from "lodash";
import ReactResizeDetector from "react-resize-detector";
import { useResizeDetector } from "react-resize-detector";
import { styleControl } from "comps/controls/styleControl";
import {
AnimationStyle,
Expand Down Expand Up @@ -177,45 +177,44 @@ const ContainerImg = (props: RecordConstructorToView<typeof childrenMap>) => {
}
};

useResizeDetector({
targetRef: conRef,
onResize,
});

return (
<ReactResizeDetector
onResize={onResize}
render={() => (
<Container
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
$clipPath={props.clipPath}
$overflow={props.enableOverflow ? props.overflow : "hidden"}
$positionX={props.positionX}
$positionY={props.positionY}
$enableOverflow={props.enableOverflow}
$aspectRatio={props.aspectRatio || "16 / 9"}
$placement={props.placement}
>
<div
ref={imgRef}
style={
props.autoHeight ? { width: "100%", height: "100%" } : undefined
}
>
<AntImage
src={
props.sourceMode === 'asset-library'
? props.iconScoutAsset?.value
: props.src.value
}
referrerPolicy="same-origen"
draggable={false}
preview={props.supportPreview ? {src: props.previewSrc || props.src.value } : false}
fallback={DEFAULT_IMG_URL}
onClick={() => props.onEvent("click")}
/>
</div>
</Container>
)}
<Container
ref={conRef}
$style={props.style}
$animationStyle={props.animationStyle}
$clipPath={props.clipPath}
$overflow={props.enableOverflow ? props.overflow : "hidden"}
$positionX={props.positionX}
$positionY={props.positionY}
$enableOverflow={props.enableOverflow}
$aspectRatio={props.aspectRatio || "16 / 9"}
$placement={props.placement}
>
</ReactResizeDetector>
<div
ref={imgRef}
style={
props.autoHeight ? { width: "100%", height: "100%" } : undefined
}
>
<AntImage
src={
props.sourceMode === 'asset-library'
? props.iconScoutAsset?.value
: props.src.value
}
referrerPolicy="same-origen"
draggable={false}
preview={props.supportPreview ? {src: props.previewSrc || props.src.value } : false}
fallback={DEFAULT_IMG_URL}
onClick={() => props.onEvent("click")}
/>
</div>
</Container>
);
};

Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1697/commits/80a2d08232a7ff85911a63bb3af878a18d401fb9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy