Skip to content

Commit 2f43f09

Browse files
fix: add annotations for tree shaking
1 parent 6c72cb9 commit 2f43f09

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

packages/core/src/hooks/useInView.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { once, prefix } from '@react-spring/shared'
22

3-
const warnImplementation = once(console.warn)
3+
const warnImplementation = /* @__PURE__ */ once(console.warn)
44

55
export const useInView = () => {
66
warnImplementation(

packages/core/src/hooks/useResize.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { once, prefix } from '@react-spring/shared'
22

3-
const warnImplementation = once(console.warn)
3+
const warnImplementation = /* @__PURE__ */ once(console.warn)
44

55
export const useResize = () => {
66
warnImplementation(

packages/core/src/hooks/useScroll.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { once, prefix } from '@react-spring/shared'
22

3-
const warnImplementation = once(console.warn)
3+
const warnImplementation = /* @__PURE__ */ once(console.warn)
44

55
export const useScroll = () => {
66
warnImplementation(

packages/parallax/src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
config as configs,
99
} from '@react-spring/web'
1010

11-
const ParentContext = React.createContext<any>(null)
11+
const ParentContext = /* @__PURE__ */ React.createContext<any>(null)
1212

1313
function getScrollType(horizontal: boolean) {
1414
return horizontal ? 'scrollLeft' : 'scrollTop'
@@ -75,8 +75,8 @@ export interface ParallaxLayerProps extends ViewProps {
7575
sticky?: StickyConfig
7676
}
7777

78-
export const ParallaxLayer = React.memo(
79-
React.forwardRef<IParallaxLayer, ParallaxLayerProps>(
78+
export const ParallaxLayer = /* @__PURE__ */ React.memo(
79+
/* @__PURE__ */ React.forwardRef<IParallaxLayer, ParallaxLayerProps>(
8080
(
8181
{ horizontal, factor = 1, offset = 0, speed = 0, sticky, ...rest },
8282
ref
@@ -216,8 +216,8 @@ export interface ParallaxProps extends ViewProps {
216216
children: React.ReactNode
217217
}
218218

219-
export const Parallax = React.memo(
220-
React.forwardRef<IParallax, ParallaxProps>((props, ref) => {
219+
export const Parallax = /* @__PURE__ */ React.memo(
220+
/* @__PURE__ */ React.forwardRef<IParallax, ParallaxProps>((props, ref) => {
221221
const [ready, setReady] = useState(false)
222222
const {
223223
pages,

packages/rafz/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ import type {
99

1010
export type { FrameFn, FrameUpdateFn, Timeout, Throttled, Rafz }
1111

12-
let updateQueue = makeQueue<FrameUpdateFn>()
12+
let updateQueue = /* @__PURE__ */ makeQueue<FrameUpdateFn>()
1313

1414
/**
1515
* Schedule an update for next frame.
1616
* Your function can return `true` to repeat next frame.
1717
*/
1818
export const raf: Rafz = fn => schedule(fn, updateQueue)
1919

20-
let writeQueue = makeQueue<FrameFn>()
20+
let writeQueue = /* @__PURE__ */ makeQueue<FrameFn>()
2121
raf.write = fn => schedule(fn, writeQueue)
2222

23-
let onStartQueue = makeQueue<FrameFn>()
23+
let onStartQueue = /* @__PURE__ */ makeQueue<FrameFn>()
2424
raf.onStart = fn => schedule(fn, onStartQueue)
2525

26-
let onFrameQueue = makeQueue<FrameFn>()
26+
let onFrameQueue = /* @__PURE__ */ makeQueue<FrameFn>()
2727
raf.onFrame = fn => schedule(fn, onFrameQueue)
2828

29-
let onFinishQueue = makeQueue<FrameFn>()
29+
let onFinishQueue = /* @__PURE__ */ makeQueue<FrameFn>()
3030
raf.onFinish = fn => schedule(fn, onFinishQueue)
3131

3232
let timeouts: Timeout[] = []

packages/shared/src/colorMatchers.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ function call(...parts: string[]) {
66
return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)'
77
}
88

9-
export const rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER))
10-
export const rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER))
11-
export const hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE))
9+
export const rgb = new RegExp(
10+
'rgb' + /* @__PURE__ */ call(NUMBER, NUMBER, NUMBER)
11+
)
12+
export const rgba = new RegExp(
13+
'rgba' + /* @__PURE__ */ call(NUMBER, NUMBER, NUMBER, NUMBER)
14+
)
15+
export const hsl = new RegExp(
16+
'hsl' + /* @__PURE__ */ call(NUMBER, PERCENTAGE, PERCENTAGE)
17+
)
1218
export const hsla = new RegExp(
13-
'hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)
19+
'hsla' + /* @__PURE__ */ call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)
1420
)
1521
export const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/
1622
export const hex4 =

packages/shared/src/deprecations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export const once = <TFunc extends (...args: any) => any>(fn: TFunc) => {
1818
}
1919
}
2020

21-
const warnInterpolate = once(console.warn)
21+
const warnInterpolate = /* @__PURE__ */ once(console.warn)
2222
export function deprecateInterpolate() {
2323
warnInterpolate(
2424
`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`
2525
)
2626
}
2727

28-
const warnDirectCall = once(console.warn)
28+
const warnDirectCall = /* @__PURE__ */ once(console.warn)
2929
export function deprecateDirectCall() {
3030
warnDirectCall(
3131
`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`

0 commit comments

Comments
 (0)