Browse Source

perf: avoid using sentry/types in some places (#69101)

A small patch to remove the usages of `sentry/types` in some of the
places, but not all. There are currently 1200 more usages left

Using `sentry/types` and other barrel files have performance impact.

For a more detailed explanation, check out
https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Yagiz Nizipli 10 months ago
parent
commit
a909e82c1e

+ 1 - 1
fixtures/js-stubs/accessRequest.tsx

@@ -1,7 +1,7 @@
 import {MemberFixture} from 'sentry-fixture/member';
 import {TeamFixture} from 'sentry-fixture/team';
 
-import {AccessRequest} from 'sentry/types';
+import type {AccessRequest} from 'sentry/types/organization';
 
 export function AccessRequestFixture(params: Partial<AccessRequest> = {}): AccessRequest {
   return {

+ 1 - 1
fixtures/js-stubs/accountEmails.tsx

@@ -1,4 +1,4 @@
-import type {UserEmail} from 'sentry/types';
+import type {UserEmail} from 'sentry/types/user';
 
 export function AccountEmailsFixture(params: UserEmail[] = []): UserEmail[] {
   return [

+ 3 - 7
fixtures/js-stubs/activityFeed.tsx

@@ -2,13 +2,9 @@ import {EventFixture} from 'sentry-fixture/event';
 import {ProjectFixture} from 'sentry-fixture/project';
 import {UserFixture} from 'sentry-fixture/user';
 
-import {
-  type Activity,
-  EventOrGroupType,
-  GroupActivityType,
-  IssueCategory,
-  IssueType,
-} from 'sentry/types';
+import {EventOrGroupType} from 'sentry/types/event';
+import type {Activity} from 'sentry/types/group';
+import {GroupActivityType, IssueCategory, IssueType} from 'sentry/types/group';
 
 export function ActivityFeedFixture(params: Partial<Activity> = {}): Activity {
   return {

+ 1 - 1
fixtures/js-stubs/actor.tsx

@@ -1,4 +1,4 @@
-import type {Actor} from 'sentry/types';
+import type {Actor} from 'sentry/types/core';
 
 export function ActorFixture(params: Partial<Actor> = {}): Actor {
   return {

+ 1 - 1
fixtures/js-stubs/apiApplication.tsx

@@ -1,4 +1,4 @@
-import type {ApiApplication} from 'sentry/types';
+import type {ApiApplication} from 'sentry/types/user';
 
 export function ApiApplicationFixture(
   params: Partial<ApiApplication> = {}

+ 1 - 1
fixtures/js-stubs/apiToken.tsx

@@ -1,4 +1,4 @@
-import type {NewInternalAppApiToken} from 'sentry/types';
+import type {NewInternalAppApiToken} from 'sentry/types/user';
 
 export function ApiTokenFixture(
   params: Partial<NewInternalAppApiToken> = {}

+ 1 - 1
fixtures/js-stubs/auditLogs.tsx

@@ -1,6 +1,6 @@
 import {UserFixture} from 'sentry-fixture/user';
 
-import type {AuditLog} from 'sentry/types';
+import type {AuditLog} from 'sentry/types/organization';
 
 export function AuditLogsFixture(params: AuditLog[] = []): AuditLog[] {
   return [

+ 1 - 1
fixtures/js-stubs/authProvider.tsx

@@ -1,4 +1,4 @@
-import type {AuthProvider} from 'sentry/types';
+import type {AuthProvider} from 'sentry/types/auth';
 
 export function AuthProviderFixture(params: Partial<AuthProvider> = {}): AuthProvider {
   return {

+ 1 - 1
fixtures/js-stubs/authProviders.tsx

@@ -1,6 +1,6 @@
 import {AuthProviderFixture} from 'sentry-fixture/authProvider';
 
-import type {AuthProvider} from 'sentry/types';
+import type {AuthProvider} from 'sentry/types/auth';
 
 export function AuthProvidersFixture(params: AuthProvider[] = []): AuthProvider[] {
   return [

+ 1 - 1
fixtures/js-stubs/authenticators.tsx

@@ -4,7 +4,7 @@ import type {
   TotpAuthenticator,
   U2fAuthenticator,
   UserEnrolledAuthenticator,
-} from 'sentry/types';
+} from 'sentry/types/auth';
 
 export function AuthenticatorsFixture(): {
   Recovery: (props?: Partial<RecoveryAuthenticator>) => RecoveryAuthenticator;

Some files were not shown because too many files changed in this diff