reanimated-pause-state 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +276 -0
- package/dist/babel.d.ts +21 -0
- package/dist/babel.d.ts.map +1 -0
- package/dist/babel.js +315 -0
- package/dist/babel.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +454 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +144 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
- package/src/babel.ts +486 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +553 -0
- package/src/types.ts +156 -0
package/README.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# reanimated-pause-state
|
|
2
|
+
|
|
3
|
+
Pause Reanimated animations and capture state snapshots for debugging and design review.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Pause/resume animations created with Reanimated factory functions
|
|
8
|
+
- Capture animation state snapshots with current values, timing, and source locations
|
|
9
|
+
- Filter snapshots by file and line proximity
|
|
10
|
+
- Generate prompt-ready markdown for LLM-assisted debugging
|
|
11
|
+
|
|
12
|
+
**Zero overhead in production** - all functionality is gated behind `__DEV__`.
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
### 1. Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install reanimated-pause-state
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Add Babel plugin
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
// babel.config.js
|
|
26
|
+
module.exports = {
|
|
27
|
+
presets: ['babel-preset-expo'],
|
|
28
|
+
plugins: [
|
|
29
|
+
'reanimated-pause-state/babel', // MUST be first
|
|
30
|
+
'react-native-reanimated/plugin', // MUST be last
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. Clear cache and restart
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx expo start --clear
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 4. Add pause control to your app
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { pause, resume, getSnapshotMarkdown } from 'reanimated-pause-state';
|
|
45
|
+
import * as Clipboard from 'expo-clipboard';
|
|
46
|
+
|
|
47
|
+
// In a dev menu, button, or shake handler:
|
|
48
|
+
const handlePause = () => {
|
|
49
|
+
pause();
|
|
50
|
+
const markdown = getSnapshotMarkdown();
|
|
51
|
+
Clipboard.setStringAsync(markdown);
|
|
52
|
+
Alert.alert('Copied', 'Animation state copied to clipboard');
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Now paste into Claude or your team chat with full animation context.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import {
|
|
62
|
+
pause,
|
|
63
|
+
resume,
|
|
64
|
+
toggle,
|
|
65
|
+
snapshotNow,
|
|
66
|
+
getSnapshotMarkdown,
|
|
67
|
+
isInstalled,
|
|
68
|
+
isPaused
|
|
69
|
+
} from 'reanimated-pause-state';
|
|
70
|
+
|
|
71
|
+
// Verify setup
|
|
72
|
+
console.log('Plugin installed:', isInstalled());
|
|
73
|
+
|
|
74
|
+
// Pause animations
|
|
75
|
+
pause();
|
|
76
|
+
|
|
77
|
+
// Take a snapshot of current animation state
|
|
78
|
+
const snapshot = snapshotNow();
|
|
79
|
+
console.log(snapshot);
|
|
80
|
+
// {
|
|
81
|
+
// timestamp: 1706123456789,
|
|
82
|
+
// animations: [
|
|
83
|
+
// {
|
|
84
|
+
// sharedValueName: 'translateX',
|
|
85
|
+
// type: 'repeat',
|
|
86
|
+
// values: { from: 0, to: 200, current: 127.5 },
|
|
87
|
+
// callsite: { file: 'MyScreen.tsx', line: 42 },
|
|
88
|
+
// ...
|
|
89
|
+
// }
|
|
90
|
+
// ]
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
// Get markdown for pasting into Claude/LLM
|
|
94
|
+
const markdown = getSnapshotMarkdown();
|
|
95
|
+
|
|
96
|
+
// Resume
|
|
97
|
+
resume();
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## API
|
|
101
|
+
|
|
102
|
+
### Core Functions
|
|
103
|
+
|
|
104
|
+
| Function | Returns | Description |
|
|
105
|
+
|----------|---------|-------------|
|
|
106
|
+
| `isInstalled()` | `boolean` | Check if Babel plugin is configured |
|
|
107
|
+
| `isPaused()` | `boolean` | Check if animations are paused |
|
|
108
|
+
| `pause()` | `PauseSnapshot` | Pause all animations, return snapshot |
|
|
109
|
+
| `resume()` | `void` | Resume all animations |
|
|
110
|
+
| `toggle()` | `PauseSnapshot \| null` | Toggle pause state |
|
|
111
|
+
|
|
112
|
+
### Snapshot Functions
|
|
113
|
+
|
|
114
|
+
#### `snapshotNow(opts?: SnapshotOptions): PauseSnapshot`
|
|
115
|
+
|
|
116
|
+
Take a snapshot of current animation state with optional filtering.
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
// All animations
|
|
120
|
+
snapshotNow()
|
|
121
|
+
|
|
122
|
+
// Filter by file
|
|
123
|
+
snapshotNow({ filterFile: 'MyScreen.tsx' })
|
|
124
|
+
|
|
125
|
+
// Filter by file + line proximity
|
|
126
|
+
snapshotNow({
|
|
127
|
+
filterFile: 'MyScreen.tsx',
|
|
128
|
+
filterLine: 42,
|
|
129
|
+
proximityThreshold: 200
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// Limit results
|
|
133
|
+
snapshotNow({ maxAnimations: 5 })
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### `getSnapshotMarkdown(opts?: SnapshotOptions): string`
|
|
137
|
+
|
|
138
|
+
Get snapshot as prompt-ready markdown.
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
const markdown = getSnapshotMarkdown({ filterFile: 'MyScreen.tsx' });
|
|
142
|
+
// ## Animation State at Pause
|
|
143
|
+
//
|
|
144
|
+
// ### `translateX` (repeat)
|
|
145
|
+
//
|
|
146
|
+
// | Property | Value |
|
|
147
|
+
// |----------|-------|
|
|
148
|
+
// | **Current** | `127.50` |
|
|
149
|
+
// | From → To | 0 → 200 |
|
|
150
|
+
// | Progress | 63.7% |
|
|
151
|
+
// | Location | `MyScreen.tsx:42` |
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### `getSnapshotJSON(opts?: SnapshotOptions): string`
|
|
155
|
+
|
|
156
|
+
Get snapshot as JSON string for logging or export.
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
const json = getSnapshotJSON({ filterFile: 'MyScreen.tsx' });
|
|
160
|
+
console.log(json);
|
|
161
|
+
// {
|
|
162
|
+
// "timestamp": 1706123456789,
|
|
163
|
+
// "animations": [...],
|
|
164
|
+
// "totalCount": 3,
|
|
165
|
+
// "summary": "3 animation(s) captured"
|
|
166
|
+
// }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### SnapshotOptions
|
|
170
|
+
|
|
171
|
+
| Option | Type | Default | Description |
|
|
172
|
+
|--------|------|---------|-------------|
|
|
173
|
+
| `filterFile` | `string` | - | Partial match on callsite file path |
|
|
174
|
+
| `filterLine` | `number` | - | Center line for proximity filter (requires `filterFile`) |
|
|
175
|
+
| `proximityThreshold` | `number` | `200` | Max line distance from `filterLine` |
|
|
176
|
+
| `maxAnimations` | `number` | `20` | Maximum animations to return |
|
|
177
|
+
|
|
178
|
+
### Types
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
interface PauseSnapshot {
|
|
182
|
+
timestamp: number;
|
|
183
|
+
timestampISO: string;
|
|
184
|
+
animations: AnimationSnapshot[];
|
|
185
|
+
totalCount: number;
|
|
186
|
+
summary: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface AnimationSnapshot {
|
|
190
|
+
id: string;
|
|
191
|
+
type: 'timing' | 'spring' | 'decay' | 'repeat' | 'sequence' | 'delay';
|
|
192
|
+
sharedValueName?: string; // e.g., 'translateX', 'scale'
|
|
193
|
+
callsite: {
|
|
194
|
+
file: string;
|
|
195
|
+
line: number;
|
|
196
|
+
column?: number;
|
|
197
|
+
};
|
|
198
|
+
values: {
|
|
199
|
+
from: number;
|
|
200
|
+
to: number;
|
|
201
|
+
current: number; // actual value at snapshot time
|
|
202
|
+
};
|
|
203
|
+
timing: {
|
|
204
|
+
startTime: number;
|
|
205
|
+
elapsed: number;
|
|
206
|
+
duration?: number;
|
|
207
|
+
progress?: number; // 0-100 for timing animations
|
|
208
|
+
};
|
|
209
|
+
config: { type: string; config: Record<string, any> };
|
|
210
|
+
description: string;
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Filtering
|
|
215
|
+
|
|
216
|
+
### By File
|
|
217
|
+
|
|
218
|
+
Find animations defined in a specific file:
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
snapshotNow({ filterFile: 'MyScreen.tsx' })
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### By File + Line Proximity
|
|
225
|
+
|
|
226
|
+
Narrow down to animations near a specific line:
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
snapshotNow({
|
|
230
|
+
filterFile: 'MyScreen.tsx',
|
|
231
|
+
filterLine: 42,
|
|
232
|
+
proximityThreshold: 200 // within 200 lines
|
|
233
|
+
})
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## How it Works
|
|
237
|
+
|
|
238
|
+
1. **Babel plugin** wraps animation factories (`withTiming`, `withSpring`, etc.) to track metadata
|
|
239
|
+
2. **Runtime** captures SharedValue references and registers animations
|
|
240
|
+
3. **On pause** reads current values from SharedValues (synced from UI thread)
|
|
241
|
+
4. **Filtering** matches by file path and line proximity
|
|
242
|
+
|
|
243
|
+
## Instrumented Functions
|
|
244
|
+
|
|
245
|
+
- `withTiming`
|
|
246
|
+
- `withSpring`
|
|
247
|
+
- `withDecay`
|
|
248
|
+
- `withRepeat`
|
|
249
|
+
- `withSequence`
|
|
250
|
+
- `withDelay`
|
|
251
|
+
|
|
252
|
+
## Limitations
|
|
253
|
+
|
|
254
|
+
- Only affects animations created via instrumented factory calls
|
|
255
|
+
- Does not pause native animations (Lottie, navigation transitions)
|
|
256
|
+
- Dynamic `toValue` (computed at runtime) won't be captured in config
|
|
257
|
+
- Spring animations don't have duration/progress (physics-based)
|
|
258
|
+
|
|
259
|
+
## Requirements
|
|
260
|
+
|
|
261
|
+
- React Native 0.70+
|
|
262
|
+
- `react-native-reanimated` >= 3.0.0 (peer dependency)
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
// package.json
|
|
266
|
+
{
|
|
267
|
+
"dependencies": {
|
|
268
|
+
"react-native-reanimated": "^3.0.0",
|
|
269
|
+
"reanimated-pause-state": "^0.1.0"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT
|
package/dist/babel.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reanimated-pause-plugin/babel
|
|
3
|
+
*
|
|
4
|
+
* Babel plugin that instruments Reanimated animation factories
|
|
5
|
+
* to track callsite information and animation metadata for snapshots.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: This plugin must run BEFORE react-native-reanimated/plugin
|
|
8
|
+
* or react-native-worklets/plugin in your babel config.
|
|
9
|
+
*/
|
|
10
|
+
import type { PluginObj } from '@babel/core';
|
|
11
|
+
interface PluginState {
|
|
12
|
+
filename: string;
|
|
13
|
+
markerInjected: boolean;
|
|
14
|
+
registryInjected: boolean;
|
|
15
|
+
factoryBindings: Map<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export default function reanimatedPausePlugin({ types: t, }: {
|
|
18
|
+
types: typeof import('@babel/core').types;
|
|
19
|
+
}): PluginObj<PluginState>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=babel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.d.ts","sourceRoot":"","sources":["../src/babel.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAC;AAyInE,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,KAAK,EAAE,CAAC,GACT,EAAE;IACD,KAAK,EAAE,cAAc,aAAa,EAAE,KAAK,CAAC;CAC3C,GAAG,SAAS,CAAC,WAAW,CAAC,CAgNzB"}
|
package/dist/babel.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* reanimated-pause-plugin/babel
|
|
4
|
+
*
|
|
5
|
+
* Babel plugin that instruments Reanimated animation factories
|
|
6
|
+
* to track callsite information and animation metadata for snapshots.
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This plugin must run BEFORE react-native-reanimated/plugin
|
|
9
|
+
* or react-native-worklets/plugin in your babel config.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = reanimatedPausePlugin;
|
|
13
|
+
const PLUGIN_VERSION = '0.1.0';
|
|
14
|
+
// Animation factories to instrument
|
|
15
|
+
const INSTRUMENTED_FACTORIES = new Map([
|
|
16
|
+
['withTiming', 'timing'],
|
|
17
|
+
['withSpring', 'spring'],
|
|
18
|
+
['withDecay', 'decay'],
|
|
19
|
+
['withRepeat', 'repeat'],
|
|
20
|
+
['withSequence', 'sequence'],
|
|
21
|
+
['withDelay', 'delay'],
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* Extract a literal value from an AST node (numbers, strings, booleans)
|
|
25
|
+
* Returns undefined for non-literal/dynamic values
|
|
26
|
+
*/
|
|
27
|
+
function extractLiteralValue(node, t) {
|
|
28
|
+
if (!node)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (t.isNumericLiteral(node))
|
|
31
|
+
return node.value;
|
|
32
|
+
if (t.isStringLiteral(node))
|
|
33
|
+
return node.value;
|
|
34
|
+
if (t.isBooleanLiteral(node))
|
|
35
|
+
return node.value;
|
|
36
|
+
if (t.isUnaryExpression(node) && node.operator === '-' && t.isNumericLiteral(node.argument)) {
|
|
37
|
+
return -node.argument.value;
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extract config properties from an ObjectExpression
|
|
43
|
+
*/
|
|
44
|
+
function extractObjectConfig(node, t) {
|
|
45
|
+
const properties = [];
|
|
46
|
+
if (!node || !t.isObjectExpression(node)) {
|
|
47
|
+
return properties;
|
|
48
|
+
}
|
|
49
|
+
for (const prop of node.properties) {
|
|
50
|
+
if (t.isObjectProperty(prop) && t.isIdentifier(prop.key)) {
|
|
51
|
+
const value = extractLiteralValue(prop.value, t);
|
|
52
|
+
if (value !== undefined) {
|
|
53
|
+
if (typeof value === 'number') {
|
|
54
|
+
properties.push(t.objectProperty(prop.key, t.numericLiteral(value)));
|
|
55
|
+
}
|
|
56
|
+
else if (typeof value === 'string') {
|
|
57
|
+
properties.push(t.objectProperty(prop.key, t.stringLiteral(value)));
|
|
58
|
+
}
|
|
59
|
+
else if (typeof value === 'boolean') {
|
|
60
|
+
properties.push(t.objectProperty(prop.key, t.booleanLiteral(value)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return properties;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Build config metadata based on animation type and arguments
|
|
69
|
+
*/
|
|
70
|
+
function buildConfigMetadata(animationType, args, t) {
|
|
71
|
+
const configProps = [];
|
|
72
|
+
switch (animationType) {
|
|
73
|
+
case 'timing': {
|
|
74
|
+
// withTiming(toValue, config?)
|
|
75
|
+
const toValue = extractLiteralValue(args[0], t);
|
|
76
|
+
if (toValue !== undefined) {
|
|
77
|
+
configProps.push(t.objectProperty(t.identifier('toValue'), t.numericLiteral(toValue)));
|
|
78
|
+
}
|
|
79
|
+
// Extract duration, easing from config object
|
|
80
|
+
const configObjProps = extractObjectConfig(args[1], t);
|
|
81
|
+
configProps.push(...configObjProps);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'spring': {
|
|
85
|
+
// withSpring(toValue, config?)
|
|
86
|
+
const toValue = extractLiteralValue(args[0], t);
|
|
87
|
+
if (toValue !== undefined) {
|
|
88
|
+
configProps.push(t.objectProperty(t.identifier('toValue'), t.numericLiteral(toValue)));
|
|
89
|
+
}
|
|
90
|
+
// Extract spring config (damping, mass, stiffness, etc.)
|
|
91
|
+
const configObjProps = extractObjectConfig(args[1], t);
|
|
92
|
+
configProps.push(...configObjProps);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case 'decay': {
|
|
96
|
+
// withDecay(config)
|
|
97
|
+
const configObjProps = extractObjectConfig(args[0], t);
|
|
98
|
+
configProps.push(...configObjProps);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case 'repeat': {
|
|
102
|
+
// withRepeat(animation, numberOfReps?, reverse?)
|
|
103
|
+
const numberOfReps = extractLiteralValue(args[1], t);
|
|
104
|
+
if (numberOfReps !== undefined) {
|
|
105
|
+
configProps.push(t.objectProperty(t.identifier('numberOfReps'), t.numericLiteral(numberOfReps)));
|
|
106
|
+
}
|
|
107
|
+
const reverse = extractLiteralValue(args[2], t);
|
|
108
|
+
if (reverse !== undefined) {
|
|
109
|
+
configProps.push(t.objectProperty(t.identifier('reverse'), t.booleanLiteral(reverse)));
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
case 'delay': {
|
|
114
|
+
// withDelay(delayMs, animation)
|
|
115
|
+
const delayMs = extractLiteralValue(args[0], t);
|
|
116
|
+
if (delayMs !== undefined) {
|
|
117
|
+
configProps.push(t.objectProperty(t.identifier('delayMs'), t.numericLiteral(delayMs)));
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case 'sequence': {
|
|
122
|
+
// withSequence(...animations)
|
|
123
|
+
configProps.push(t.objectProperty(t.identifier('count'), t.numericLiteral(args.length)));
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return t.objectExpression(configProps);
|
|
128
|
+
}
|
|
129
|
+
function reanimatedPausePlugin({ types: t, }) {
|
|
130
|
+
return {
|
|
131
|
+
name: 'reanimated-pause-plugin',
|
|
132
|
+
pre(file) {
|
|
133
|
+
this.filename = file.opts.filename || 'unknown';
|
|
134
|
+
this.markerInjected = false;
|
|
135
|
+
this.registryInjected = false;
|
|
136
|
+
this.factoryBindings = new Map();
|
|
137
|
+
},
|
|
138
|
+
visitor: {
|
|
139
|
+
Program: {
|
|
140
|
+
enter(path, state) {
|
|
141
|
+
// Inject marker at the top of the program
|
|
142
|
+
if (!state.markerInjected) {
|
|
143
|
+
const marker = t.expressionStatement(t.assignmentExpression('=', t.memberExpression(t.identifier('globalThis'), t.identifier('__RPP_INSTALLED__')), t.objectExpression([
|
|
144
|
+
t.objectProperty(t.identifier('installed'), t.booleanLiteral(true)),
|
|
145
|
+
t.objectProperty(t.identifier('version'), t.stringLiteral(PLUGIN_VERSION)),
|
|
146
|
+
])));
|
|
147
|
+
// Check if marker already exists
|
|
148
|
+
const hasMarker = path.node.body.some((node) => t.isExpressionStatement(node) &&
|
|
149
|
+
t.isAssignmentExpression(node.expression) &&
|
|
150
|
+
t.isMemberExpression(node.expression.left) &&
|
|
151
|
+
t.isIdentifier(node.expression.left.property, {
|
|
152
|
+
name: '__RPP_INSTALLED__',
|
|
153
|
+
}));
|
|
154
|
+
if (!hasMarker) {
|
|
155
|
+
path.unshiftContainer('body', marker);
|
|
156
|
+
}
|
|
157
|
+
state.markerInjected = true;
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
// Track imports from react-native-reanimated
|
|
162
|
+
ImportDeclaration(path, state) {
|
|
163
|
+
const source = path.node.source.value;
|
|
164
|
+
if (source !== 'react-native-reanimated') {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
for (const specifier of path.node.specifiers) {
|
|
168
|
+
if (t.isImportSpecifier(specifier)) {
|
|
169
|
+
const imported = t.isIdentifier(specifier.imported)
|
|
170
|
+
? specifier.imported.name
|
|
171
|
+
: specifier.imported.value;
|
|
172
|
+
const local = specifier.local.name;
|
|
173
|
+
if (INSTRUMENTED_FACTORIES.has(imported)) {
|
|
174
|
+
state.factoryBindings.set(local, imported);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
// Transform animation factory calls to track them
|
|
180
|
+
// Only track TOP-LEVEL animations (assigned to .value) to avoid noise
|
|
181
|
+
// Nested animations (withRepeat(withTiming(...))) share the same SharedValue
|
|
182
|
+
CallExpression: {
|
|
183
|
+
exit(path, state) {
|
|
184
|
+
const callee = path.node.callee;
|
|
185
|
+
if (!t.isIdentifier(callee)) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const localName = callee.name;
|
|
189
|
+
const originalName = state.factoryBindings.get(localName);
|
|
190
|
+
if (!originalName || !INSTRUMENTED_FACTORIES.has(originalName)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Check if this is a top-level animation being assigned to a SharedValue
|
|
194
|
+
// Pattern: sharedValue.value = withAnimation(...)
|
|
195
|
+
// Only track these - nested animations are just configuration
|
|
196
|
+
let sharedValueRef = null;
|
|
197
|
+
let sharedValueName = null;
|
|
198
|
+
const parentAssignment = path.findParent((p) => p.isAssignmentExpression());
|
|
199
|
+
if (parentAssignment && t.isAssignmentExpression(parentAssignment.node)) {
|
|
200
|
+
const left = parentAssignment.node.left;
|
|
201
|
+
// Check if left side is X.value (MemberExpression with property 'value')
|
|
202
|
+
if (t.isMemberExpression(left) &&
|
|
203
|
+
t.isIdentifier(left.property, { name: 'value' })) {
|
|
204
|
+
// Check if this call is the direct right-hand side of the assignment
|
|
205
|
+
// (not a nested animation inside another)
|
|
206
|
+
if (parentAssignment.node.right === path.node) {
|
|
207
|
+
sharedValueRef = left.object;
|
|
208
|
+
// Try to get the variable name for better descriptions
|
|
209
|
+
if (t.isIdentifier(left.object)) {
|
|
210
|
+
sharedValueName = left.object.name;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// Only track if this is assigned to a SharedValue (top-level)
|
|
216
|
+
if (!sharedValueRef) {
|
|
217
|
+
return; // Skip nested animations - they don't need separate tracking
|
|
218
|
+
}
|
|
219
|
+
const animationType = INSTRUMENTED_FACTORIES.get(originalName);
|
|
220
|
+
const loc = path.node.loc;
|
|
221
|
+
// Get relative filename
|
|
222
|
+
const filename = state.filename
|
|
223
|
+
.replace(/^.*\/node_modules\//, 'node_modules/')
|
|
224
|
+
.replace(/^.*\/packages\//, 'packages/');
|
|
225
|
+
// Extract animation config from arguments (recursively for nested animations)
|
|
226
|
+
const configMeta = buildConfigMetadata(animationType, path.node.arguments, t);
|
|
227
|
+
// Create metadata object
|
|
228
|
+
const metadataProperties = [
|
|
229
|
+
t.objectProperty(t.identifier('__rpp_type'), t.stringLiteral(animationType)),
|
|
230
|
+
t.objectProperty(t.identifier('__rpp_file'), t.stringLiteral(filename)),
|
|
231
|
+
t.objectProperty(t.identifier('__rpp_line'), t.numericLiteral(loc?.start.line || 0)),
|
|
232
|
+
t.objectProperty(t.identifier('__rpp_column'), t.numericLiteral(loc?.start.column || 0)),
|
|
233
|
+
t.objectProperty(t.identifier('__rpp_id'), t.callExpression(t.memberExpression(t.identifier('Math'), t.identifier('random')), [])),
|
|
234
|
+
t.objectProperty(t.identifier('__rpp_config'), configMeta),
|
|
235
|
+
t.objectProperty(t.identifier('__rpp_sharedValue'), sharedValueRef),
|
|
236
|
+
];
|
|
237
|
+
// Add SharedValue variable name if we captured it
|
|
238
|
+
if (sharedValueName) {
|
|
239
|
+
metadataProperties.push(t.objectProperty(t.identifier('__rpp_sharedValueName'), t.stringLiteral(sharedValueName)));
|
|
240
|
+
}
|
|
241
|
+
const metadata = t.objectExpression(metadataProperties);
|
|
242
|
+
// Wrap the call: __rppTrack(withTiming(...), metadata)
|
|
243
|
+
const wrappedCall = t.callExpression(t.identifier('__rppTrack'), [
|
|
244
|
+
t.callExpression(callee, path.node.arguments),
|
|
245
|
+
metadata,
|
|
246
|
+
]);
|
|
247
|
+
// Inject the tracker function if not already done
|
|
248
|
+
if (!state.registryInjected) {
|
|
249
|
+
injectTrackerFunction(path, t);
|
|
250
|
+
state.registryInjected = true;
|
|
251
|
+
}
|
|
252
|
+
path.replaceWith(wrappedCall);
|
|
253
|
+
path.skip(); // Don't revisit this node
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Inject the __rppTrack function that registers animations
|
|
261
|
+
*/
|
|
262
|
+
function injectTrackerFunction(path, t) {
|
|
263
|
+
const program = path.findParent((p) => p.isProgram());
|
|
264
|
+
if (!program)
|
|
265
|
+
return;
|
|
266
|
+
// Check if already injected
|
|
267
|
+
const hasTracker = program.node.body.some((node) => t.isVariableDeclaration(node) &&
|
|
268
|
+
node.declarations.some((d) => t.isIdentifier(d.id) && d.id.name === '__rppTrack'));
|
|
269
|
+
if (hasTracker)
|
|
270
|
+
return;
|
|
271
|
+
// Create the tracker function
|
|
272
|
+
// const __rppTrack = (animation, meta) => {
|
|
273
|
+
// if (animation && typeof animation === 'object') {
|
|
274
|
+
// animation.__rpp_meta = meta;
|
|
275
|
+
// }
|
|
276
|
+
// if (globalThis.__RPP_REGISTRY__?.register) {
|
|
277
|
+
// globalThis.__RPP_REGISTRY__.register(meta);
|
|
278
|
+
// }
|
|
279
|
+
// return animation;
|
|
280
|
+
// };
|
|
281
|
+
const tracker = t.variableDeclaration('const', [
|
|
282
|
+
t.variableDeclarator(t.identifier('__rppTrack'), t.arrowFunctionExpression([t.identifier('animation'), t.identifier('meta')], t.blockStatement([
|
|
283
|
+
// if (animation && typeof animation === 'object') { animation.__rpp_meta = meta; }
|
|
284
|
+
t.ifStatement(t.logicalExpression('&&', t.identifier('animation'), t.binaryExpression('===', t.unaryExpression('typeof', t.identifier('animation')), t.stringLiteral('object'))), t.expressionStatement(t.assignmentExpression('=', t.memberExpression(t.identifier('animation'), t.identifier('__rpp_meta')), t.identifier('meta')))),
|
|
285
|
+
// if (globalThis.__RPP_REGISTRY__?.register) { ... }
|
|
286
|
+
t.ifStatement(t.optionalMemberExpression(t.memberExpression(t.identifier('globalThis'), t.identifier('__RPP_REGISTRY__')), t.identifier('register'), false, true), t.expressionStatement(t.callExpression(t.memberExpression(t.memberExpression(t.identifier('globalThis'), t.identifier('__RPP_REGISTRY__')), t.identifier('register')), [t.identifier('meta')]))),
|
|
287
|
+
// return animation;
|
|
288
|
+
t.returnStatement(t.identifier('animation')),
|
|
289
|
+
]))),
|
|
290
|
+
]);
|
|
291
|
+
// Find insertion point (after imports)
|
|
292
|
+
let insertIndex = 0;
|
|
293
|
+
for (let i = 0; i < program.node.body.length; i++) {
|
|
294
|
+
const node = program.node.body[i];
|
|
295
|
+
if (!t.isImportDeclaration(node)) {
|
|
296
|
+
// Skip the marker if present
|
|
297
|
+
if (t.isExpressionStatement(node) &&
|
|
298
|
+
t.isAssignmentExpression(node.expression) &&
|
|
299
|
+
t.isMemberExpression(node.expression.left) &&
|
|
300
|
+
t.isIdentifier(node.expression.left.property, {
|
|
301
|
+
name: '__RPP_INSTALLED__',
|
|
302
|
+
})) {
|
|
303
|
+
insertIndex = i + 1;
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
insertIndex = i;
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
insertIndex = i + 1;
|
|
310
|
+
}
|
|
311
|
+
program.node.body.splice(insertIndex, 0, tracker);
|
|
312
|
+
}
|
|
313
|
+
module.exports = reanimatedPausePlugin;
|
|
314
|
+
module.exports.default = reanimatedPausePlugin;
|
|
315
|
+
//# sourceMappingURL=babel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../src/babel.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAkJH,wCAoNC;AAlWD,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,oCAAoC;AACpC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,cAAc,EAAE,UAAU,CAAC;IAC5B,CAAC,WAAW,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH;;;GAGG;AACH,SAAS,mBAAmB,CAC1B,IAAwB,EACxB,CAAqC;IAErC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAChD,IAAI,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAC/C,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAChD,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,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