-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add stubs/no-op support for unsupported targets #426
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
buenaflor
merged 59 commits into
main
from
cursor/add-js-browser-target-for-sentry-kmp-235a
Jul 22, 2025
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
3d0f8f1
Update Kotlin and Compose version
buenaflor 5938aac
Missing newline
buenaflor 39775b7
Update
buenaflor ef0aa9c
Update deprecations
buenaflor 8db72ee
Merge branch 'main' into deps/upgrade-kotlin
buenaflor 530cdf0
Fix K2 compiler issue
buenaflor 305871a
Formatting
buenaflor cd22321
Fix test
buenaflor c893986
Update
buenaflor c856bd6
Update
buenaflor 1e18595
Formatting
buenaflor 23b0ea4
Formatting
buenaflor e0b6d23
Fix Java 11 config
buenaflor eecc548
Bump test lib versions
buenaflor 2115539
Versions
buenaflor 1f1a4f6
Java config
buenaflor e611075
Update
buenaflor 9d5ba95
Merge branch 'main' into deps/upgrade-kotlin
buenaflor f8c356c
Enable debug temporarily
buenaflor 43ee73a
Revert
buenaflor 0223f5c
Update
buenaflor fdf6fea
Update
buenaflor e9c65fd
Update
buenaflor a5e2d88
Line end
buenaflor 2b5af1f
Formatting
buenaflor c835f21
Merge branch 'main' into deps/upgrade-kotlin
buenaflor e0f9abe
Merge branch 'main' into deps/upgrade-kotlin
buenaflor 31e24c6
Add toolchain to java block
buenaflor 0cbb440
Update CHANGELOG
buenaflor 06243bf
Add JavaScript (JS) target support for Sentry Kotlin Multiplatform SDK
cursoragent 737dade
Update publication
buenaflor 06a6695
Update
buenaflor 17c1920
Update
buenaflor d523c68
Update
buenaflor b1d21e5
Update
buenaflor 4c6b9c3
Update
buenaflor d48b16d
Let CI run for testing
buenaflor 3a7acf7
Update
buenaflor 76963f6
Merge branch 'deps/upgrade-kotlin' into chore/update-distribution-gen…
buenaflor 30484fa
Update
buenaflor 973fe5e
Update
buenaflor d75f8f2
Merge branch 'main' into deps/upgrade-kotlin
buenaflor 6c59179
Merge branch 'deps/upgrade-kotlin' into chore/update-distribution-gen…
buenaflor 3b031f5
Update
buenaflor 09b194a
Update
buenaflor d9f06ca
Clean up
buenaflor 32b61a9
Merge branch 'deps/upgrade-kotlin' into cursor/add-js-browser-target-…
buenaflor d72cf37
Merge branch 'chore/update-distribution-generation' into cursor/add-j…
buenaflor 457cca0
Update publicatiojn
buenaflor 57120d8
Add support for stub sourceSet
buenaflor 17f5398
Add wasmJs support
buenaflor 5818c5b
Merge branch 'main' into cursor/add-js-browser-target-for-sentry-kmp-…
buenaflor c17a936
Update
buenaflor 50d1953
Update
buenaflor bc5c2a1
Analyze
buenaflor 5fea52e
Fix analyze
buenaflor e35899e
Update CHANGELOG
buenaflor aa7e7f6
Update SentryPlatformOptions.commonStub.kt
buenaflor f1316a7
Update
buenaflor 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,4 @@ Pod::Spec.new do |spec| | |
} | ||
] | ||
|
||
end | ||
end |
49 changes: 49 additions & 0 deletions
49
...ltiplatform/src/commonStub/kotlin/io/sentry/kotlin/multiplatform/Attachment.commonStub.kt
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,49 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
public actual class Attachment { | ||
|
||
public actual val bytes: ByteArray? | ||
public actual val contentType: String? | ||
public actual val pathname: String? | ||
public actual val filename: String | ||
|
||
public actual companion object { | ||
public actual fun fromScreenshot(screenshotBytes: ByteArray): Attachment = | ||
Attachment(screenshotBytes, "screenshot.png", "image/png") | ||
} | ||
|
||
public actual constructor(bytes: ByteArray, filename: String) { | ||
this.bytes = null | ||
this.pathname = null | ||
this.filename = "" | ||
this.contentType = null | ||
} | ||
|
||
public actual constructor(bytes: ByteArray, filename: String, contentType: String?) { | ||
this.bytes = null | ||
this.pathname = null | ||
this.filename = "" | ||
this.contentType = null | ||
} | ||
|
||
public actual constructor(pathname: String) { | ||
this.bytes = null | ||
this.pathname = null | ||
this.filename = "" | ||
this.contentType = null | ||
} | ||
|
||
public actual constructor(pathname: String, filename: String) { | ||
this.bytes = null | ||
this.pathname = null | ||
this.filename = "" | ||
this.contentType = null | ||
} | ||
|
||
public actual constructor(pathname: String, filename: String, contentType: String?) { | ||
this.bytes = null | ||
this.pathname = null | ||
this.filename = "" | ||
this.contentType = null | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...-multiplatform/src/commonStub/kotlin/io/sentry/kotlin/multiplatform/Context.commonStub.kt
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,3 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
public actual abstract class Context |
67 changes: 67 additions & 0 deletions
67
...iplatform/src/commonStub/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.commonStub.kt
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,67 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
import io.sentry.kotlin.multiplatform.protocol.Breadcrumb | ||
import io.sentry.kotlin.multiplatform.protocol.SentryId | ||
import io.sentry.kotlin.multiplatform.protocol.User | ||
import io.sentry.kotlin.multiplatform.protocol.UserFeedback | ||
|
||
@Suppress("UnusedPrivateMember") | ||
internal actual class SentryBridge actual constructor( | ||
private val sentryInstance: SentryInstance | ||
) { | ||
actual fun init(context: Context, configuration: OptionsConfiguration) { | ||
// No-op | ||
} | ||
|
||
actual fun init(configuration: OptionsConfiguration) { | ||
// No-op | ||
} | ||
|
||
actual fun initWithPlatformOptions(configuration: PlatformOptionsConfiguration) { | ||
// No-op | ||
} | ||
|
||
actual fun captureMessage(message: String): SentryId { | ||
return SentryId.EMPTY_ID | ||
} | ||
|
||
actual fun captureMessage(message: String, scopeCallback: ScopeCallback): SentryId { | ||
return SentryId.EMPTY_ID | ||
} | ||
|
||
actual fun captureException(throwable: Throwable): SentryId { | ||
return SentryId.EMPTY_ID | ||
} | ||
|
||
actual fun captureException(throwable: Throwable, scopeCallback: ScopeCallback): SentryId { | ||
return SentryId.EMPTY_ID | ||
} | ||
|
||
actual fun configureScope(scopeCallback: ScopeCallback) { | ||
// No-op | ||
} | ||
|
||
actual fun captureUserFeedback(userFeedback: UserFeedback) { | ||
// No-op | ||
} | ||
|
||
actual fun addBreadcrumb(breadcrumb: Breadcrumb) { | ||
// No-op | ||
} | ||
|
||
actual fun setUser(user: User?) { | ||
// No-op | ||
} | ||
|
||
actual fun isCrashedLastRun(): Boolean { | ||
return false | ||
} | ||
|
||
actual fun isEnabled(): Boolean { | ||
return false | ||
} | ||
|
||
actual fun close() { | ||
// No-op | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...tiplatform/src/commonStub/kotlin/io/sentry/kotlin/multiplatform/SentryEvent.commonStub.kt
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,12 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
import io.sentry.kotlin.multiplatform.protocol.Message | ||
import io.sentry.kotlin.multiplatform.protocol.SentryException | ||
|
||
public actual class SentryEvent actual constructor() : SentryBaseEvent() { | ||
public actual var message: Message? = null | ||
public actual var logger: String? = null | ||
public actual var level: SentryLevel? = null | ||
public actual var fingerprint: MutableList<String> = mutableListOf() | ||
public actual var exceptions: MutableList<SentryException> = mutableListOf() | ||
} |
7 changes: 7 additions & 0 deletions
7
...src/commonStub/kotlin/io/sentry/kotlin/multiplatform/SentryPlatformInstance.commonStub.kt
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,7 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
internal actual class SentryPlatformInstance : SentryInstance { | ||
actual override fun init(configuration: PlatformOptionsConfiguration) { | ||
// No-op | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
.../src/commonStub/kotlin/io/sentry/kotlin/multiplatform/SentryPlatformOptions.commonStub.kt
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,12 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
public actual class SentryPlatformOptions | ||
|
||
internal actual fun SentryPlatformOptions.prepareForInit() { | ||
// No-op | ||
} | ||
|
||
internal actual fun SentryOptions.toPlatformOptionsConfiguration(): PlatformOptionsConfiguration = | ||
{ | ||
// No-op | ||
} |
9 changes: 9 additions & 0 deletions
9
...form/src/commonStub/kotlin/io/sentry/kotlin/multiplatform/protocol/SentryId.commonStub.kt
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,9 @@ | ||
package io.sentry.kotlin.multiplatform.protocol | ||
|
||
public actual data class SentryId actual constructor(private val sentryIdString: String) { | ||
public actual companion object { | ||
public actual val EMPTY_ID: SentryId = SentryId("") | ||
} | ||
|
||
actual override fun toString(): String = sentryIdString | ||
} |
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
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.
oh, should we use BOTH here? https://kotlinlang.org/docs/js-ir-compiler.html#authoring-libraries-for-the-ir-compiler-with-backwards-compatibility
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.
ah I see, it's too old already