Skip to content
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

[SIEM] Upgrades react-redux and utilize React.memo for performance gains #43029

Merged
merged 4 commits into from
Aug 10, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"react-hooks-testing-library": "^0.5.0",
"react-input-range": "^1.3.0",
"react-markdown": "^3.4.1",
"react-redux": "^5.0.7",
"react-redux": "^5.1.1",
"react-router-dom": "^4.3.1",
"react-sizeme": "^2.3.6",
"reactcss": "1.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ export const AndOrBadge = pure<{ type: AndOr }>(({ type }) => {
</RoundedBadge>
);
});

AndOrBadge.displayName = 'AndOrBadge';
2 changes: 2 additions & 0 deletions x-pack/legacy/plugins/siem/public/components/arrows/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ export const ArrowHead = pure<{
}>(({ direction }) => (
<EuiIcon color="subdued" data-test-subj="arrow-icon" size="s" type={direction} />
));

ArrowHead.displayName = 'ArrowHead';
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ export const CertificateFingerprint = pure<{
</DraggableBadge>
);
});

CertificateFingerprint.displayName = 'CertificateFingerprint';
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export const AreaChartBaseComponent = React.memo<{
) : null;
});

AreaChartBaseComponent.displayName = 'AreaChartBaseComponent';

export const AreaChartWithCustomPrompt = React.memo<{
data: ChartConfigsData[] | null | undefined;
height: number | null | undefined;
Expand All @@ -139,6 +141,8 @@ export const AreaChartWithCustomPrompt = React.memo<{
);
});

AreaChartWithCustomPrompt.displayName = 'AreaChartWithCustomPrompt';

export const AreaChart = React.memo<{
areaChart: ChartConfigsData[] | null | undefined;
configs?: ChartSeriesConfigs | undefined;
Expand All @@ -156,3 +160,5 @@ export const AreaChart = React.memo<{
)}
</AutoSizer>
));

AreaChart.displayName = 'AreaChart';
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export const BarChartBaseComponent = React.memo<{
) : null;
});

BarChartBaseComponent.displayName = 'BarChartBaseComponent';

export const BarChartWithCustomPrompt = React.memo<{
data: ChartConfigsData[] | null | undefined;
height: number | null | undefined;
Expand All @@ -101,6 +103,8 @@ export const BarChartWithCustomPrompt = React.memo<{
);
});

BarChartWithCustomPrompt.displayName = 'BarChartWithCustomPrompt';

export const BarChart = React.memo<{
barChart: ChartConfigsData[] | null | undefined;
configs?: ChartSeriesConfigs | undefined;
Expand All @@ -113,3 +117,5 @@ export const BarChart = React.memo<{
)}
</AutoSizer>
));

BarChart.displayName = 'BarChart';
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export const DirectionBadge = pure<{
value={direction}
/>
));

DirectionBadge.displayName = 'DirectionBadge';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ export const DroppableWrapper = pure<Props>(
</Droppable>
)
);

DroppableWrapper.displayName = 'DroppableWrapper';
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export const DraggableFieldBadge = pure<{ fieldId: string }>(({ fieldId }) => (
</FieldBadgeFlexGroup>
</EuiBadge>
));

DraggableFieldBadge.displayName = 'DraggableFieldBadge';
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const Content = pure<{
)
);

Content.displayName = 'Content';

