Skip to content

Commit

Permalink
[4577] Improve the performance of the diagrams
Browse files Browse the repository at this point in the history
Bug: #4577
Signed-off-by: Stéphane Bégaudeau <[email protected]>
  • Loading branch information
sbegaudeau committed Mar 6, 2025
1 parent d58d650 commit d790a47
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 62 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`



Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -59,23 +58,17 @@ export const DiagramSubscriptionProvider = memo(({ diagramId, editingContextId }

return (
<StoreContextProvider>
<DiagramPayloadContext.Provider
value={{
payload: payload,
refreshEventPayloadId: state.diagramRefreshedEventPayload.id,
}}>
<DialogContextProvider>
<div
style={{ display: 'inline-block', position: 'relative' }}
data-representation-kind="diagram"
data-representation-label={state.diagramRefreshedEventPayload.diagram.metadata.label}>
<DiagramRenderer
key={state.diagramRefreshedEventPayload.diagram.id}
diagramRefreshedEventPayload={state.diagramRefreshedEventPayload}
/>
</div>
</DialogContextProvider>
</DiagramPayloadContext.Provider>
<DialogContextProvider>
<div
style={{ display: 'inline-block', position: 'relative' }}
data-representation-kind="diagram"
data-representation-label={state.diagramRefreshedEventPayload.diagram.metadata.label}>
<DiagramRenderer
key={state.diagramRefreshedEventPayload.diagram.id}
diagramRefreshedEventPayload={state.diagramRefreshedEventPayload}
/>
</div>
</DialogContextProvider>
</StoreContextProvider>
);
});

0 comments on commit d790a47

Please sign in to comment.