diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index e8ad171515..a1a21fe08e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -26,8 +26,9 @@ You have to add `tableWidgetDocumentTransform` to your extensionRegistry to use - https://github.com/eclipse-sirius/sirius-web/issues/4635[#4635] [sirius-web] Since the switch from using the `Project#id` as the `editingContextId` to the use of the `SemanticData#id` instead, `IProjectEditingContextApplicationService` could have been used as a service to switch from the `Project#id` to the `editingContextId`. Given that it is an application service, it comes with some constraints with regard to transactions, for that a new reusable service named `IProjectEditingContextService` has now been added to manipulate the `projectId` and `editingContextId` instead. `IProjectEditingContextApplicationService` has thus been modified to be more focused on its original goal as the behavior of the `Project#currentEditingContext` datafetcher. - - https://github.com/eclipse-sirius/sirius-web/issues/4443[#4443] [table] `ICell` has a new method `getDescriptionId` that all implementors should provide. +- https://github.com/eclipse-sirius/sirius-web/issues/4577[#4577] [diagram] Remove `payload` and `refreshEventPayloadId` from `DiagramContext` since they are not used anymore + === Dependency update @@ -77,7 +78,7 @@ Except for the specific case where `cause === 'refresh'` in `DiagramRenderer` (w - https://github.com/eclipse-sirius/sirius-web/issues/4583[#4583] [sirius-web] Improve the performance to retrieve if a representation is view based - https://github.com/eclipse-sirius/sirius-web/issues/4451[#4451] [diagram] Keep using the same node after a refresh if possible in order to avoid rerendering all the nodes after converting the diagram - https://github.com/eclipse-sirius/sirius-web/issues/4575[#4575] [diagram] Memoize the style of a label to avoid rerendering them all when refreshing the diagram -- https://github.com/eclipse-sirius/sirius-web/issues/4577[#4577] [diagram] Remove `payload` and `refreshEventPayloadId` from `DiagramContext` and add a new context `DiagramPayloadContext` to retrieve these values, this should improve the performance of the diagrams +- https://github.com/eclipse-sirius/sirius-web/issues/4577[#4577] [diagram] Improve the performance of the diagram by removing useless data from `DiagramContext` diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.ts deleted file mode 100644 index a5f14fd8ca..0000000000 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.ts +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2025 Obeo. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -import React from 'react'; -import { DiagramPayloadContextValue } from './DiagramPayloadContext.types'; - -const value: DiagramPayloadContextValue = { - refreshEventPayloadId: '', - payload: null, -}; - -export const DiagramPayloadContext = React.createContext(value); diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.types.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.types.ts deleted file mode 100644 index 96ff2568a6..0000000000 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/contexts/DiagramPayloadContext.types.ts +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2025 Obeo. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ - -import { GQLDiagramEventPayload } from '../graphql/subscription/diagramEventSubscription.types'; - -export interface DiagramPayloadContextValue { - refreshEventPayloadId: string; - payload: GQLDiagramEventPayload | null; -} diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/index.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/index.ts index 6cedc48437..52c06c606a 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/index.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/index.ts @@ -13,8 +13,6 @@ export { DiagramContext } from './contexts/DiagramContext'; export type { DiagramContextValue } from './contexts/DiagramContext.types'; -export { DiagramPayloadContext } from './contexts/DiagramPayloadContext'; -export type { DiagramPayloadContextValue } from './contexts/DiagramPayloadContext.types'; export { NodeTypeContext } from './contexts/NodeContext'; export type { NodeTypeContextValue, NodeTypeContributionElement } from './contexts/NodeContext.types'; export { convertLineStyle, isListLayoutStrategy } from './converter/convertDiagram'; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/representation/DiagramSubscriptionProvider.tsx b/packages/diagrams/frontend/sirius-components-diagrams/src/representation/DiagramSubscriptionProvider.tsx index edcb619b24..e3a3a97415 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/representation/DiagramSubscriptionProvider.tsx +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/representation/DiagramSubscriptionProvider.tsx @@ -14,7 +14,6 @@ import LinearProgress from '@mui/material/LinearProgress'; import Typography from '@mui/material/Typography'; import { memo, useEffect, useState } from 'react'; -import { DiagramPayloadContext } from '../contexts/DiagramPayloadContext'; import { DialogContextProvider } from '../dialog/DialogContext'; import { GQLDiagramEventPayload, @@ -59,23 +58,17 @@ export const DiagramSubscriptionProvider = memo(({ diagramId, editingContextId } return ( - - -
- -
-
-
+ +
+ +
+
); });