Content-Length: 345835 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1697/commits/371a9bcd746e97f4aab560d16a92aeb0071db295

75 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
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
Prev Previous commit
Next Next commit
optimise event handler control
  • Loading branch information
raheeliftikhar5 committed May 22, 2025
commit 371a9bcd746e97f4aab560d16a92aeb0071db295
44 changes: 34 additions & 10 deletions client/packages/lowcoder/src/comps/controls/eventHandlerControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
QueryConfigItemWrapper,
ValueFromOption,
} from "lowcoder-design";
import { Fragment, ReactNode, useContext, useEffect, useState} from "react";
import { Fragment, ReactNode, useContext, useEffect, useState, useRef, useCallback } from "react";
import { memo } from "util/cacheUtils";
import { EditorContext } from "../editorState";
import { ActionSelectorControl } from "./actionSelector/actionSelectorControl";
Expand Down Expand Up @@ -59,7 +59,12 @@ class SingleEventHandlerControl<
return;
}
if (handler) {
return handler();
try {
return handler();
} catch (error) {
console.error('Error in event handler:', error);
return Promise.reject(error);
}
}
};
}
Expand Down Expand Up @@ -142,10 +147,9 @@ const EventHandlerControlPropertyView = (props: {
type?: "query";
eventConfigs: EventConfigsType;
}) => {


const editorState = useContext(EditorContext);
const [showNewCreate, setShowNewCreate] = useState(false);
const mountedRef = useRef(true);

const {
dispatch,
Expand All @@ -157,14 +161,27 @@ const EventHandlerControlPropertyView = (props: {
type
} = props;

useEffect(() => setShowNewCreate(false), [dispatch]);
// Reset state on unmount
useEffect(() => {
return () => {
mountedRef.current = false;
setShowNewCreate(false);
};
}, []);

// Reset showNewCreate when dispatch changes
useEffect(() => {
if (mountedRef.current) {
setShowNewCreate(false);
}
}, [dispatch]);

const queryHandler = {
name: eventConfigs[0].value,
};

const handleAdd = () => {
if (eventConfigs.length === 0) {
const handleAdd = useCallback(() => {
if (eventConfigs.length === 0 || !mountedRef.current) {
return;
}

Expand All @@ -190,8 +207,10 @@ const EventHandlerControlPropertyView = (props: {
handler: isInDevIde ? messageHandler : queryExecHandler,
} as const;
dispatch(pushAction(type !== "query" ? newHandler : queryHandler));
setShowNewCreate(true);
};
if (mountedRef.current) {
setShowNewCreate(true);
}
}, [dispatch, eventConfigs, editorState, pushAction, type]);

const renderItems = () =>
items.length > 0 ? (
Expand Down Expand Up @@ -251,7 +270,12 @@ class EventHandlerControl<T extends EventConfigsType> extends list(SingleEventHa
super.getView().forEach((child) => {
const ret = child.getView()(eventName);
if (ret) {
list.push(ret);
list.push(
Promise.resolve(ret).catch(error => {
console.error('Error in event handler:', error);
return Promise.reject(error);
})
);
}
});
return Promise.all(list);
Expand Down








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/371a9bcd746e97f4aab560d16a92aeb0071db295

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy