-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
meta(changelog): Update changelog for 9.26.0 #16480
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dcdf074
Merge pull request #16468 from getsentry/master
github-actions[bot] 4806b8a
fix(nextjs): Skip re instrumentating on generate phase of experimenta…
RulaKhaled ac22be2
feat(react-router): Re-export functions from `@sentry/react` (#16465)
s1gr1d a08cae2
fix(node): Ensure adding sentry-trace and baggage headers via SentryH…
andreiborza 57268c1
deps(react-router): Bump react-router version (#16478)
chargome f2e28a3
meta(changelog): Update changelog for 9.26.0
andreiborza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
packages/react-router/test/client/react-exports.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import * as SentryReact from '@sentry/react'; | ||
import { render } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
import { afterEach, describe, expect, it, vi } from 'vitest'; | ||
import type { ErrorBoundaryProps, FallbackRender } from '../../src/client'; | ||
import { | ||
captureReactException, | ||
ErrorBoundary, | ||
Profiler, | ||
reactErrorHandler, | ||
useProfiler, | ||
withErrorBoundary, | ||
withProfiler, | ||
} from '../../src/client'; | ||
|
||
describe('Re-exports from React SDK', () => { | ||
afterEach(() => { | ||
vi.clearAllMocks(); | ||
}); | ||
|
||
describe('re-export integrity', () => { | ||
it('should have the same reference as original @sentry/react exports', () => { | ||
// Ensure we are re-exporting the exact same functions/components, not copies | ||
expect(captureReactException).toBe(SentryReact.captureReactException); | ||
expect(reactErrorHandler).toBe(SentryReact.reactErrorHandler); | ||
expect(Profiler).toBe(SentryReact.Profiler); | ||
expect(withProfiler).toBe(SentryReact.withProfiler); | ||
expect(useProfiler).toBe(SentryReact.useProfiler); | ||
expect(ErrorBoundary).toBe(SentryReact.ErrorBoundary); | ||
expect(withErrorBoundary).toBe(SentryReact.withErrorBoundary); | ||
}); | ||
}); | ||
|
||
describe('function exports', () => { | ||
it('captureReactException should work when called', () => { | ||
const error = new Error('test error'); | ||
const errorInfo = { componentStack: 'component stack' }; | ||
|
||
const result = captureReactException(error, errorInfo); | ||
expect(typeof result).toBe('string'); | ||
expect(result).toMatch(/^[a-f0-9]{32}$/); // assuming event ID is a 32-character hex string | ||
}); | ||
}); | ||
|
||
describe('component exports', () => { | ||
it('ErrorBoundary should render children when no error occurs', () => { | ||
const { getByText } = render( | ||
React.createElement( | ||
ErrorBoundary, | ||
{ fallback: () => React.createElement('div', null, 'Error occurred') }, | ||
React.createElement('div', null, 'Child content'), | ||
), | ||
); | ||
|
||
expect(getByText('Child content')).toBeDefined(); | ||
}); | ||
|
||
it('Profiler should render children', () => { | ||
const { getByText } = render( | ||
React.createElement( | ||
Profiler, | ||
{ name: 'TestProfiler', updateProps: {} }, | ||
React.createElement('div', null, 'Profiled content'), | ||
), | ||
); | ||
|
||
expect(getByText('Profiled content')).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('HOC exports', () => { | ||
it('withErrorBoundary should create a wrapped component', () => { | ||
const TestComponent = () => React.createElement('div', null, 'ErrorBoundary Test Component'); | ||
const WrappedComponent = withErrorBoundary(TestComponent, { | ||
fallback: () => React.createElement('div', null, 'Error occurred'), | ||
}); | ||
|
||
expect(WrappedComponent).toBeDefined(); | ||
expect(typeof WrappedComponent).toBe('function'); | ||
expect(WrappedComponent.displayName).toBe('errorBoundary(TestComponent)'); | ||
|
||
const { getByText } = render(React.createElement(WrappedComponent)); | ||
expect(getByText('ErrorBoundary Test Component')).toBeDefined(); | ||
}); | ||
|
||
it('withProfiler should create a wrapped component', () => { | ||
const TestComponent = () => React.createElement('div', null, 'Profiler Test Component'); | ||
const WrappedComponent = withProfiler(TestComponent, { name: 'TestComponent' }); | ||
|
||
expect(WrappedComponent).toBeDefined(); | ||
expect(typeof WrappedComponent).toBe('function'); | ||
expect(WrappedComponent.displayName).toBe('profiler(TestComponent)'); | ||
|
||
const { getByText } = render(React.createElement(WrappedComponent)); | ||
expect(getByText('Profiler Test Component')).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('type exports', () => { | ||
it('should export ErrorBoundaryProps type', () => { | ||
// This is a compile-time test - if this compiles, the type is exported correctly | ||
const props: ErrorBoundaryProps = { | ||
children: React.createElement('div'), | ||
fallback: () => React.createElement('div', null, 'Error'), | ||
}; | ||
expect(props).toBeDefined(); | ||
}); | ||
|
||
it('should export FallbackRender type', () => { | ||
// This is a compile-time test - if this compiles, the type is exported correctly | ||
const fallbackRender: FallbackRender = ({ error }) => | ||
React.createElement('div', null, `Error: ${error?.toString()}`); | ||
expect(fallbackRender).toBeDefined(); | ||
expect(typeof fallbackRender).toBe('function'); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for bringing it back :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for reference: this string is used as a detection point for our external contributor action to insert contribution attributions into the changelog automatically