Skip to content

FIREFLY-1943: React Compiler bugs#1922

Draft
kpuriIpac wants to merge 3 commits intodevfrom
FIREFLY-1943-react-compiler-bugs
Draft

FIREFLY-1943: React Compiler bugs#1922
kpuriIpac wants to merge 3 commits intodevfrom
FIREFLY-1943-react-compiler-bugs

Conversation

@kpuriIpac
Copy link
Contributor

@kpuriIpac kpuriIpac commented Mar 18, 2026

Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1943

  • fixes bugs introduced in code after enabling react compiler
    • see ticket for the 4 main bugs resolved in this PR

Testing:
Firefly, Euclid and Spherex

  • Test bugs found in ticket for Firefly and Spherex
  • For Euclid, test TAP to do a search and check ADQL in job history to ensure the search was correct

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes several TAP UI regressions introduced after enabling the React Compiler, focusing on stabilizing derived state, service option handling, and constraint aggregation across TAP search panels.

Changes:

  • Normalize/dedupe TAP service URLs and make service option generation deterministic (makeTapServiceOptions, normalizeTapUrl).
  • Refactor TAP search panel/service selection and Spatial constraints computation to be React-Compiler-friendly (avoid mutable/shared references and repeated side effects).
  • Enable the React Compiler Babel plugin in the webpack build and improve <Option> key stability in list rendering.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/firefly/js/ui/tap/TapUtil.js Adds URL normalization + deterministic TAP service option merging/deduping; avoids mutating preference arrays.
src/firefly/js/ui/tap/TapSearchRootPanel.jsx Reworks service option derivation and delete handling; moves one-time init work into effects and memoizes options.
src/firefly/js/ui/tap/SpatialSearch.jsx Replaces per-render effect-driven constraint state updates with a memoized constraint result.
src/firefly/js/ui/tap/Constraints.js Expands upload/constraint detection to support adqlConstraintsAry in addition to adqlConstraint.
src/firefly/js/ui/ListBoxInputField.jsx Uses a stable key derived from option content instead of array index.
buildScript/webpack.config.js Turns on the React Compiler Babel plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +147 to 156
const onDeleteServiceOption = (deletedValue) => {
deleteUserService(deletedValue);

if (serviceUrl === deletedValue) {
setServiceUrl('');
setTapBrowserState({...getTapBrowserState(), serviceUrl: ''});
setVal(ADQL_QUERY_KEY, '');
setFld(ADQL_QUERY_KEY, {placeholder: '', value: ''});
setObsCoreTableModel(undefined);
}
Comment on lines +241 to +256
const constraintResult = React.useMemo(() => {
const constraints = makeSpatialConstraints(
columnsModel, obsCoreEnabled, makeFldObj(fldListAry),
uploadInfo, tableName, canUpload, useSIAv2
);

return {
...constraints,
constraintErrors: [...(constraints.errAry ?? [])],
simpleError: constraints.errAry?.[0] ?? '',
};
}, [columnsModel, obsCoreEnabled, uploadInfo, tableName, canUpload,
useSIAv2, targetWp, spatialRegOp, spatialType, spatialMethodVal,
radiusVal, polygonCornersVal, centerLonVal, centerLatVal,
uploadCenterLonVal, uploadCenterLatVal, cornerCalcTypeVal, closestVal,
]);
Comment on lines 19 to 34
@@ -16,7 +29,8 @@ export function isTapUpload(tapBrowserState) {
*/
export function getUploadConstraint(tapBrowserState) {
const {constraintFragments}= tapBrowserState;
return [...constraintFragments.values()].find( (c) => Boolean(c.uploadFile && c.TAP_UPLOAD && c.adqlConstraint));
return [...constraintFragments.values()]
.find((c) => Boolean(c.uploadFile && c.TAP_UPLOAD && hasAdqlConstraint(c)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants