Skip to content

Commit 52697fc

Browse files
committed
Fix errors
Had to upgrade react-syntax-highlighter too. Fingers crossed.
1 parent 40ff9ee commit 52697fc

File tree

4 files changed

+62
-69
lines changed

4 files changed

+62
-69
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,15 @@
8989
"**/deepmerge": "^4.2.2",
9090
"**/fast-deep-equal": "^3.1.1",
9191
"**/graphql-toolkit/lodash": "^4.17.15",
92-
"**/highlight.js": "^9.18.5",
9392
"**/hoist-non-react-statics": "^3.3.2",
9493
"**/isomorphic-fetch/node-fetch": "^2.6.1",
9594
"**/istanbul-instrumenter-loader/schema-utils": "1.0.0",
9695
"**/load-grunt-config/lodash": "^4.17.20",
9796
"**/minimist": "^1.2.5",
9897
"**/node-jose/node-forge": "^0.10.0",
9998
"**/prismjs": "1.22.0",
99+
"**/react-syntax-highlighter": "^15.3.1",
100+
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
100101
"**/request": "^2.88.2",
101102
"**/trim": "0.0.3",
102103
"**/typescript": "4.1.2"
@@ -787,7 +788,7 @@
787788
"react-router-redux": "^4.0.8",
788789
"react-shortcuts": "^2.0.0",
789790
"react-sizeme": "^2.3.6",
790-
"react-syntax-highlighter": "^5.7.0",
791+
"react-syntax-highlighter": "^15.3.1",
791792
"react-test-renderer": "^16.12.0",
792793
"react-tiny-virtual-list": "^2.2.0",
793794
"react-virtualized": "^9.21.2",

