Skip to content

Commit

Permalink
fix imports from core-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaSvietlova committed Jan 14, 2025
1 parent 355fe96 commit e36b843
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { ParentContext, BackgroundingListener, InternalConfiguration, Plugin, SpanFactory } from '@bugsnag/core-performance'
import type { ParentContext, BackgroundingListener, InternalConfiguration, Plugin, SpanFactory, AppState } from '@bugsnag/core-performance'
import type { BrowserConfiguration } from '../config'
import type { OnSettle } from '../on-settle'
import type { PerformanceWithTiming } from '../on-settle/load-event-end-settler'
import { getPermittedAttributes } from '../send-page-attributes'
import type { WebVitals } from '../web-vitals'
import { instrumentPageLoadPhaseSpans } from './page-load-phase-spans'
import { defaultRouteResolver } from '../default-routing-provider'
import type { AppState } from '../../../../core/lib/core'

export class FullPageLoadPlugin implements Plugin<BrowserConfiguration> {
private readonly spanFactory: SpanFactory<BrowserConfiguration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { coreSpanOptionSchema, isString, isObject } from '@bugsnag/core-performance'
import type { InternalConfiguration, Plugin, Span, SpanFactory, SpanOptionSchema, Time } from '@bugsnag/core-performance'
import type { InternalConfiguration, Plugin, Span, SpanFactory, SpanOptionSchema, Time, AppState } from '@bugsnag/core-performance'
import type { BrowserConfiguration } from '../config'
import type { RouteChangeSpanEndOptions, RouteChangeSpanOptions } from '../routing-provider'
import { getPermittedAttributes } from '../send-page-attributes'
import { defaultRouteResolver } from '../default-routing-provider'
import type { AppState } from '../../../../core/lib/core'

// exclude isFirstClass from the route change option schema
const { startTime, parentContext, makeCurrentContext } = coreSpanOptionSchema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { spanContextEquals } from '@bugsnag/core-performance'
import type { AppState } from '@bugsnag/core-performance'
import {
ControllableBackgroundingListener,
InMemoryDelivery,
Expand All @@ -27,7 +28,6 @@ import {
createPerformancePaintTimingFake
} from '../utilities'
import MockRoutingProvider from '../utilities/mock-routing-provider'
import type { AppState } from '../../../../core/lib/core'

jest.useFakeTimers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/

import { InMemoryDelivery, IncrementingClock, VALID_API_KEY, createTestClient } from '@bugsnag/js-performance-test-utilities'
import type { AppState } from "@bugsnag/core-performance";

Check failure on line 7 in packages/platforms/browser/tests/auto-instrumentation/route-change-plugin.test.ts

View workflow job for this annotation

GitHub Actions / linting

Strings must use singlequote

Check failure on line 7 in packages/platforms/browser/tests/auto-instrumentation/route-change-plugin.test.ts

View workflow job for this annotation

GitHub Actions / linting

Extra semicolon
import { RouteChangePlugin } from '../../lib/auto-instrumentation/route-change-plugin'
import { createSchema } from '../../lib/config'
import type { BrowserConfiguration, BrowserSchema } from '../../lib/config'
import { createDefaultRoutingProvider } from '../../lib/default-routing-provider'
import type { OnSettle } from '../../lib/on-settle'
import type { StartRouteChangeCallback } from '../../lib/routing-provider'
import type { AppState } from '../../../../core/lib/core'

jest.useFakeTimers()

Expand Down
2 changes: 1 addition & 1 deletion packages/platforms/browser/tests/routing-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
*/

import { InMemoryDelivery, IncrementingClock, VALID_API_KEY, createTestClient } from '@bugsnag/js-performance-test-utilities'
import type { AppState } from '@bugsnag/core-performance'
import { RouteChangePlugin } from '../lib/auto-instrumentation/route-change-plugin'
import { createSchema } from '../lib/config'
import type { BrowserConfiguration, BrowserSchema } from '../lib/config'
import { createDefaultRoutingProvider } from '../lib/default-routing-provider'
import { isRoutingProvider } from '../lib/routing-provider'
import type { AppState } from '../../../core/lib/core'

jest.useFakeTimers()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
AppState,
Clock,
InternalConfiguration,
Plugin,
Expand All @@ -9,7 +10,6 @@ import React from 'react'
import type { AppRegistry, WrapperComponentProvider } from 'react-native'
import type { ReactNativeConfiguration } from '../config'
import { createAppStartSpan } from '../create-app-start-span'
import type { AppState } from '../../../../core/lib/core'

interface WrapperProps {
children: ReactNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { MockSpanFactory, createConfiguration } from '@bugsnag/js-performance-test-utilities'
import type { Clock } from '@bugsnag/core-performance'
import type { Clock, AppState } from '@bugsnag/core-performance'
import createClock from '../../lib/clock'
import { AppStartPlugin } from '../../lib/auto-instrumentation/app-start-plugin'
import type { ReactNativeConfiguration } from '../../lib/config'
import type { AppRegistry } from 'react-native'
import type { AppState } from '../../../../core/lib/core'

describe('app start plugin', () => {
let spanFactory: MockSpanFactory<ReactNativeConfiguration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { VALID_API_KEY } from '@bugsnag/js-performance-test-utilities'
import BugsnagPerformance from '@bugsnag/react-native-performance'
import type { AppState } from '@bugsnag/core-performance'
import { fireEvent, render, screen } from '@testing-library/react-native'
import React, { useState } from 'react'
import { Button, View } from 'react-native'
import { Navigation } from 'react-native-navigation'
import { CompleteNavigation } from '../lib/CompleteNavigation'
import ReactNativeNavigationPlugin from '../lib/react-native-navigation-plugin'
import type { AppState } from '../../core/lib/core'

jest.mock('react-native-navigation')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MockSpanFactory, createConfiguration } from '@bugsnag/js-performance-test-utilities'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import type { AppState } from '@bugsnag/core-performance'
import { Navigation } from 'react-native-navigation'
import ReactNativeNavigationPlugin from '../lib/react-native-navigation-plugin'
import type { AppState } from '../../core/lib/core'

jest.mock('react-native-navigation')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Plugin, SpanFactory, SpanInternal } from '@bugsnag/core-performance'
import type { AppState, Plugin, SpanFactory, SpanInternal } from '@bugsnag/core-performance'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import type { NavigationDelegate } from 'react-native-navigation/lib/dist/src/NavigationDelegate'
import type { AppState } from '../../core/lib/core'

import { createNavigationSpan } from '@bugsnag/react-native-performance'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { SpanFactory } from '@bugsnag/core-performance'

Check failure on line 1 in packages/plugin-react-navigation/lib/create-navigation-container.tsx

View workflow job for this annotation

GitHub Actions / linting

'@bugsnag/core-performance' imported multiple times
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import type { AppState } from '@bugsnag/core-performance'

Check failure on line 3 in packages/plugin-react-navigation/lib/create-navigation-container.tsx

View workflow job for this annotation

GitHub Actions / linting

'@bugsnag/core-performance' imported multiple times
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'
import type { NavigationContainerProps, NavigationContainerRefWithCurrent } from '@react-navigation/native'
import React, { forwardRef, useRef } from 'react'
import { NavigationContextProvider } from './navigation-context'
import type { AppState } from '../../core/lib/core'

// Prevent rollup plugin from tree shaking NavigationContextProvider
const Provider = NavigationContextProvider
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin-react-navigation/lib/navigation-context.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { SpanFactory, SpanInternal } from '@bugsnag/core-performance'
import type { AppState, SpanFactory, SpanInternal } from '@bugsnag/core-performance'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import type { PropsWithChildren } from 'react'
import type { AppState } from '../../core/lib/core'

import React from 'react'
import { createNavigationSpan } from '@bugsnag/react-native-performance'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Plugin, SpanFactory } from '@bugsnag/core-performance'
import type { AppState, Plugin, SpanFactory } from '@bugsnag/core-performance'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import { NavigationContainer } from '@react-navigation/native'
import { createNavigationContainer } from './create-navigation-container'
import type { AppState } from '../../core/lib/core'

class BugsnagPluginReactNavigationNativePerformance implements Plugin<ReactNativeConfiguration> {
private spanFactory?: SpanFactory<ReactNativeConfiguration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MockSpanFactory } from '@bugsnag/js-performance-test-utilities'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import type { AppState } from '@bugsnag/core-performance'
import { NavigationContainer, createNavigationContainerRef } from '@react-navigation/native'
import type { ParamListBase } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
Expand All @@ -8,7 +9,6 @@ import { act, fireEvent, render, screen } from '@testing-library/react-native'
import React from 'react'
import { Button, Text, View } from 'react-native'
import { createNavigationContainer } from '../lib/create-navigation-container'
import type { AppState } from '../../core/lib/core'

beforeEach(() => {
jest.useFakeTimers()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { SpanFactory } from '@bugsnag/core-performance'
import type { AppState, SpanFactory } from '@bugsnag/core-performance'
import { MockSpanFactory } from '@bugsnag/js-performance-test-utilities'
import type { ReactNativeConfiguration } from '@bugsnag/react-native-performance'
import { fireEvent, render, screen } from '@testing-library/react-native'
import React, { useContext } from 'react'
import { Button, View } from 'react-native'
import { NavigationContext, NavigationContextProvider } from '../lib/navigation-context'
import type { AppState } from '../../core/lib/core'

beforeEach(() => {
jest.useFakeTimers()
Expand Down

0 comments on commit e36b843

Please sign in to comment.