/**
* Draggable text (or an arbitrary visualization specified by `children`)
* that's only displayed when the specified value is non-`null`.
Expand Down Expand Up @@ -116,6 +118,8 @@ export const DefaultDraggable = pure<DefaultDraggableType>(
) : null
);

DefaultDraggable.displayName = 'DefaultDraggable';

// Ref: https://github.com/elastic/eui/issues/1655
// const Badge = styled(EuiBadge)`
// vertical-align: top;
Expand Down Expand Up @@ -174,3 +178,5 @@ export const DraggableBadge = pure<BadgeDraggableType>(
</DefaultDraggable>
) : null
);

DraggableBadge.displayName = 'DraggableBadge';
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ export const Duration = pure<{
<FormattedDuration maybeDurationNanoseconds={value} tooltipTitle={fieldName} />
</DefaultDraggable>
));

Duration.displayName = 'Duration';
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ export const EmptyPage = pure<EmptyPageProps>(
/>
)
);

EmptyPage.displayName = 'EmptyPage';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export const EventDetails = pure<Props>(
);
}
);

EventDetails.displayName = 'EventDetails';
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ export const EventFieldsBrowser = pure<Props>(
);
}
);

EventFieldsBrowser.displayName = 'EventFieldsBrowser';
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ export const JsonView = pure<Props>(({ data }) => (
</JsonEditor>
));

JsonView.displayName = 'JsonView';

export const buildJsonView = (data: DetailItem[]) =>
data.reduce((accumulator, item) => set(item.field, item.originalValue, accumulator), {});
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ export const ExternalLinkIcon = pure<{
<LinkIcon color={color} data-test-subj="external-link-icon" size={iconSize} type={iconType} />
)
);

ExternalLinkIcon.displayName = 'ExternalLinkIcon';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export const DefaultFieldRenderer = pure<DefaultFieldRendererProps>(
}
);

DefaultFieldRenderer.displayName = 'DefaultFieldRenderer';

interface DefaultFieldRendererOverflowProps {
rowItems: string[];
idPrefix: string;
Expand Down Expand Up @@ -237,3 +239,5 @@ export const DefaultFieldRendererOverflow = pure<DefaultFieldRendererOverflowPro
);
}
);

DefaultFieldRendererOverflow.displayName = 'DefaultFieldRendererOverflow';
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ export const CategoriesPane = pure<Props>(
</>
)
);

CategoriesPane.displayName = 'CategoriesPane';
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ export const Category = pure<Props>(
</>
)
);

Category.displayName = 'Category';
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ export const DefaultCategoryButton = pure<{
</EuiButton>
</EuiToolTip>
));

DefaultCategoryButton.displayName = 'DefaultCategoryButton';
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ export const CategoryTitle = pure<Props>(({ filteredBrowserFields, categoryId, t
</EuiFlexItem>
</EuiFlexGroup>
));

CategoryTitle.displayName = 'CategoryTitle';
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ export const FieldName = pure<{
)}
/>
));

FieldName.displayName = 'FieldName';
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ export const FieldsPane = pure<Props>(
</>
)
);

FieldsPane.displayName = 'FieldsPane';
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const CountRow = pure<Pick<Props, 'filteredBrowserFields'>>(({ filteredBrowserFi
</CountsFlexGroup>
));

CountRow.displayName = 'CountRow';

const TitleRow = pure<{ onOutsideClick: () => void; onUpdateColumns: OnUpdateColumns }>(
({ onOutsideClick, onUpdateColumns }) => (
<EuiFlexGroup
Expand Down Expand Up @@ -109,6 +111,8 @@ const TitleRow = pure<{ onOutsideClick: () => void; onUpdateColumns: OnUpdateCol
)
);

TitleRow.displayName = 'TitleRow';

export const Header = pure<Props>(
({
isSearching,
Expand All @@ -134,3 +138,5 @@ export const Header = pure<Props>(
</HeaderContainer>
)
);

Header.displayName = 'Header';
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export const FiltersGlobal = pure<FiltersGlobalProps>(({ children }) => (
)}
</Sticky>
));

FiltersGlobal.displayName = 'FiltersGlobal';
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ export const FlowDirectionSelect = pure<Props>(({ onChangeDirection, selectedDir
</EuiFilterButton>
</EuiFilterGroup>
));

FlowDirectionSelect.displayName = 'FlowDirectionSelect';
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ export const FlowTargetSelect = pure<FlowTargetSelectProps>(
/>
)
);

FlowTargetSelect.displayName = 'FlowTargetSelect';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading