Skip to content

buildId support for Flutter Web #53027

@marandaneto

Description

@marandaneto

Hi, thanks for all the hard work.

Relates to #51941

If you're compiling a Flutter Web app, the runtime types (<obj>.runtimeType.toString()) are minified, See caveat.

Flutter Web apps spit out a source maps file if combined with --source-maps, e.g. flutter build web --source-maps

The source maps file contains extension functions that allow the unmangling of such types, https://github.com/dart-lang/sdk/blob/master/pkg/compiler/doc/sourcemap_extensions.md#minified-names-data

For tools such as Sentry.io that have to do the unmangling of such types for debugging reasons, the compiled version of the Flutter web has to be associated with the generated source maps file.

For AOT Apps, you can do this via #51941 using NativeRuntime.buildId at runtime and reading the debug file binary metadata that matches the buildId, so the association can be made thru this buildId of the compiled app and its debug symbols.

For Flutter Web apps, this is not possible, there's no way to read a buildId that is available at runtime and after build time to make the association of the Flutter web version and the generated file.

The goal of this issue would be a similar API to NativeRuntime.buildId for Flutter web, and ideally this buildId would be possible to be read after the App is compiled, or the compiler would inject the buildId into the source maps file, read more about that here https://github.com/getsentry/rfcs/blob/main/text/0081-sourcemap-debugid.md#injecting-the-debugid-into-the-sourcemap

After the error is received, the ingestion pipeline will use this buildId to match the correct source map file.

Let me know your thoughts, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions