Skip to content

Bazel - Relocate sourcemaps #23520

Closed
Closed

Description

@alan-agius4

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

At the moment sourcemaps sources paths are not correct as they point to the build directory example: ../../../../../../../../../../execroot/angular/bazel-out/darwin-fastbuild/bin/packages/common/http/src/module.ts.

Take a look at: https://unpkg.com/@angular/[email protected]/fesm2015/http.js.map

Ideally during build time these are relocated in order for the consumer of Angular to be able to debug easier as at the moment, If someone tries to use these sourcemaps it is a bit difficult for consumers to find what they are looking for especially considering if you type @angular/core nothing comes up.

Current result in browser;
image

With ng-packagr we are doing this and you can have a look here;
https://github.com/dherges/ng-packagr/blob/4e6c4f4bb21869c69f084560af3fa75531e4d07f/src/lib/ng-v5/entry-point/relocate-source-maps.transform.ts

The sourcemaps can eventually be emitted with the correct path, and flatten module id, so the consumers can find it easier.

example;
ng://@angular/common/http/src/module.ts

Expected behavior

Sourcemaps are relocated for a better debugging experience.

Environment


Angular version: 6.0.0-rc5

Activity

  1. changed the title [-]Angular 6 - Relocate sourcemaps[/-] [+]Bazel - Relocate sourcemaps[/+] on Apr 24, 2018
  2. added
    featureLabel used to distinguish feature request from other issues
    area: build & ciRelated the build and CI infrastructure of the project
    area: coreIssues related to the framework runtime
    on Apr 24, 2018
  3. added this to the Backlog milestone on Apr 24, 2018
  4. jelbourn commented on Oct 16, 2020

    @jelbourn
    Contributor

    @alan-agius4 is this related to #19841?

  5. alan-agius4 commented on Oct 17, 2020

    @alan-agius4
    ContributorAuthor

    Should be, closing in favour of the mentioned issue.

  6. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    Reopening as the other issue is related to pre-Bazel build scripts which are no longer relevant. If there is an issue, it needs to be fixed in our Bazel build tooling.

  7. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    and removed
    featureLabel used to distinguish feature request from other issues
    on Oct 19, 2020
  8. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    The path to the source-maps is bad. They are also a bit useless, since we provide the source content inline. I agree with @alan-agius4 that we should transform these paths into something similar to what ng-packagr does - which is to remove the leading ../ segments and prefix with a "protocol" such as ng:. This is similar to what webpack does with its "virtual" file paths where it prefixes files with webpack:.

  9. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    Fixing this would probably also solve #39293.

  10. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    Actually, let's track this at #14021, since that has been around longer and contains more analysis.
    The solution proposed here feels more like a hack rather than a fix for the underlying problem (which is that our build system points source-map sources to paths that are outside of the distributed code. But maybe a hack is the best we can do to fix this...

  11. angular-automatic-lock-bot commented on Nov 19, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Nov 19, 2020
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

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: build & ciRelated the build and CI infrastructure of the project

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions