Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): Rename global.ts -> worldwide.ts #5969

Merged
merged 3 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/utils/src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GLOBAL_OBJ } from './global';
import { isString } from './is';
import { GLOBAL_OBJ } from './worldwide';

/**
* TODO: Move me to @sentry/browser when @sentry/utils no longer contains any browser code
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './browser';
export * from './dsn';
export * from './error';
export * from './global';
export * from './worldwide';
export * from './instrument';
export * from './is';
export * from './logger';
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WrappedFunction } from '@sentry/types';

import { getGlobalSingleton, GLOBAL_OBJ } from './global';
import { getGlobalSingleton, GLOBAL_OBJ } from './worldwide';

/** Prefix for logging strings */
const PREFIX = 'Sentry Logger ';
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/misc.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Event, Exception, Mechanism, StackFrame } from '@sentry/types';

import { GLOBAL_OBJ } from './global';
import { addNonEnumerableProperty } from './object';
import { snipLine } from './string';
import { GLOBAL_OBJ } from './worldwide';

interface CryptoInternal {
getRandomValues(array: Uint8Array): Uint8Array;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/**
* NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
* you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
*
* Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing
* string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).
*
* Why worldwide?
*
* Why not?
*/

/* eslint-disable @typescript-eslint/no-explicit-any */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GLOBAL_OBJ } from '../src/global';
import { GLOBAL_OBJ } from '../src/worldwide';

describe('GLOBAL_OBJ', () => {
test('should return the same object', () => {
Expand Down