trickle-observe 0.2.74 → 0.2.75

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.
@@ -261,6 +261,14 @@ function findVarDeclarations(source) {
261
261
  // Skip TS compiled vars
262
262
  if (varName === '_a' || varName === '_b' || varName === '_c')
263
263
  continue;
264
+ // Skip React Refresh / HMR internals (Vite, webpack, Next.js inject these)
265
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker' || varName === 'invalidateMessage')
266
+ continue;
267
+ if (varName === '_s' || varName === '_c2' || varName === '_s2')
268
+ continue;
269
+ // Skip single-underscore discard variables
270
+ if (varName === '_')
271
+ continue;
264
272
  // Check if this is a require() call or import — skip those
265
273
  const restOfLine = source.slice(vmatch.index + vmatch[0].length - 1, vmatch.index + vmatch[0].length + 200);
266
274
  if (/^\s*require\s*\(/.test(restOfLine))
@@ -505,6 +513,11 @@ function findReassignments(source) {
505
513
  // Skip 'this', 'self', 'super' (not reassignable in practice)
506
514
  if (varName === 'this' || varName === 'super')
507
515
  continue;
516
+ // Skip React Refresh / HMR internals and discard variables
517
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker')
518
+ continue;
519
+ if (varName === '_s' || varName === '_c2' || varName === '_s2' || varName === '_')
520
+ continue;
508
521
  // Skip keywords that could look like identifiers
509
522
  if (['if', 'else', 'while', 'for', 'do', 'switch', 'case', 'default', 'return', 'throw',
510
523
  'break', 'continue', 'try', 'catch', 'finally', 'new', 'delete', 'typeof', 'void',
@@ -254,6 +254,14 @@ function findVarDeclarations(source) {
254
254
  // Skip TS compiled vars
255
255
  if (varName === '_a' || varName === '_b' || varName === '_c')
256
256
  continue;
257
+ // Skip React Refresh / HMR internals (Vite, webpack, Next.js inject these)
258
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker' || varName === 'invalidateMessage')
259
+ continue;
260
+ if (varName === '_s' || varName === '_c2' || varName === '_s2')
261
+ continue;
262
+ // Skip single-underscore discard variables
263
+ if (varName === '_')
264
+ continue;
257
265
  // Check if this is a require() call or import — skip those
258
266
  const restOfLine = source.slice(vmatch.index + vmatch[0].length - 1, vmatch.index + vmatch[0].length + 200);
259
267
  if (/^\s*require\s*\(/.test(restOfLine))
@@ -498,6 +506,11 @@ function findReassignments(source) {
498
506
  // Skip 'this', 'self', 'super' (not reassignable in practice)
499
507
  if (varName === 'this' || varName === 'super')
500
508
  continue;
509
+ // Skip React Refresh / HMR internals and discard variables
510
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker')
511
+ continue;
512
+ if (varName === '_s' || varName === '_c2' || varName === '_s2' || varName === '_')
513
+ continue;
501
514
  // Skip keywords that could look like identifiers
502
515
  if (['if', 'else', 'while', 'for', 'do', 'switch', 'case', 'default', 'return', 'throw',
503
516
  'break', 'continue', 'try', 'catch', 'finally', 'new', 'delete', 'typeof', 'void',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trickle-observe",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "description": "Runtime type observability for JavaScript applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -257,6 +257,11 @@ function findVarDeclarations(source: string): Array<{ lineEnd: number; varName:
257
257
  if (varName.startsWith('__trickle')) continue;
258
258
  // Skip TS compiled vars
259
259
  if (varName === '_a' || varName === '_b' || varName === '_c') continue;
260
+ // Skip React Refresh / HMR internals (Vite, webpack, Next.js inject these)
261
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker' || varName === 'invalidateMessage') continue;
262
+ if (varName === '_s' || varName === '_c2' || varName === '_s2') continue;
263
+ // Skip single-underscore discard variables
264
+ if (varName === '_') continue;
260
265
 
261
266
  // Check if this is a require() call or import — skip those
262
267
  const restOfLine = source.slice(vmatch.index + vmatch[0].length - 1, vmatch.index + vmatch[0].length + 200);
@@ -486,6 +491,9 @@ function findReassignments(source: string): Array<{ lineEnd: number; varName: st
486
491
  if (varName === '_a' || varName === '_b' || varName === '_c') continue;
487
492
  // Skip 'this', 'self', 'super' (not reassignable in practice)
488
493
  if (varName === 'this' || varName === 'super') continue;
494
+ // Skip React Refresh / HMR internals and discard variables
495
+ if (varName === 'prevRefreshReg' || varName === 'prevRefreshSig' || varName === 'inWebWorker') continue;
496
+ if (varName === '_s' || varName === '_c2' || varName === '_s2' || varName === '_') continue;
489
497
  // Skip keywords that could look like identifiers
490
498
  if (['if', 'else', 'while', 'for', 'do', 'switch', 'case', 'default', 'return', 'throw',
491
499
  'break', 'continue', 'try', 'catch', 'finally', 'new', 'delete', 'typeof', 'void',