x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/DatabaseContext.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ import { EuiSpacer, EuiTitle } from '@elastic/eui';
88
import { i18n } from '@kbn/i18n';
99
import { tint } from 'polished';
1010
import React, { Fragment } from 'react';
11-
// @ts-expect-error
12-
import sql from 'react-syntax-highlighter/dist/languages/sql';
13-
import SyntaxHighlighter, {
14-
registerLanguage,
15-
// @ts-expect-error
16-
} from 'react-syntax-highlighter/dist/light';
17-
// @ts-expect-error
18-
import { xcode } from 'react-syntax-highlighter/dist/styles';
11+
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql';
12+
import xcode from 'react-syntax-highlighter/dist/cjs/styles/hljs/xcode';
13+
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
1914
import styled from 'styled-components';
2015
import { Span } from '../../../../../../../../typings/es_schemas/ui/span';
2116
import {
@@ -28,7 +23,7 @@ import {
2823
} from '../../../../../../../style/variables';
2924
import { TruncateHeightSection } from './TruncateHeightSection';
3025

31-
registerLanguage('sql', sql);
26+
SyntaxHighlighter.registerLanguage('sql', sql);
3227

3328
const DatabaseStatement = styled.div`
3429
padding: ${px(units.half)} ${px(unit)};

x-pack/plugins/apm/public/components/shared/Stacktrace/Context.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,18 @@
77
import { size } from 'lodash';
88
import { tint } from 'polished';
99
import React from 'react';
10-
// TODO add dependency for @types/react-syntax-highlighter
11-
// @ts-expect-error
12-
import javascript from 'react-syntax-highlighter/dist/languages/javascript';
13-
// @ts-expect-error
14-
import python from 'react-syntax-highlighter/dist/languages/python';
15-
// @ts-expect-error
16-
import ruby from 'react-syntax-highlighter/dist/languages/ruby';
17-
// @ts-expect-error
18-
import SyntaxHighlighter from 'react-syntax-highlighter/dist/light';
19-
// @ts-expect-error
20-
import { registerLanguage } from 'react-syntax-highlighter/dist/light';
21-
// @ts-expect-error
22-
import { xcode } from 'react-syntax-highlighter/dist/styles';
10+
import javascript from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript';
11+
import python from 'react-syntax-highlighter/dist/cjs/languages/hljs/python';
12+
import ruby from 'react-syntax-highlighter/dist/cjs/languages/hljs/ruby';
13+
import xcode from 'react-syntax-highlighter/dist/cjs/styles/hljs/xcode';
14+
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
2315
import styled from 'styled-components';
2416
import { StackframeWithLineContext } from '../../../../typings/es_schemas/raw/fields/stackframe';
2517
import { borderRadius, px, unit, units } from '../../../style/variables';
2618

27-
registerLanguage('javascript', javascript);
28-
registerLanguage('python', python);
29-
registerLanguage('ruby', ruby);
19+
SyntaxHighlighter.registerLanguage('javascript', javascript);
20+
SyntaxHighlighter.registerLanguage('python', python);
21+
SyntaxHighlighter.registerLanguage('ruby', ruby);
3022

3123
const ContextContainer = styled.div`
3224
position: relative;

yarn.lock

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8139,7 +8139,7 @@ babel-preset-jest@^26.6.2:
81398139
babel-plugin-transform-undefined-to-void "^6.9.4"
81408140
lodash.isplainobject "^4.0.6"
81418141

8142-
babel-runtime@6.x, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
8142+
babel-runtime@6.x, babel-runtime@^6.11.6, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
81438143
version "6.26.0"
81448144
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
81458145
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
@@ -13643,7 +13643,7 @@ fastq@^1.6.0:
1364313643
dependencies:
1364413644
reusify "^1.0.0"
1364513645

13646-
fault@^1.0.2:
13646+
fault@^1.0.0:
1364713647
version "1.0.4"
1364813648
resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13"
1364913649
integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==
@@ -15757,6 +15757,11 @@ hast-util-is-element@^1.0.0:
1575715757
resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.4.tgz#059090a05cc02e275df1ad02caf8cb422fcd2e02"
1575815758
integrity sha512-NFR6ljJRvDcyPP5SbV7MyPBgF47X3BsskLnmw1U34yL+X6YC0MoBx9EyMg8Jtx4FzGH95jw8+c1VPLHaRA0wDQ==
1575915759

15760+
hast-util-parse-selector@^2.0.0:
15761+
version "2.2.3"
15762+
resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.3.tgz#57edd449103900c7f63fd9e6f694ffd7e4634719"
15763+
integrity sha512-nxbeqjQNxsvo/uYYAw9kij6td05YVUlf1qti09rVfbWSLT5H6wo3c+USIwX6nzXWk5kFZzXnEqO82856r0aM2Q==
15764+
1576015765
hast-util-parse-selector@^2.2.0:
1576115766
version "2.2.1"
1576215767
resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.1.tgz#4ddbae1ae12c124e3eb91b581d2556441766f0ab"
@@ -15836,6 +15841,17 @@ hastscript@^5.0.0:
1583615841
property-information "^5.0.1"
1583715842
space-separated-tokens "^1.0.0"
1583815843

15844+
hastscript@^6.0.0:
15845+
version "6.0.0"
15846+
resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640"
15847+
integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==
15848+
dependencies:
15849+
"@types/hast" "^2.0.0"
15850+
comma-separated-tokens "^1.0.0"
15851+
hast-util-parse-selector "^2.0.0"
15852+
property-information "^5.0.0"
15853+
space-separated-tokens "^1.0.0"
15854+
1583915855
hat@0.0.3:
1584015856
version "0.0.3"
1584115857
resolved "https://registry.yarnpkg.com/hat/-/hat-0.0.3.tgz#bb014a9e64b3788aed8005917413d4ff3d502d8a"
@@ -15867,7 +15883,12 @@ heap@^0.2.6:
1586715883
resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac"
1586815884
integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=
1586915885

15870-
highlight.js@^9.18.5, highlight.js@~9.12.0, highlight.js@~9.15.0, highlight.js@~9.15.1:
15886+
highlight.js@^10.1.1, highlight.js@^10.4.1, highlight.js@~10.1.0:
15887+
version "10.4.1"
15888+
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.4.1.tgz#d48fbcf4a9971c4361b3f95f302747afe19dbad0"
15889+
integrity sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg==
15890+
15891+
highlight.js@^9.18.5:
1587115892
version "9.18.5"
1587215893
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.5.tgz#d18a359867f378c138d6819edfc2a8acd5f29825"
1587315894
integrity sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==
@@ -19562,20 +19583,13 @@ lowercase-keys@^2.0.0:
1956219583
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
1956319584
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
1956419585

19565-
lowlight@1.12.1, lowlight@^1.2.0:
19566-
version "1.12.1"
19567-
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.12.1.tgz#014acf8dd73a370e02ff1cc61debcde3bb1681eb"
19568-
integrity sha512-OqaVxMGIESnawn+TU/QMV5BJLbUghUfjDWPAtFqDYDmDtr4FnB+op8xM+pR7nKlauHNUHXGt0VgWatFB8voS5w==
19586+
lowlight@^1.14.0, lowlight@^1.2.0:
19587+
version "1.14.0"
19588+
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.14.0.tgz#83ebc143fec0f9e6c0d3deffe01be129ce56b108"
19589+
integrity sha512-N2E7zTM7r1CwbzwspPxJvmjAbxljCPThTFawEX2Z7+P3NGrrvY54u8kyU16IY4qWfoVIxY8SYCS8jTkuG7TqYA==
1956919590
dependencies:
19570-
fault "^1.0.2"
19571-
highlight.js "~9.15.0"
19572-
19573-
lowlight@~1.9.1:
19574-
version "1.9.1"
19575-
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.9.1.tgz#ed7c3dffc36f8c1f263735c0fe0c907847c11250"
19576-
integrity sha512-CpDhyVhI+xHjruiGvH2F/Fr5q5aTn5A6Oyh7MI+4oI8G0A1E7p9a3Zqv9Hzx9WByK8gAiNifEueAXz+cA2xdEA==
19577-
dependencies:
19578-
highlight.js "~9.12.0"
19591+
fault "^1.0.0"
19592+
highlight.js "~10.1.0"
1957919593

1958019594
lru-cache@4.1.x, lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.5:
1958119595
version "4.1.5"
@@ -21939,7 +21953,7 @@ parse-color@^1.0.0:
2193921953
dependencies:
2194021954
color-convert "~0.5.0"
2194121955

21942-
parse-entities@^1.1.0, parse-entities@^1.1.2:
21956+
parse-entities@^1.1.0:
2194321957
version "1.2.1"
2194421958
resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.1.tgz#2c761ced065ba7dc68148580b5a225e4918cdd69"
2194521959
integrity sha512-NBWYLQm1KSoDKk7GAHyioLTvCZ5QjdH/ASBBQTD3iLiAWJXS5bg1jEWI8nIJ+vgVvsceBVBcDGRWSo0KVQBvvg==
@@ -22716,7 +22730,7 @@ pretty-ms@^4.0.0:
2271622730
dependencies:
2271722731
parse-ms "^2.0.0"
2271822732

22719-
prismjs@1.22.0, prismjs@^1.8.4, prismjs@~1.16.0:
22733+
prismjs@1.22.0, prismjs@^1.22.0, prismjs@~1.22.0:
2272022734
version "1.22.0"
2272122735
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.22.0.tgz#73c3400afc58a823dd7eed023f8e1ce9fd8977fa"
2272222736
integrity sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w==
@@ -23796,25 +23810,16 @@ react-style-singleton@^2.1.0:
2379623810
invariant "^2.2.4"
2379723811
tslib "^1.0.0"
2379823812

23799-
react-syntax-highlighter@^12.2.1:
23800-
version "12.2.1"
23801-
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-12.2.1.tgz#14d78352da1c1c3f93c6698b70ec7c706b83493e"
23802-
integrity sha512-CTsp0ZWijwKRYFg9xhkWD4DSpQqE4vb2NKVMdPAkomnILSmsNBHE0n5GuI5zB+PU3ySVvXvdt9jo+ViD9XibCA==
23813+
react-syntax-highlighter@^12.2.1, react-syntax-highlighter@^15.3.1:
23814+
version "15.3.1"
23815+
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.3.1.tgz#ba16ae8705f191956b73d0e11ae938fd255f2579"
23816+
integrity sha512-XVQuug7kQ4/cWxiYE0XfGXvbDqLLqRsMK/GpmD3v1WOLzb6REcgkL59cJo0m3Y2LB0eoRCNhV62jqQe9/Z0p9w==
2380323817
dependencies:
2380423818
"@babel/runtime" "^7.3.1"
23805-
highlight.js "~9.15.1"
23806-
lowlight "1.12.1"
23807-
prismjs "^1.8.4"
23808-
refractor "^2.4.1"
23809-
23810-
react-syntax-highlighter@^5.7.0:
23811-
version "5.8.0"
23812-
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-5.8.0.tgz#a220c010fd0641751d93532509ba7159cc3a4383"
23813-
integrity sha512-+FolT9NhFBqE4SsZDelSzsYJJS/JCnQqo4+GxLrFPoML548uvr8f4Eh5nnd5o6ERKFW7ryiygOX9SPnxdnlpkg==
23814-
dependencies:
23815-
babel-runtime "^6.18.0"
23816-
highlight.js "~9.12.0"
23817-
lowlight "~1.9.1"
23819+
highlight.js "^10.1.1"
23820+
lowlight "^1.14.0"
23821+
prismjs "^1.22.0"
23822+
refractor "^3.2.0"
2381823823

2381923824
react-test-renderer@^16.0.0-0, react-test-renderer@^16.12.0:
2382023825
version "16.12.0"
@@ -24290,14 +24295,14 @@ reflect.ownkeys@^0.2.0:
2429024295
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
2429124296
integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=
2429224297

24293-
refractor@^2.4.1:
24294-
version "2.8.0"
24295-
resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.8.0.tgz#29d7b2254e823edd2e3e476af286af1c11472bfa"
24296-
integrity sha512-w+jG49/1MX60GeE9u8lyx1KYMBRdAHjOIfgcDJ0wq2ogOnEmab0MgIj+AtPq6kelw0mr1l9U0i2rFvLlOCkxiw==
24298+
refractor@^3.2.0:
24299+
version "3.2.0"
24300+
resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.2.0.tgz#bc46f7cfbb6adbf45cd304e8e299b7fa854804e0"
24301+
integrity sha512-hSo+EyMIZTLBvNNgIU5lW4yjCzNYMZ4dcEhBq/3nReGfqzd2JfVhdlPDfU9rEsgcAyWx+OimIIUoL4ZU7NtYHQ==
2429724302
dependencies:
24298-
hastscript "^5.0.0"
24299-
parse-entities "^1.1.2"
24300-
prismjs "~1.16.0"
24303+
hastscript "^6.0.0"
24304+
parse-entities "^2.0.0"
24305+
prismjs "~1.22.0"
2430124306

2430224307
regedit@^3.0.3:
2430324308
version "3.0.3"

0 commit comments

Comments
 (0)