Skip to content
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

filenames in dart2js sourcemaps shouldn't expose the location of the Dart SDK #20259

Closed
DartBot opened this issue Jul 29, 2014 · 3 comments
Closed
Labels
closed-obsolete Closed as the reported issue is no longer relevant dart2js-sourcemap P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@DartBot
Copy link

DartBot commented Jul 29, 2014

This issue was originally filed by bslesinsk...@gmail.com


The filenames in sourcemaps use a relative path to the Dart SDK. This exposes the location of the Dart SDK on the local machine where the Dart app was built. For example:

"sources": ["../../../software/dart/dart-sdk/lib/_internal/lib/interceptors.dart","../../../software/dart/dart-sdk/lib/_internal/lib/js_array.dart","../../../software/dart/dart-sdk/lib/internal/iterable.dart","../../../software/dart/dart-sdk/lib/collection/list.dart",

It would be better hide the location by going through a symlink, as is already done for packages:

ln -s ../../../software/dart-sdk .

"sources": ["dart-sdk/lib/_internal/lib/interceptors.dart","dart-sdk/lib/_internal/lib/js_array.dart","dart-sdk/lib/internal/iterable.dart","dart-sdk/lib/collection/list.dart",

Then we can deploy the sourcemap by copying the dart.js.map file and all the source files it references to the website. This would allow the entire Dart app to be debuggable just by opening Chrome Dev Tools, even without the Dart SDK installed locally.

It would also make the output of the dart2js compiler more deterministic. Currently the sourcemap file will be different depending where the developer happens to install the SDK.

Followup to:
https://code.google.com/p/dart/issues/detail?id=7903

@iposva-google
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@sigmundch
Copy link
Member

The scenario that had the biggest need for this was pub-serve. Pub has a solution for this already: they serves the sdk and provide the location to dart2js when they invoke it as a transformer, so the source-map points to the right files.

We've found that in many contexts the right solution is to override the output of dart2js to specify a new base-path for the sdk sources. Some ideas here:

  • instead of providing the real path to the sdk sources, we could provide a suffix or a special URI scheme (e.g. "sdk:path/to/sdk/file"), so that tools can easily detect these urls and fix them afterwards.
  • provide an argument to dart2js so it can set the prefix the user would like to have.

At this time, there is no pressing need for implementing this, so I'm marking this as low priority.

@sigmundch sigmundch added P3 A lower priority bug or feature request dart2js-sourcemap labels Jan 18, 2017
@nex3
Copy link
Member

nex3 commented Feb 14, 2018

DDC just lists sources as dart:path/to/sdk/file.dart, as in dart:core/string.dart. Matching that behavior would be nice.

@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant dart2js-sourcemap P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

6 participants