Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
chore(webv2): enable oxlint's per-category React Compiler rules
Josh Corbett1dc0def726f4
diff --git a/invokeai/frontend/webv2/.oxlintrc.json b/invokeai/frontend/webv2/.oxlintrc.jsonindex b0cc5d578e..4d3180a47b 100644--- a/invokeai/frontend/webv2/.oxlintrc.json+++ b/invokeai/frontend/webv2/.oxlintrc.json@@ -52,7 +52,32 @@"react/no-unknown-property": "error","react/jsx-no-useless-fragment": "error","react/exhaustive-deps": "error",- "react/react-compiler": "error",++ // React Compiler diagnostics, split per category since oxlint 1.79.+ // Left off: `todo` (dynamic import / try-finally merely skip optimization),+ // `rule-suppression` (would flag every suppression below),+ // `exhaustive-effect-dependencies` and `memo-dependencies` (this codebase+ // deliberately lists identity-trigger deps next to useEffectEvent and+ // ref-only closures; `react/exhaustive-deps` above stays the dependency+ // gate).+ "react/capitalized-calls": "error",+ "react/error-boundaries": "error",+ "react/globals": "error",+ "react/hooks": "error",+ "react/immutability": "error",+ "react/incompatible-library": "error",+ "react/invariant": "error",+ "react/no-deriving-state-in-effects": "error",+ "react/preserve-manual-memoization": "error",+ "react/purity": "error",+ "react/refs": "error",+ "react/set-state-in-effect": "error",+ "react/set-state-in-render": "error",+ "react/static-components": "error",+ "react/syntax": "error",+ "react/unsupported-syntax": "error",+ "react/use-memo": "error",+ "react/void-use-memo": "error","react-hooks/exhaustive-deps": "error","react-hooks/rules-of-hooks": "error",diff --git a/invokeai/frontend/webv2/src/features/fonts/ui/FontsPage.tsx b/invokeai/frontend/webv2/src/features/fonts/ui/FontsPage.tsxindex 03446696aa..d028081ae0 100644--- a/invokeai/frontend/webv2/src/features/fonts/ui/FontsPage.tsx+++ b/invokeai/frontend/webv2/src/features/fonts/ui/FontsPage.tsx@@ -338,6 +338,7 @@ const FontLibrary = () => {);const query = useQuery(fontsQueryOptions(params));const fonts = query.data?.items ?? [];+ // eslint-disable-next-line react/incompatible-library -- TanStack Virtual exposes imperative functions that the compiler cannot memoize safely.const virtualizer = useVirtualizer({count: fonts.length,estimateSize: () => FONT_ROW_HEIGHT,diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryBoardMenu.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryBoardMenu.tsxindex 0e340f8401..77fb3ec661 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryBoardMenu.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryBoardMenu.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import type { GalleryBoard } from '@features/gallery/core/types';import { Dialog, HStack, Icon, Input, Menu, Portal, Stack, Text } from '@chakra-ui/react';@@ -36,6 +35,7 @@ export const GalleryBoardMenu = ({const [renameValue, setRenameValue] = useState('');const targetRef = useRef(target);+ // eslint-disable-next-line react/refstargetRef.current = target;const board = target?.board ?? null;diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetView.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetView.tsxindex f663465228..c4aede887c 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetView.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetView.tsx@@ -167,7 +167,7 @@ export const GalleryWidgetView = ({ presentation, region, runtime }: GalleryWidg// This ref is a live read port for an in-flight deletion. An effect would// leave a commit-sized stale window, while the action must compare against// the exact filter and selection from the latest render.- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refsitemActionContextRef.current = {filterIdentity: itemActionFilterIdentity,items: gallery.items,@@ -177,7 +177,7 @@ export const GalleryWidgetView = ({ presentation, region, runtime }: GalleryWidg// This is the matching live read port for in-flight uploads. The upload// target is captured at launch, while completion visibility must use the// board and view from the latest render.- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refsgalleryLocationRef.current = { galleryView, selectedBoardId };const getItemActionContext = useCallback(() => itemActionContextRef.current, []);diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsxindex bab1a21233..2e25eb43a2 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx@@ -82,9 +82,9 @@ export const GalleryPickerView = ({// search loads; skeletons only ever show before anything has loaded.const [lastItems, setLastItems] = useState<GalleryItem[] | null>(null);- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refsselectionRef.current = selection;- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refsloadMoreRef.current = data.loadMore;if (data.items !== null && data.items !== lastItems) {diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsxindex 124cfba4d7..8b9f668f6f 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx@@ -113,7 +113,7 @@ const Probe = ({const currentGalleryLocationRef = useRef({ galleryView, selectedBoardId });// Match GalleryWidgetView's render-assigned live-read port.- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refscurrentGalleryLocationRef.current = { galleryView, selectedBoardId };const getCurrentGalleryLocation = useCallback(() => currentGalleryLocationRef.current, []);const actions = useGalleryActions({diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryUploadAction.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryUploadAction.browser.test.tsxindex 485071ce0c..9cffbd59c8 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryUploadAction.browser.test.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryUploadAction.browser.test.tsx@@ -121,7 +121,7 @@ const Probe = ({}) => {const currentGalleryLocationRef = useRef({ galleryView, selectedBoardId });- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/refscurrentGalleryLocationRef.current = { galleryView, selectedBoardId };const getCurrentGalleryLocation = useCallback(() => currentGalleryLocationRef.current, []);const uploadFiles = useGalleryUploadAction({diff --git a/invokeai/frontend/webv2/src/features/generation/ui/GenerateDimensionFields.tsx b/invokeai/frontend/webv2/src/features/generation/ui/GenerateDimensionFields.tsxindex 4b19347b32..9c17bd7baa 100644--- a/invokeai/frontend/webv2/src/features/generation/ui/GenerateDimensionFields.tsx+++ b/invokeai/frontend/webv2/src/features/generation/ui/GenerateDimensionFields.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler, react-perf/jsx-no-new-object-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-jsx-as-prop */+/* eslint-disable react-perf/jsx-no-new-object-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-jsx-as-prop */import type { AspectRatioId, GenerateModelConfig, GenerateSettings } from '@features/generation/core/types';import { Badge, Box, HStack, Icon, InputGroup, NumberInput, Stack, Text } from '@chakra-ui/react';@@ -261,6 +261,7 @@ export const GenerateDimensionFields = ({if (settings.width === draftDimensions.width && settings.height === draftDimensions.height) {pendingDimensionsRef.current = null;+ // eslint-disable-next-line react/set-state-in-effectsetDraftDimensions(null);return;}diff --git a/invokeai/frontend/webv2/src/features/generation/ui/GenerateSettingsForm.tsx b/invokeai/frontend/webv2/src/features/generation/ui/GenerateSettingsForm.tsxindex 0a764b9b32..e2a6c3ab0e 100644--- a/invokeai/frontend/webv2/src/features/generation/ui/GenerateSettingsForm.tsx+++ b/invokeai/frontend/webv2/src/features/generation/ui/GenerateSettingsForm.tsx@@ -1,5 +1,4 @@import type { GenerationModelCatalogItem as ModelConfig } from '@features/generation/contracts';-/* eslint-disable react/react-compiler */import type { GenerateModelConfig, GenerateSettings, LoraModelConfig } from '@features/generation/core/types';import { Stack } from '@chakra-ui/react';@@ -60,7 +59,9 @@ export const GenerateSettingsForm = ({const onCommitSettingsRef = useRef(onCommitSettings);const onPatchSettingsRef = useRef(onPatchSettings);+ // eslint-disable-next-line react/refsonCommitSettingsRef.current = onCommitSettings;+ // eslint-disable-next-line react/refsonPatchSettingsRef.current = onPatchSettings;const setDraft = (nextSettings: GenerateSettings) => {diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PositivePromptActions.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PositivePromptActions.tsxindex c5a1c0f3b5..6bf02ae87e 100644--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PositivePromptActions.tsx+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PositivePromptActions.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import type { GenerationModelCatalogItem as ModelConfig, PromptHistoryItem } from '@features/generation/contracts';import type { PromptTemplateSnapshot } from '@features/generation/core/promptTemplates';import type { GenerateLora, GenerateModelConfig } from '@features/generation/core/types';@@ -425,6 +424,7 @@ const ExpandPromptButton = ({const effectiveSystemPromptId = resolveSelectedSystemPromptId(systemPrompts.prompts, selectedSystemPromptId);const selectedSystemPrompt = systemPrompts.prompts.find((prompt) => prompt.id === effectiveSystemPromptId);+ // eslint-disable-next-line react/refsactiveProjectIdRef.current = activeProjectId;useMountEffect(() => {@@ -583,6 +583,7 @@ const ImageToPromptButton = ({const droppedImageName = droppedImage.image?.imageName ?? null;const clearDroppedImage = droppedImage.onClear;+ // eslint-disable-next-line react/refsactiveProjectIdRef.current = activeProjectId;useMountEffect(() => {@@ -595,6 +596,7 @@ const ImageToPromptButton = ({// dropped twice still reads as two separate gestures.useEffect(() => {if (droppedImageName !== null) {+ // eslint-disable-next-line react/set-state-in-effectsetIsOpen(true);}}, [droppedImageName]);diff --git a/invokeai/frontend/webv2/src/features/identity/ui/UserManagement.tsx b/invokeai/frontend/webv2/src/features/identity/ui/UserManagement.tsxindex d5d44a75cb..6da40dff98 100644--- a/invokeai/frontend/webv2/src/features/identity/ui/UserManagement.tsx+++ b/invokeai/frontend/webv2/src/features/identity/ui/UserManagement.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import { Avatar, Badge, Box, Center, Flex, HStack, Spinner, Stack, Switch, Table, Text } from '@chakra-ui/react';import { deleteUser, listUsers, updateUser, type UserDTO } from '@features/identity/data/api';import { useAuthSession } from '@features/identity/session';@@ -66,6 +65,7 @@ const UsersDirectory = ({ currentUserId }: { currentUserId: string }) => {}, [t]);useEffect(() => {+ // eslint-disable-next-line react/set-state-in-effectvoid refresh();}, [refresh]);diff --git a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsxindex b88162b0d4..f75a6bdd60 100644--- a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler, react-perf/jsx-no-new-object-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-jsx-as-prop */+/* eslint-disable react-perf/jsx-no-new-object-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-jsx-as-prop */import type { ModelConfig, ModelTaxonomyType } from '@features/models/core/types';import type { PickerGroup, PickerOptionState } from '@platform/ui/Picker';@@ -47,6 +47,7 @@ const useLazyRelatedModelKeys = (modelKey: string | null): readonly string[] | nuseEffect(() => {if (modelKey === null) {+ // eslint-disable-next-line react/set-state-in-effectsetRelatedKeys(null);return;}diff --git a/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx b/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsxindex 7434f0942c..3d36826919 100644--- a/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler, react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */+/* eslint-disable react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */import type { HFTokenStatus } from '@features/models/core/types';import type { ElementType } from 'react';diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelImageUpload.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelImageUpload.tsxindex 04d7672ad8..ffe246450a 100644--- a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelImageUpload.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelImageUpload.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler, react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */+/* eslint-disable react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */import type { ModelConfig } from '@features/models/core/types';import { Box, Flex, Icon, Image, Stack, Text } from '@chakra-ui/react';diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowUiContext.browser.test.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowUiContext.browser.test.tsxindex 216236440a..592fd9eaae 100644--- a/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowUiContext.browser.test.tsx+++ b/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowUiContext.browser.test.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler -- test instrumentation intentionally records render counts */+/* eslint-disable react/globals, react/immutability -- test instrumentation intentionally records render counts */import type { ReactNode } from 'react';import { act, useState } from 'react';diff --git a/invokeai/frontend/webv2/src/platform/ui/ConfirmDialog.tsx b/invokeai/frontend/webv2/src/platform/ui/ConfirmDialog.tsxindex 895227ebd2..810cacf4f6 100644--- a/invokeai/frontend/webv2/src/platform/ui/ConfirmDialog.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/ConfirmDialog.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import { Dialog, Portal, Stack, Text } from '@chakra-ui/react';import { useCallback, useRef, useState, type ReactNode } from 'react';diff --git a/invokeai/frontend/webv2/src/platform/ui/ResizableTextarea.tsx b/invokeai/frontend/webv2/src/platform/ui/ResizableTextarea.tsxindex ce5a644356..2f0f531800 100644--- a/invokeai/frontend/webv2/src/platform/ui/ResizableTextarea.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/ResizableTextarea.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import type {ComponentProps,KeyboardEvent as ReactKeyboardEvent,diff --git a/invokeai/frontend/webv2/src/platform/ui/Tooltip.tsx b/invokeai/frontend/webv2/src/platform/ui/Tooltip.tsxindex 71eb86b877..12035d62d2 100644--- a/invokeai/frontend/webv2/src/platform/ui/Tooltip.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/Tooltip.tsx@@ -1,4 +1,3 @@-/* eslint-disable react/react-compiler */import { Tooltip as ChakraTooltip, Portal } from '@chakra-ui/react';import {cloneElement,@@ -120,6 +119,7 @@ export const Tooltip = (props: TooltipProps) => {hasTriggerPassthrough && isValidElement<TooltipChildProps>(children)? cloneElement(children as ReactElement<TooltipChildProps>, {...mergedTriggerProps,+ // eslint-disable-next-line react/refsref: composeRefs(children.props.ref, explicitTriggerRef, ref),}): children;diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx b/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsxindex 9a44965466..4ccdfa736e 100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx@@ -1,6 +1,5 @@import type { GalleryBoard, GalleryImage, GalleryItem, GalleryItemKey, GalleryItemRef } from '@features/gallery';import type { GalleryItemContextMenuTarget } from '@features/gallery/react';-/* eslint-disable react/react-compiler */import type { GalleryCanvasImportDestination } from '@workbench/canvas-operations/api';import { HStack, Icon, Menu, Portal, ScrollArea, Text } from '@chakra-ui/react';@@ -231,6 +230,7 @@ const GalleryItemContextMenuContent = ({const itemRef = target.itemRefs[0] ?? null;const isBulk = target.itemRefs.length > 1;+ // eslint-disable-next-line react/refstargetRef.current = target;const positioning = useMemo(@@ -594,6 +594,7 @@ const ImageContextMenuContent = ({const targetRef = useRef(target);const imageRef = useRef<GalleryImage | null>(null);+ // eslint-disable-next-line react/refstargetRef.current = target;const isBulk = images.length > 1;@@ -601,6 +602,7 @@ const ImageContextMenuContent = ({const recallRequestKey = getImageContextMenuRecallRequestKey(image, isBulk);const getImageRecallCapabilities = actions.getImageRecallCapabilities;+ // eslint-disable-next-line react/refsimageRef.current = image;useEffect(() => {@@ -843,6 +845,7 @@ const useSelectForCompareHandler = (actions: ImageActions, image: GalleryImage)useCallback(() => actions.selectForCompare(image), [actions, image]);const useUseAsReferenceImageHandler = (actions: ImageActions, image: GalleryImage) =>+ // eslint-disable-next-line react/hooks -- `useAsReferenceImage` is a plain action method; the compiler reads its name as a hook.useCallback(() => actions.useAsReferenceImage(image), [actions, image]);const OpenInNewTabQuickMenuItem = ({ image }: { image: GalleryImage }) => {diff --git a/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx b/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsxindex c45141f25a..74112bf524 100644--- a/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx+++ b/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx@@ -243,7 +243,6 @@ export interface CommandPaletteRowsHandle {scrollToIndex: (index: number) => void;}-// eslint-disable-next-line react/react-compiler -- TanStack Virtual exposes imperative functions that the compiler cannot memoize safely.export const CommandPaletteRows = ({activeRowId,isBusy,@@ -267,6 +266,7 @@ export const CommandPaletteRows = ({);const getRowKey = useCallback((index: number) => rows[index]?.id ?? index, [rows]);const getScrollElement = useCallback(() => scrollElement, [scrollElement]);+ // eslint-disable-next-line react/incompatible-library -- TanStack Virtual exposes imperative functions that the compiler cannot memoize safely.const virtualizer = useVirtualizer({count: rows.length,estimateSize: estimateRowSize,diff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetHosts.tsx b/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetHosts.tsxindex f02805264c..9216a879ea 100644--- a/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetHosts.tsx+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetHosts.tsx@@ -12,7 +12,7 @@ const WidgetHost = ({ widget }: { widget: ReturnType<typeof getWidgetHosts>[numb// stable across renders; the false positive disappears the moment the// value is read through a property access instead of being the call's// direct result, which is what the sibling `WidgetRenderer` slots do.- // eslint-disable-next-line react/react-compiler+ // eslint-disable-next-line react/static-componentsreturn <Host />;};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasWidgetView.tsxindex f4dae466dc..2607966100 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasWidgetView.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasWidgetView.tsx@@ -298,7 +298,7 @@ export const CanvasWidgetView = ({ runtime }: WidgetViewProps) => {return () => engine?.tools.setInteractionLocked(false);}, [engine, isInteractionLocked]);- /* eslint-disable react/react-compiler -- imperative engine payload is mutable by design */+ /* eslint-disable react/preserve-manual-memoization -- imperative engine payload is mutable by design */const commitSelectedStagedImage = useCallback((continueStaging: boolean) => {if (selectedSlot?.kind === 'candidate') {@@ -311,9 +311,9 @@ export const CanvasWidgetView = ({ runtime }: WidgetViewProps) => {},[engine, selectedSlot, stagingArea.selectedImageIndex]);+ /* eslint-enable react/preserve-manual-memoization */const acceptStagedImage = useCallback(() => commitSelectedStagedImage(false), [commitSelectedStagedImage]);const saveStagedImageAndContinue = useCallback(() => commitSelectedStagedImage(true), [commitSelectedStagedImage]);- /* eslint-enable react/react-compiler */const cancelQueueItem = useCallback((queueItemId: string) => queue.cancel(undefined, queueItemId), [queue]);const cycleStagedImage = useCallback((direction: -1 | 1) => canvasDispatch({ direction, type: 'cycleStagedImage' }),diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsxindex adea4cced0..9776a191ec 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx@@ -68,8 +68,6 @@ const LayerThumbnailContent = ({},// `version` is a deliberate identity trigger: a repaint bumps it, giving the// callback a new identity so React re-runs it and re-blits the cache.- // react-compiler can't model that implicit use, so it is suppressed here.- // eslint-disable-next-line react/react-compiler[engine, layer.id, status, version]);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsxindex 8c9296f75b..2fdf663d80 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx@@ -1,5 +1,5 @@+/* eslint-disable react/refs, react/immutability */import type { GalleryItemKey, GalleryItemRef } from '@features/gallery';-/* eslint-disable react/react-compiler */import type { StreamingImageSource } from '@platform/ui/streaming-image/streamingImageSource';import { Badge, Flex, Text } from '@chakra-ui/react';diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/useCompareLoupe.ts b/invokeai/frontend/webv2/src/workbench/widgets/preview/useCompareLoupe.tsindex fef60cbc9a..10184c5d88 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/useCompareLoupe.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/useCompareLoupe.ts@@ -7,7 +7,6 @@ import {zoomAtPoint as calculateZoomAtPoint,type PanZoomPoint,} from '@workbench/panZoom';-/* eslint-disable react/react-compiler */import { useCallback, useRef, useState, type MouseEvent, type PointerEvent as ReactPointerEvent } from 'react';import { capturePointer, releasePointer, trackPointerDown } from './loupeGestures';@@ -83,6 +82,7 @@ export const useCompareLoupe = ({const pointersRef = useRef(new Map<number, PanZoomPoint>());const pinchRef = useRef<PinchGesture | null>(null);const naturalWidthRef = useRef(naturalWidth);+ // eslint-disable-next-line react/refsnaturalWidthRef.current = naturalWidth;const [isZoomed, setIsZoomed] = useState(false);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/usePreviewLoupe.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/usePreviewLoupe.browser.test.tsxindex 0aa73ba8a5..3cc8b8b734 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/usePreviewLoupe.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/usePreviewLoupe.browser.test.tsx@@ -1,4 +1,4 @@-/* eslint-disable react/react-compiler */+/* eslint-disable react/refs */import { WHEEL_ZOOM_STEP } from '@workbench/panZoom';import { act } from 'react';import { createRoot, type Root } from 'react-dom/client';