Skip to content

Commit ecac3e1

Browse files
committed
deprecate core stuff
1 parent 60ed02d commit ecac3e1

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

packages/core/src/browser-exports.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
*
44
* @module
55
*/
6-
export { getComponentName, getLocationHref, htmlTreeAsString } from './utils/browser';
6+
export {
7+
getComponentName,
8+
getLocationHref,
9+
// eslint-disable-next-line deprecation/deprecation
10+
htmlTreeAsString,
11+
} from './utils/browser';
712
export { supportsDOMError, supportsHistory, supportsNativeFetch, supportsReportingObserver } from './utils/supports';
813
export type { XhrBreadcrumbData, XhrBreadcrumbHint } from './types/breadcrumb';
914
export type {

packages/core/src/shared-exports.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandl
221221
export {
222222
isDOMError,
223223
isDOMException,
224+
// eslint-disable-next-line deprecation/deprecation
224225
isElement,
225226
isError,
226227
isErrorEvent,
@@ -231,8 +232,10 @@ export {
231232
isPrimitive,
232233
isRegExp,
233234
isString,
235+
// eslint-disable-next-line deprecation/deprecation
234236
isSyntheticEvent,
235237
isThenable,
238+
// eslint-disable-next-line deprecation/deprecation
236239
isVueViewModel,
237240
} from './utils/is';
238241
export { isBrowser } from './utils/isBrowser';

packages/core/src/utils/browser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type SimpleNode = {
1414
* and its ancestors
1515
* e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
1616
* @returns generated DOM path
17+
* @deprecated This is browser-specific and will be removed from `@sentry/core` in a future major version.
18+
* Import `htmlTreeAsString` from `@sentry-internal/browser-utils` instead.
1719
*/
1820
export function htmlTreeAsString(
1921
elem: unknown,

packages/core/src/utils/is.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ export function isEvent(wat: unknown): wat is PolymorphicEvent {
136136
*
137137
* @param wat A value to be checked.
138138
* @returns A boolean representing the result.
139+
* @deprecated This is browser-specific and will be removed from `@sentry/core` in a future major version.
140+
* Import `isElement` from `@sentry-internal/browser-utils` instead.
139141
*/
140142
export function isElement(wat: unknown): boolean {
141143
return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
@@ -162,11 +164,13 @@ export function isThenable(wat: any): wat is PromiseLike<any> {
162164
}
163165

164166
/**
165-
* Checks whether given value's type is a SyntheticEvent
167+
* Checks whether given value's type is a React SyntheticEvent
166168
* {@link isSyntheticEvent}.
167169
*
168170
* @param wat A value to be checked.
169171
* @returns A boolean representing the result.
172+
* @deprecated This is React-specific and will be removed from `@sentry/core` in a future major version.
173+
* Use the equivalent helper that ships with `@sentry/react` instead.
170174
*/
171175
export function isSyntheticEvent(wat: unknown): boolean {
172176
return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
@@ -195,6 +199,8 @@ export function isInstanceOf<T>(wat: any, base: any): wat is T {
195199
*
196200
* @param wat A value to be checked.
197201
* @returns A boolean representing the result.
202+
* @deprecated This is Vue-specific and will be removed from `@sentry/core` in a future major version.
203+
* Use the equivalent helper that ships with `@sentry/vue` instead.
198204
*/
199205
export function isVueViewModel(wat: unknown): wat is VueViewModel | VNode {
200206
// Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.

0 commit comments

Comments
 (0)