Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Add support for Rescript #8951

Closed
listepo opened this issue Sep 5, 2023 · 2 comments
Closed

Add support for Rescript #8951

listepo opened this issue Sep 5, 2023 · 2 comments

Comments

@listepo
Copy link

listepo commented Sep 5, 2023

Problem Statement

Rescript is a new and rapidly developing programming language. But has no support in sentry

Solution Brainstorm

Add support for Rescript

@AbhiPrasad
Copy link
Member

Hey @listepo, thanks for writing in.

You can include the @sentry/browser SDK via rescript's importing APIs and external API.

Something like (sorry it's been 3+ years since I wrote rescript/reasonml/bucklescript so there might be some mistakes in syntax)

open Sentry

@module("@sentry/browser")
external make: 'a => unit = "init"

@module("@sentry/browser")
external captureException: 'a => unit = "captureException"

This will allow you to initialize and use the SDK as per the docs. Unhandled exceptions are also captured automatically by Sentry, and you can add external methods as needed via the rescript JS API.

The only issue here is that Rescript does not support sourcemaps - which means there is no way to associate the minified JS error to the original rescript file in a production error stacktrace. See rescript-lang/rescript-compiler#1699 for more details. This means Sentry (and other production error monitoring).

I would recommend reaching out to the current ReScript maintainers - maybe they've changed their mind on supporting sourcemaps?

I don't think the team has the bandwidth to maintain a set of Rescript bindings for the SDK, but anyone is free to help step in here - PRs are welcome! We can help review PRs and give feedback!

@AbhiPrasad
Copy link
Member

Going to transfer this as a discussion since we need more input on this.

@getsentry getsentry locked and limited conversation to collaborators Sep 5, 2023
@AbhiPrasad AbhiPrasad converted this issue into discussion #8952 Sep 5, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants