-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(Godot): Add migration guide #15019
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
8 commits
Select commit
Hold shift + click to select a range
a9fbd76
docs(Godot): Add migration guide
limbonaut a5ec52c
Expand Godot settings path
limbonaut f9f7177
Add code formatting for class_name mention
limbonaut f4b72c0
Merge branch 'master' into godot-migration-guide
limbonaut 5925f0f
Be specific about project settings
limbonaut 286e58a
Update index.mdx
limbonaut 68b66c6
Merge remote-tracking branch 'origin/master' into godot-migration-guide
limbonaut c5feb80
Use Godots in 3
limbonaut 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: Migration Guide | ||
description: "Learn more about migrating to the current version." | ||
sidebar_order: 8000 | ||
--- | ||
|
||
## Migrating to 1.0.0 | ||
|
||
### Breaking changes | ||
|
||
The minimum supported Godot Engine version has been updated to `4.5-stable`. This requirement will remain fixed for the `1.x` release series. The log file is no longer required for script error detection. | ||
|
||
We redesigned breadcrumbs API for a cleaner interface. See [Changes to breadcrumbs API](#changes-to-breadcrumbs-api) below. | ||
|
||
Configuration script support and `SentryConfiguration` class are removed. Instead, please use manual initialization with a configuration callback, if you need to set up SDK from code. See [Changes to programmatic configuration](#changes-to-programmatic-configuration) below. | ||
|
||
The `attach_screenshot` and `screenshot_level` options have moved to the experimental section while we're still improving things. If you previously had it enabled, you will need to re-enable it in its new location. Testing is recommended if you want to use this in production. | ||
|
||
`enabled` and `disabled_in_editor_play` project settings were renamed to `auto_init` and `skip_auto_init_on_editor_play` for clarity. | ||
|
||
|
||
### Changes to breadcrumbs API | ||
|
||
Previously, `add_breadcrumb()` method accepted 5 parameters (3 of which were strings), making it confusing to use. The new approach uses a dedicated `SentryBreadcrumb` class: | ||
|
||
```gdscript | ||
var crumb := SentryBreadcrumb.create("Something happened") | ||
crumb.type = "info" | ||
crumb.set_data({"some": "data"}) | ||
SentrySDK.add_breadcrumb(crumb) | ||
``` | ||
|
||
For simple breadcrumbs, you can use a one-liner: | ||
```gdscript | ||
SentrySDK.add_breadcrumb(SentryBreadcrumb.create("Something happened")) | ||
``` | ||
|
||
### Changes to programmatic configuration | ||
|
||
Configuration scripts and the `SentryConfiguration` class have been removed. To configure the SDK programmatically, you must initialize it manually. The earliest point for initialization is within the `MainLoop._initialize()` method. Here's how you can do it: | ||
|
||
1. Disable **Auto Init** in Godot's **Project Settings** window under **Sentry** category. | ||
2. Create a main loop script with a `class_name` attribute, and init Sentry inside `_initialize()` method. | ||
```gdscript | ||
class_name MyMainLoop | ||
extends SceneTree | ||
|
||
func _initialize() -> void: | ||
# Sentry initialization | ||
SentrySDK.init(func(options: SentryOptions) -> void: | ||
options.release = "my-game@1.2.3" | ||
options.before_send = _before_send | ||
) | ||
|
||
# Post-init configuration | ||
SentrySDK.add_attachment(...) | ||
# ... | ||
|
||
func _before_send(ev: SentryEvent) -> SentryEvent: | ||
# Return the event (with or without modifications) or null to skip reporting. | ||
return ev | ||
``` | ||
3. Assign your main loop type in Godot's **Project Settings** under **Application > Run > Main Loop Type** ("MyMainLoop" in the example code). |
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.
Uh oh!
There was an error while loading. Please reload this page.