-
-
Notifications
You must be signed in to change notification settings - Fork 51
Refactor code to better align with Unreal's structure #745
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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.
I still want to better understand the macro magic here, but I'll leave that for tomorrow. This is a first pass review :) I don't feel strongly about ending a file with a newline if you're not keen on the busy work, it's just a habit of mine 😅
plugin-dev/Source/Sentry/Private/GenericPlatform/GenericPlatformSentrySubsystem.cpp
Show resolved
Hide resolved
plugin-dev/Source/Sentry/Private/GenericPlatform/GenericPlatformSentrySubsystem.h
Outdated
Show resolved
Hide resolved
plugin-dev/Source/Sentry/Private/GenericPlatform/GenericPlatformSentrySubsystem.h
Show resolved
Hide resolved
plugin-dev/Source/Sentry/Private/GenericPlatform/GenericPlatformSentrySubsystem.cpp
Show resolved
Hide resolved
@nwhite-riot Thank you for all the effort you've put into this refactoring so far! Overall, things are looking good and we appreciate making the SDK more future-proof in terms of adding consoles support. This review might require a few iterations given the amount of changes however I'd like to share some of my early thoughts: One of my major concerns is that Sentry entities (e.g. event, user, breadcrumb) cannot be created directly with Previously we relied at constructors and/or initialize methods to ensure that the default native impl is set whenever possible making Unreal objects self-contained. This approach wasn't ideal but it seemed more error-proof for SDK users. Perhaps it would make sense to combine this with the object construction utilities introduced here? If so, there doesn't seem to be any other significant changes to the plugin's public API and therefore preserving its backward compatibility with older versions would be preferred. |
After adding the |
@tustanivsky, I thought this would be preferable to having users instantiate their own objects - either we have the library to do it for them, or we remove the library and allow them to construct the objects manually. Feels odd to have both? |
|
My last question about this is around object validity: if a user calls I will look into retaining the desired functionality (of allowing Thanks for the discussion! |
For most Sentry classes that wasn't an issue since their default constructor handled the native implementation initialization (except |
plugin-dev/Source/Sentry/Private/Tests/SentryBreadcrumb.spec.cpp
Outdated
Show resolved
Hide resolved
I've created a PR (nwhite-riot#3) that addresses some of the build issues on Apple/Android platforms. |
* Fix method names for Apple impl * Wrap sentry-native include * Add missing include for NewObject * Fix errors due to missing SentryTransactionContext implementations for Apple/Android * Fix platform define * Fix method name * Fix errors related to sampling context * Fix sampling context include * Add missing define for iOS * Add missing define for Android * Fix method name for Android * Update package snapshot
* Fix compilation errors on Linux * Add missing includes * Fix demo blueprint engine version
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.
Thank you @nwhite-riot!
This PR adds Unreal Engine SDK migration guide for the upcoming `1.0.0` plugin release. Related to: - getsentry/sentry-unreal#928 - getsentry/sentry-unreal#971 - getsentry/sentry-unreal#1051 - getsentry/sentry-unreal#1018 - getsentry/sentry-unreal#886 - getsentry/sentry-unreal#745 - getsentry/sentry-unreal#436 - getsentry/sentry-unreal#589 - getsentry/sentry-unreal#1057 - getsentry/sentry-unreal#669 --------- Co-authored-by: Bruno Garcia <[email protected]>
Addresses #733 and #754.
The intent of this change is to better align the structure/layout of code with Unreal by separating out platform-specific code in a more meaningful way.
SentrySubsystemDesktop
intoGenericPlatform
,Microsoft
,Windows
, andLinux
Microsoft
and notWindows
)typedef
overrides for multiplatform implementations (e.g. Sentry subsystem)HAL
to house platform-specific includes, overrides, and macrosTSentryImplWrapper<>
)