From cb244d1a5944ede51fc9b68c740e779b3bd38630 Mon Sep 17 00:00:00 2001
From: Anton Dosov <anton.dosov@elastic.co>
Date: Thu, 4 Mar 2021 11:42:36 +0100
Subject: [PATCH] Fix wrong import in data plugin causing 100kB bundle increase
 (#93448)

# Conflicts:
#	api_docs/data.json
#	api_docs/data_search.json
#	src/plugins/data/common/search/search_source/search_source.ts
---
 .eslintrc.js                                        |  2 +-
 packages/kbn-optimizer/limits.yml                   |  2 +-
 .../common/search/search_source/search_source.ts    | 13 +++++++++++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index be2e4aa7353a8..9e8feccdc7022 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1344,7 +1344,7 @@ module.exports = {
         'no-restricted-imports': [
           'error',
           {
-            patterns: ['lodash/*', '!lodash/fp'],
+            patterns: ['lodash/*', '!lodash/fp', 'rxjs/internal-compatibility'],
           },
         ],
       },
diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml
index 657aabca1e86d..d57d460c79306 100644
--- a/packages/kbn-optimizer/limits.yml
+++ b/packages/kbn-optimizer/limits.yml
@@ -14,7 +14,7 @@ pageLoadAssetSize:
   dashboard: 374267
   dashboardEnhanced: 65646
   dashboardMode: 22716
-  data: 1319839
+  data: 900000
   dataEnhanced: 50420
   devTools: 38781
   discover: 105147
diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts
index 61af244a41600..60e7b458eef31 100644
--- a/src/plugins/data/common/search/search_source/search_source.ts
+++ b/src/plugins/data/common/search/search_source/search_source.ts
@@ -59,10 +59,19 @@
  */
 
 import { setWith } from '@elastic/safer-lodash-set';
-import { uniqueId, keyBy, pick, difference, omit, isFunction, isEqual, uniqWith } from 'lodash';
+import {
+  uniqueId,
+  keyBy,
+  pick,
+  difference,
+  isFunction,
+  isEqual,
+  uniqWith,
+  isObject,
+  omit,
+} from 'lodash';
 import { map, switchMap, tap } from 'rxjs/operators';
 import { defer, from } from 'rxjs';
-import { isObject } from 'rxjs/internal-compatibility';
 import { normalizeSortRequest } from './normalize_sort_request';
 import { fieldWildcardFilter } from '../../../../kibana_utils/common';
 import { IIndexPattern, IndexPattern, IndexPatternField } from '../../index_patterns';