Skip to content

Commit

Permalink
chore(deps): Use @react-spring/web (#1517)
Browse files Browse the repository at this point in the history
Replace use of multi target react-spring to avoid peer dependency
warnings. Update package.json files, JS imports and lock deps

Close #1505
  • Loading branch information
nikolaik authored May 22, 2021
1 parent bdbb48f commit 3cf486f
Show file tree
Hide file tree
Showing 86 changed files with 103 additions and 155 deletions.
4 changes: 2 additions & 2 deletions packages/annotations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@nivo/colors": "0.69.0",
"lodash": "^4.17.11",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0"
Expand All @@ -42,4 +42,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/annotations/src/AnnotationLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'
import { useAnimatedPath, useTheme } from '@nivo/core'

const AnnotationLink = memo(({ isOutline, ...props }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/src/AnnotationNote.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { memo } from 'react'
import omit from 'lodash/omit'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useTheme, useMotionConfig } from '@nivo/core'

const AnnotationNote = memo(({ datum, x, y, note }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/src/CircleAnnotationOutline.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useMotionConfig, useTheme } from '@nivo/core'

const CircleAnnotationOutline = memo(({ x, y, size }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/src/DotAnnotationOutline.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useMotionConfig, useTheme } from '@nivo/core'

const DotAnnotationOutline = memo(({ x, y, size }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/src/RectAnnotationOutline.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useMotionConfig, useTheme } from '@nivo/core'

const RectAnnotationOutline = memo(({ x, y, width, height }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/arcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@nivo/colors": "0.69.0",
"d3-shape": "^1.3.5",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0",
Expand All @@ -43,4 +43,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/arcs/src/ArcShape.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback } from 'react'
import { SpringValue, Interpolation, animated } from 'react-spring'
import { SpringValue, Interpolation, animated } from '@react-spring/web'
import { DatumWithArcAndColor } from './types'

export type ArcMouseHandler<Datum extends DatumWithArcAndColor> = (
Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/arc_labels/ArcLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { CSSProperties } from 'react'
import { SpringValue, Interpolation, animated } from 'react-spring'
import { SpringValue, Interpolation, animated } from '@react-spring/web'
import { useTheme } from '@nivo/core'
import { DatumWithArcAndColor } from '../types'

Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/arc_link_labels/ArcLinkLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { useTheme } from '@nivo/core'
import { SpringValue, Interpolation, animated } from 'react-spring'
import { SpringValue, Interpolation, animated } from '@react-spring/web'
import { DatumWithArcAndColor } from '../types'

export interface ArcLinkLabelProps<Datum extends DatumWithArcAndColor> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react'
import { SpringValue, useTransition, to } from 'react-spring'
import { SpringValue, useTransition, to } from '@react-spring/web'
import { line } from 'd3-shape'
import { useMotionConfig, useTheme } from '@nivo/core'
import { InheritedColorConfig, useInheritedColor } from '@nivo/colors'
Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/centers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react'
import { useTransition, to, SpringValue } from 'react-spring'
import { useTransition, to, SpringValue } from '@react-spring/web'
import {
// @ts-ignore
midAngle,
Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/interpolateArc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { to, SpringValue } from 'react-spring'
import { to, SpringValue } from '@react-spring/web'
import { ArcGenerator } from './types'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/useAnimatedArc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSpring } from 'react-spring'
import { useSpring } from '@react-spring/web'
import { useMotionConfig } from '@nivo/core'
import { Arc, ArcGenerator } from './types'
import { interpolateArc } from './interpolateArc'
Expand Down
2 changes: 1 addition & 1 deletion packages/arcs/src/useArcsTransition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTransition } from 'react-spring'
import { useTransition } from '@react-spring/web'
import { useMotionConfig } from '@nivo/core'
import { DatumWithArc } from './types'
import { ArcTransitionMode, useArcTransitionMode, TransitionExtra } from './arcTransitionMode'
Expand Down
4 changes: 2 additions & 2 deletions packages/axes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"d3-format": "^1.4.4",
"d3-time": "^1.0.11",
"d3-time-format": "^2.1.3",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0",
Expand All @@ -47,4 +47,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/axes/src/components/Axis.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useSpring, useTransition, animated } from 'react-spring'
import { useSpring, useTransition, animated } from '@react-spring/web'
import { useTheme, useMotionConfig } from '@nivo/core'
import { computeCartesianTicks, getFormatter } from '../compute'
import { AxisTick } from './AxisTick'
Expand Down
2 changes: 1 addition & 1 deletion packages/axes/src/components/AxisTick.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'
import { useTheme } from '@nivo/core'
import { AxisTickProps, AxisValue } from '../types'

Expand Down
2 changes: 1 addition & 1 deletion packages/axes/src/components/GridLine.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SpringValues, animated } from 'react-spring'
import { SpringValues, animated } from '@react-spring/web'
import { useTheme } from '@nivo/core'

export const GridLine = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/axes/src/components/GridLines.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { useTransition } from 'react-spring'
import { useTransition } from '@react-spring/web'
import { useMotionConfig } from '@nivo/core'
import { GridLine } from './GridLine'
import { Line } from '../types'
Expand Down
2 changes: 1 addition & 1 deletion packages/axes/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SpringValues } from 'react-spring'
import { SpringValues } from '@react-spring/web'
import {
ScaleBand,
ScaleLinear,
Expand Down
4 changes: 2 additions & 2 deletions packages/bullet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@nivo/legends": "0.69.0",
"@nivo/tooltip": "0.69.0",
"d3-scale": "^3.2.3",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0",
Expand All @@ -47,4 +47,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/bullet/src/BulletItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { Axis } from '@nivo/axes'
// @ts-ignore
import { getColorScale, useMotionConfig, useTheme } from '@nivo/core'
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/src/BulletMarkers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useTransition } from 'react-spring'
import { useTransition } from '@react-spring/web'
// @ts-ignore
import { useMotionConfig } from '@nivo/core'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/src/BulletMarkersItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { BulletMarkersItemProps } from './types'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'

export const BulletMarkersItem = ({
animatedProps: { color, transform, x, y1, y2 },
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/src/BulletRects.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useTransition, animated, to } from 'react-spring'
import { useTransition, animated, to } from '@react-spring/web'
// @ts-ignore
import { useMotionConfig } from '@nivo/core'
import { computeRects } from './compute'
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/src/BulletRectsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { BulletRectsItemProps } from './types'
import { animated, to } from 'react-spring'
import { animated, to } from '@react-spring/web'

export const BulletRectsItem = ({
animatedProps: { x, y, width, height, color },
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import { Box, Dimensions, Theme, Colors, ModernMotionProps } from '@nivo/core'
import { ScaleLinear } from 'd3-scale'
import { SpringValues } from 'react-spring'
import { SpringValues } from '@react-spring/web'

export type DatumId = string | number
export type DatumValue = number
Expand Down
4 changes: 2 additions & 2 deletions packages/bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@nivo/legends": "0.69.0",
"@nivo/tooltip": "0.69.0",
"d3-shape": "^1.3.5",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0"
Expand All @@ -48,4 +48,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/bump/src/area-bump/Area.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useAnimatedPath, useMotionConfig, blendModePropType } from '@nivo/core'
import { useSerieHandlers } from './hooks'

Expand Down
2 changes: 1 addition & 1 deletion packages/bump/src/area-bump/AreasLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSprings, animated } from 'react-spring'
import { useSprings, animated } from '@react-spring/web'
import { useTheme, useMotionConfig } from '@nivo/core'
import { inheritedColorPropType } from '@nivo/colors'
import { useSeriesLabels } from './hooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/bump/src/bump/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from 'react-spring'
import { useSpring, animated } from '@react-spring/web'
import { useAnimatedPath, useMotionConfig } from '@nivo/core'
import { useSerieHandlers } from './hooks'

Expand Down
2 changes: 1 addition & 1 deletion packages/bump/src/bump/LinesLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSprings, animated } from 'react-spring'
import { useSprings, animated } from '@react-spring/web'
import { useTheme, useMotionConfig } from '@nivo/core'
import { inheritedColorPropType } from '@nivo/colors'
import { useSeriesLabels } from './hooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/bump/src/bump/Point.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated, to } from 'react-spring'
import { useSpring, animated, to } from '@react-spring/web'
import { useMotionConfig } from '@nivo/core'

const pointStyle = { pointerEvents: 'none' }
Expand Down
4 changes: 2 additions & 2 deletions packages/circle-packing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@nivo/tooltip": "0.69.0",
"d3-hierarchy": "^1.1.8",
"lodash": "^4.17.11",
"react-spring": "9.1.2"
"@react-spring/web": "9.1.2"
},
"devDependencies": {
"@nivo/core": "0.69.0",
Expand All @@ -47,4 +47,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/circle-packing/src/CircleHtml.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { animated, to, SpringValue, Interpolation } from 'react-spring'
import { animated, to, SpringValue, Interpolation } from '@react-spring/web'
import { CircleProps } from './types'
import { useNodeMouseHandlers } from './hooks'

Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/CircleSvg.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'
import { CircleProps } from './types'
import { useNodeMouseHandlers } from './hooks'

Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/Circles.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { createElement, useMemo, MouseEvent } from 'react'
import { useTransition, to, SpringValue } from 'react-spring'
import { useTransition, to, SpringValue } from '@react-spring/web'
import { useMotionConfig, useTheme } from '@nivo/core'
import { useInheritedColor } from '@nivo/colors'
import { useTooltip } from '@nivo/tooltip'
Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/LabelHtml.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'
import { useTheme } from '@nivo/core'
import { LabelProps } from './types'
import { interpolatePosition, interpolateSize } from './CircleHtml'
Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/LabelSvg.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { animated } from 'react-spring'
import { animated } from '@react-spring/web'
import { useTheme } from '@nivo/core'
import { LabelProps } from './types'

Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/Labels.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useTransition } from 'react-spring'
import { useTransition } from '@react-spring/web'
import { useMotionConfig } from '@nivo/core'
import { CirclePackingCommonProps, ComputedDatum, LabelComponent, ComputedLabel } from './types'
import { useCirclePackingLabels } from './hooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Interpolation, SpringValue } from 'react-spring'
import { Interpolation, SpringValue } from '@react-spring/web'
import {
Box,
ModernMotionProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Interpolation, SpringConfig } from 'react-spring'
import { Interpolation, SpringConfig } from '@react-spring/web'

declare module '@nivo/core' {
export type DatumValue = string | number | Date
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"d3-shape": "^1.3.5",
"d3-time-format": "^2.1.3",
"lodash": "^4.17.11",
"react-spring": "9.1.2",
"@react-spring/web": "9.1.2",
"resize-observer-polyfill": "^1.5.1"
},
"devDependencies": {
Expand All @@ -44,4 +44,4 @@
"publishConfig": {
"access": "public"
}
}
}
Loading

0 comments on commit 3cf486f

Please sign in to comment.