Skip to content

Commit 814dd8f

Browse files
committed
Removing react from bundle
1 parent cddcc66 commit 814dd8f

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ Motion adheres to [Semantic Versioning](http://semver.org/).
44

55
Undocumented APIs should be considered internal and may change without warning.
66

7-
## [12.18.0] 2025-06-12
7+
## [12.18.0] 2025-06-13
88

99
### Added
1010

1111
- Support for defining a timeline position relative to the start of the most recently added animation (e.g. `<+0.5`, `<-1`)
1212

13+
### Fixed
14+
15+
- Removed `"react"` import from `"motion-dom"`.
16+
1317
## [12.17.3] 2025-06-12
1418

1519
### Changed

packages/framer-motion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@
142142
"maxSize": "2.26 kB"
143143
}
144144
],
145-
"gitHead": "0d3c11b5f54647ecc5d1ee93e827651291fe7ce3"
145+
"gitHead": "cddcc66430c5c96b2f560bb6a61160231f512c53"
146146
}

packages/motion-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"scripts": {
2323
"clean": "rm -rf types dist lib",
24-
"build": "yarn clean && tsc -p . && rollup -c",
24+
"build": "yarn clean && tsc -p . && rollup -c && node ./scripts/check-bundle.js",
2525
"dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"",
2626
"test": "jest --config jest.config.json --max-workers=2",
2727
"measure": "rollup -c ./rollup.size.config.mjs"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require("path")
2+
const { readFileSync } = require("fs")
3+
4+
const file = readFileSync(
5+
path.join(__dirname, "../", "dist", "index.d.ts"),
6+
"utf8"
7+
)
8+
9+
if (file.includes(`"react"`)) {
10+
throw new Error("DOM bundle includes reference to React")
11+
}

packages/motion-dom/src/node/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { BoundingBox, Box, Point } from "motion-utils"
2-
import { RefObject } from "react"
32
import type {
43
DOMKeyframesDefinition,
54
InertiaOptions,
@@ -559,7 +558,7 @@ export type ViewportEventHandler = (
559558
) => void
560559

561560
export interface ViewportOptions {
562-
root?: RefObject<Element | null>
561+
root?: { current: Element | null }
563562
once?: boolean
564563
margin?: string
565564
amount?: "some" | "all" | number
@@ -641,7 +640,7 @@ export interface MotionNodeDraggableOptions {
641640
* }
642641
* ```
643642
*/
644-
dragConstraints?: false | Partial<BoundingBox> | RefObject<Element | null>
643+
dragConstraints?: false | Partial<BoundingBox> | { current: Element | null }
645644

646645
/**
647646
* The degree of movement allowed outside constraints. 0 = no movement, 1 =

packages/motion-dom/src/utils/transform.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ export interface TransformOptions<T> {
4242
* Every value in the output range must be of the same type and in the same format.
4343
*
4444
* ```jsx
45-
* import * as React from "react"
46-
* import { transform } from "framer-motion"
47-
*
4845
* export function MyComponent() {
4946
* const inputRange = [0, 200]
5047
* const outputRange = [0, 1]
@@ -79,9 +76,6 @@ export function transform<T>(
7976
* Every value in the output range must be of the same type and in the same format.
8077
*
8178
* ```jsx
82-
* import * as React from "react"
83-
* import { Frame, transform } from "framer"
84-
*
8579
* export function MyComponent() {
8680
* const inputRange = [-200, -100, 100, 200]
8781
* const outputRange = [0, 1, 1, 0]

packages/motion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@
9595
"optional": true
9696
}
9797
},
98-
"gitHead": "0d3c11b5f54647ecc5d1ee93e827651291fe7ce3"
98+
"gitHead": "cddcc66430c5c96b2f560bb6a61160231f512c53"
9999
}

0 commit comments

Comments
 (0)