Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 15e22cd

Browse files
ref(node): Inline types imported from shimmer (#17597)
Unblocks OTEL upgrades, where `shimmer` is not a sub-dependency anymore.
1 parent 71880da commit 15e22cd

File tree

1 file changed

+10
-6
lines changed
  • packages/node/src/integrations/tracing/firebase/otel/patches

1 file changed

+10
-6
lines changed

‎packages/node/src/integrations/tracing/firebase/otel/patches/firestore.ts‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
ATTR_SERVER_PORT,
1717
} from '@opentelemetry/semantic-conventions';
1818
import type { SpanAttributes } from '@sentry/core';
19-
import type { unwrap as shimmerUnwrap, wrap as shimmerWrap } from 'shimmer';
2019
import type { FirebaseInstrumentation } from '../firebaseInstrumentation';
2120
import type {
2221
AddDocType,
@@ -37,6 +36,11 @@ import type {
3736
WithFieldValue,
3837
} from '../types';
3938

39+
// Inline minimal types used from `shimmer` to avoid importing shimmer's types directly.
40+
// We only need the shape for `wrap` and `unwrap` used in this file.
41+
type ShimmerWrap = (target: any, name: string, wrapper: (...args: any[]) => any) => void;
42+
type ShimmerUnwrap = (target: any, name: string) => void;
43+
4044
/**
4145
*
4246
* @param tracer - Opentelemetry Tracer
@@ -47,8 +51,8 @@ import type {
4751
export function patchFirestore(
4852
tracer: Tracer,
4953
firestoreSupportedVersions: string[],
50-
wrap: typeofshimmerWrap,
51-
unwrap: typeofshimmerUnwrap,
54+
wrap: ShimmerWrap,
55+
unwrap: ShimmerUnwrap,
5256
config: FirebaseInstrumentationConfig,
5357
): InstrumentationNodeModuleDefinition {
5458
// eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -102,8 +106,8 @@ export function patchFirestore(
102106
function wrapMethods(
103107
// eslint-disable-next-line @typescript-eslint/no-explicit-any
104108
moduleExports: any,
105-
wrap: typeofshimmerWrap,
106-
unwrap: typeofshimmerUnwrap,
109+
wrap: ShimmerWrap,
110+
unwrap: ShimmerUnwrap,
107111
tracer: Tracer,
108112
firestoreSpanCreationHook: FirestoreSpanCreationHook,
109113
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -121,7 +125,7 @@ function wrapMethods(
121125
function unwrapMethods(
122126
// eslint-disable-next-line @typescript-eslint/no-explicit-any
123127
moduleExports: any,
124-
unwrap: typeofshimmerUnwrap,
128+
unwrap: ShimmerUnwrap,
125129
// eslint-disable-next-line @typescript-eslint/no-explicit-any
126130
): any {
127131
for (const method of ['addDoc', 'getDocs', 'setDoc', 'deleteDoc']) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /