Skip to content

Add support for Rescript #8951

Closed
Closed

Description

@listepo

Problem Statement

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

Solution Brainstorm

Add support for Rescript

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Sep 5, 2023
  2. AbhiPrasad commented on Sep 5, 2023

    @AbhiPrasad
    Contributor

    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#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!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Sep 5, 2023
  4. AbhiPrasad commented on Sep 5, 2023

    @AbhiPrasad
    Contributor

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

  5. locked and limited conversation to collaborators on Sep 5, 2023
  6. converted this issue into a discussion #8952 on Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions