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

Deps: Upgrade react-element-to-jsx-string and react-inspector for React 18 #19104

Merged
merged 3 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"lodash": "^4.17.21",
"polished": "^4.2.2",
"prop-types": "^15.7.2",
"react-inspector": "^5.1.0",
"react-inspector": "^6.0.0",
"telejson": "^6.0.8",
"ts-dedent": "^2.0.0",
"util-deprecate": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/components/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC, Fragment } from 'react';
import { styled, withTheme } from '@storybook/theming';
import type { Theme } from '@storybook/theming';

import Inspector from 'react-inspector';
import { Inspector } from 'react-inspector';
import { ActionBar, ScrollArea } from '@storybook/components';

import { Action, InspectorContainer, Counter } from './style';
Expand All @@ -27,7 +27,7 @@ interface InspectorProps {
}

const ThemedInspector = withTheme(({ theme, ...props }: InspectorProps) => (
<Inspector theme={theme.addonActionsTheme || 'chromeLight'} {...props} />
<Inspector theme={theme.addonActionsTheme || 'chromeLight'} table={false} {...props} />
));

interface ActionLoggerProps {
Expand Down
1 change: 0 additions & 1 deletion code/addons/actions/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: following packages need definition files or a TS migration
declare module 'global';
declare module 'react-inspector';
declare module 'uuid-browser/v4';
2 changes: 1 addition & 1 deletion code/renderers/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"html-tags": "^3.1.0",
"lodash": "^4.17.21",
"prop-types": "^15.7.2",
"react-element-to-jsx-string": "^14.3.4",
"react-element-to-jsx-string": "^15.0.0",
"ts-dedent": "^2.0.0",
"util-deprecate": "^1.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/react/src/docs/jsxDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const renderJsx = (code: React.ReactElement, options: JSXOptions) => {
};

const result = React.Children.map(code, (c) => {
// @ts-ignore FIXME: workaround react-element-to-jsx-string
// @ts-expect-error FIXME: workaround react-element-to-jsx-string
const child = typeof c === 'number' ? c.toString() : c;
const toJSXString =
typeof reactElementToJSXString === 'function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import isPlainObject from 'lodash/isPlainObject';
import isFunction from 'lodash/isFunction';
import isString from 'lodash/isString';
// @ts-ignore
import reactElementToJSXString from 'react-element-to-jsx-string';
import {
PropDef,
Expand Down
68 changes: 27 additions & 41 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2236,7 +2236,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.5, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2":
"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.5, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2":
version: 7.18.9
resolution: "@babel/runtime@npm:7.18.9"
dependencies:
Expand Down Expand Up @@ -6910,7 +6910,7 @@ __metadata:
lodash: ^4.17.21
polished: ^4.2.2
prop-types: ^15.7.2
react-inspector: ^5.1.0
react-inspector: ^6.0.0
telejson: ^6.0.8
ts-dedent: ^2.0.0
typescript: ~4.6.3
Expand Down Expand Up @@ -9025,7 +9025,7 @@ __metadata:
jest-specific-snapshot: ^4.0.0
lodash: ^4.17.21
prop-types: ^15.7.2
react-element-to-jsx-string: ^14.3.4
react-element-to-jsx-string: ^15.0.0
require-from-string: ^2.0.2
ts-dedent: ^2.0.0
typescript: ~4.6.3
Expand Down Expand Up @@ -26202,16 +26202,6 @@ __metadata:
languageName: node
linkType: hard

"is-dom@npm:^1.0.0":
version: 1.1.0
resolution: "is-dom@npm:1.1.0"
dependencies:
is-object: ^1.0.1
is-window: ^1.0.2
checksum: 0645d388bed188e827b4440af7c2f4c454ad6e6fd4c395d46eae404ca8b64f1bb45e3f33f1a60fbc7f59ca10fb0e5351589b49b3d3bac1b3c5aeec70e2e5be07
languageName: node
linkType: hard

"is-empty@npm:^1.0.0":
version: 1.2.0
resolution: "is-empty@npm:1.2.0"
Expand Down Expand Up @@ -26752,13 +26742,6 @@ __metadata:
languageName: node
linkType: hard

"is-window@npm:^1.0.2":
version: 1.0.2
resolution: "is-window@npm:1.0.2"
checksum: f954f21c9fce64e6c72f8a908c3aaefa8fd6d1ef819acdfa1be007de70e5424bd2ac774950b38b523fd8ff4b581899efc1156cc6b0505040072e8ff25e57ec18
languageName: node
linkType: hard

"is-windows@npm:^1.0.0, is-windows@npm:^1.0.1, is-windows@npm:^1.0.2":
version: 1.0.2
resolution: "is-windows@npm:1.0.2"
Expand Down Expand Up @@ -36367,7 +36350,7 @@ __metadata:
languageName: node
linkType: hard

"prop-types@npm:^15.0.0, prop-types@npm:^15.5.10, prop-types@npm:^15.5.4, prop-types@npm:^15.6.1, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
"prop-types@npm:^15.5.10, prop-types@npm:^15.5.4, prop-types@npm:^15.6.1, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
version: 15.8.1
resolution: "prop-types@npm:15.8.1"
dependencies:
Expand Down Expand Up @@ -37198,17 +37181,17 @@ __metadata:
languageName: node
linkType: hard

"react-element-to-jsx-string@npm:^14.3.4":
version: 14.3.4
resolution: "react-element-to-jsx-string@npm:14.3.4"
"react-element-to-jsx-string@npm:^15.0.0":
version: 15.0.0
resolution: "react-element-to-jsx-string@npm:15.0.0"
dependencies:
"@base2/pretty-print-object": 1.0.1
is-plain-object: 5.0.0
react-is: 17.0.2
react-is: 18.1.0
peerDependencies:
react: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1
react-dom: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1
checksum: 4ead664b2e26e76af57c9ce2f2a46e79fda1d3a408afb5f34d03357d195b7f41a1a86bb9286b6d6ba76c9c2611fe56bc038665cf27fdb56f571d235ddfce9ffb
react: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1 || ^18.0.0
react-dom: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1 || ^18.0.0
checksum: 0d60a0ea758529c32a706d0c69d70b69fb94de3c46442fffdee34f08f51ffceddbb5395b41dfd1565895653e9f60f98ca525835be9d5db1f16d6b22be12f4cd4
languageName: node
linkType: hard

Expand Down Expand Up @@ -37275,23 +37258,19 @@ __metadata:
languageName: node
linkType: hard

"react-inspector@npm:^5.1.0":
version: 5.1.1
resolution: "react-inspector@npm:5.1.1"
dependencies:
"@babel/runtime": ^7.0.0
is-dom: ^1.0.0
prop-types: ^15.0.0
"react-inspector@npm:^6.0.0":
version: 6.0.1
resolution: "react-inspector@npm:6.0.1"
peerDependencies:
react: ^16.8.4 || ^17.0.0
checksum: 64282953f1e9318501ae9ff64dc955845fce0b543577fcc5b6a5cf786d9a1872edadc5df5821d830a8510ecf629e9a220b323e5cd45b091508939f71ea332239
react: ^16.8.4 || ^17.0.0 || ^18.0.0
checksum: 34b0ba6e8c718aa0bbde3bc325531bc94b1e536eb226579e57cb912065693ff70611308c8e567c8e5703b0513655eb5258e5c3ac447e6a5003a44559abc84fa7
languageName: node
linkType: hard

"react-is@npm:17.0.2, react-is@npm:^17.0.1, react-is@npm:^17.0.2":
version: 17.0.2
resolution: "react-is@npm:17.0.2"
checksum: 2bdb6b93fbb1820b024b496042cce405c57e2f85e777c9aabd55f9b26d145408f9f74f5934676ffdc46f3dcff656d78413a6e43968e7b3f92eea35b3052e9053
"react-is@npm:18.1.0":
version: 18.1.0
resolution: "react-is@npm:18.1.0"
checksum: 558874e4c3bd9805a9294426e090919ee6901be3ab07f80b997c36b5a01a8d691112802e7438d146f6c82fd6495d8c030f276ef05ec3410057f8740a8d723f8c
languageName: node
linkType: hard

Expand All @@ -37302,6 +37281,13 @@ __metadata:
languageName: node
linkType: hard

"react-is@npm:^17.0.1, react-is@npm:^17.0.2":
version: 17.0.2
resolution: "react-is@npm:17.0.2"
checksum: 2bdb6b93fbb1820b024b496042cce405c57e2f85e777c9aabd55f9b26d145408f9f74f5934676ffdc46f3dcff656d78413a6e43968e7b3f92eea35b3052e9053
languageName: node
linkType: hard

"react-is@npm:^18.0.0":
version: 18.2.0
resolution: "react-is@npm:18.2.0"
Expand Down