Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Issue 207423003: Support Dart core libraries in source maps. (Closed)

Created:
6 years, 9 months ago by Bob Nystrom
Modified:
6 years, 9 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Support Dart core libraries in source maps. BUG=https://code.google.com/p/dart/issues/detail?id=17460 RELNOTE=Support Dart core libraries in source maps in pub build and serve. R=nweiz@google.com Committed: https://code.google.com/p/dart/source/detail?r=34343

Patch Set 1 #

Total comments: 28

Patch Set 2 : Revise. #

Total comments: 2

Patch Set 3 : Revise. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -41 lines) Patch
M sdk/lib/_internal/pub/lib/src/barback/build_environment.dart View 1 4 chunks +21 lines, -0 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart View 1 2 3 chunks +31 lines, -7 lines 2 comments Download
M sdk/lib/_internal/pub/lib/src/barback/pub_package_provider.dart View 1 2 chunks +29 lines, -12 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/dart.dart View 1 4 chunks +7 lines, -11 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/io.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/sdk.dart View 2 chunks +12 lines, -5 lines 0 comments Download
M sdk/lib/_internal/pub/test/build/ignores_existing_compiled_js_files_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/build/includes_dart_files_from_dependencies_in_debug_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/build/includes_dart_files_in_debug_mode_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/transformer/dart2js/includes_source_maps_in_debug_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A sdk/lib/_internal/pub/test/transformer/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart View 1 1 chunk +44 lines, -0 lines 0 comments Download
A sdk/lib/_internal/pub/test/transformer/dart2js/source_maps_include_core_libs_test.dart View 1 1 chunk +57 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Bob Nystrom
6 years, 9 months ago (2014-03-21 02:07:29 UTC) #1
nweiz
https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart File sdk/lib/_internal/pub/lib/src/barback/build_environment.dart (right): https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart#newcode348 sdk/lib/_internal/pub/lib/src/barback/build_environment.dart:348: .where((file) => path.extension(file) == ".dart") Why exclude non-Dart files? ...
6 years, 9 months ago (2014-03-21 19:36:05 UTC) #2
Bob Nystrom
Thanks! https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart File sdk/lib/_internal/pub/lib/src/barback/build_environment.dart (right): https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart#newcode348 sdk/lib/_internal/pub/lib/src/barback/build_environment.dart:348: .where((file) => path.extension(file) == ".dart") On 2014/03/21 19:36:06, ...
6 years, 9 months ago (2014-03-24 20:45:56 UTC) #3
nweiz
https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart File sdk/lib/_internal/pub/lib/src/barback/build_environment.dart (right): https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart#newcode350 sdk/lib/_internal/pub/lib/src/barback/build_environment.dart:350: path.join("lib", path.relative(file, from: sdk.rootDirectory)))); On 2014/03/24 20:45:58, Bob Nystrom ...
6 years, 9 months ago (2014-03-24 21:53:47 UTC) #4
Bob Nystrom
Thanks! https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart File sdk/lib/_internal/pub/lib/src/barback/build_environment.dart (right): https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart#newcode350 sdk/lib/_internal/pub/lib/src/barback/build_environment.dart:350: path.join("lib", path.relative(file, from: sdk.rootDirectory)))); On 2014/03/24 21:53:47, nweiz ...
6 years, 9 months ago (2014-03-24 22:52:19 UTC) #5
nweiz
lgtm https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart File sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart (right): https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart#newcode232 sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart:232: // pseudo-package so that it puts correct relative ...
6 years, 9 months ago (2014-03-24 23:17:14 UTC) #6
Bob Nystrom
Committed patchset #3 manually as r34343 (presubmit successful).
6 years, 9 months ago (2014-03-25 00:47:28 UTC) #7
Bob Nystrom
6 years, 9 months ago (2014-03-25 00:49:27 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/sr...
File sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart (right):

https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart:232: //
pseudo-package so that it puts correct relative URLs in the source maps.
On 2014/03/24 23:17:14, nweiz wrote:
> On 2014/03/24 22:52:19, Bob Nystrom wrote:
> > On 2014/03/24 21:53:47, nweiz wrote:
> > > On 2014/03/24 20:45:58, Bob Nystrom wrote:
> > > > On 2014/03/21 19:36:06, nweiz wrote:
> > > > > "in the output directory (which is inside the $sdk pseudo-package) so
> > that"
> > > > > 
> > > > > "output directory" is also kind of confusing, because no such thing
> exists
> > > > when
> > > > > using "pub serve".
> > > > 
> > > > Rewrote. Going forward, I think "build directory" should be the
canonical
> > term
> > > > for "directory in entrypoint package added to set of sources for pub
serve
> > and
> > > > build".
> > > 
> > > "Build directory" seems pretty confusing since there's a directory
involved
> in
> > > this process literally named "build".
> > 
> > Yeah, it was the best I could come up with, and mirrors "build environment".
I
> > suppose "transformer environment" would be more precise, but that doesn't
> > exactly roll off the tongue. Reworded the docs a bit here to clarify.
> 
> What about "source directory"? It's up to you, but I really found "build
> directory" confusing when reading the associated documentation.
> 
> > > Whatever terminology you choose, you should update the documentation on
> > > [BuildEnvironment._directories] to reflect it.
> > 
> > It says:
> > 
> > /// The public directories in the root package that are available for
> > /// building, keyed by their root directory.
> > 
> > which sounds about right to me. 
> 
> My point is less that the existing documentation is unclear, more that if
you're
> defining a specific term that would be a nice place to introduce it.

Yeah, I agree. I want to get this patch in soon, so just added a TODO.

https://codereview.chromium.org/207423003/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart:356: // absolute
file paths in imports that don't touch a package.
On 2014/03/24 23:17:14, nweiz wrote:
> On 2014/03/24 22:52:19, Bob Nystrom wrote:
> > On 2014/03/24 21:53:47, nweiz wrote:
> > > On 2014/03/24 20:45:58, Bob Nystrom wrote:
> > > > On 2014/03/21 19:36:06, nweiz wrote:
> > > > > I think we should stop allowing imports from the filesystem. No other
> > > > > transformer will support it.
> > > > 
> > > > I'm certainly not crazy about this, but if a user has a program that
> > contains
> > > > something like:
> > > > 
> > > > import '/Users/me/some/file.dart';
> > > > 
> > > > The program isn't incorrect. It will run in the VM and will run if you
> > invoke
> > > > dart2js explicitly. In fact, I occasionally do this in hack temp code.
> > > > 
> > > > If it doesn't work in pub, they will file bugs.
> > > 
> > > It will break in confusing ways in Dartium or in the presence of other
> > > transformers. We should fail consistently and as quickly as possible if
they
> > do
> > > something as unportable as this.
> > 
> > I'm sympathetic to this, but my experience with pub build has been that I
keep
> > underestimating the things people want to do with it. I'd like to help them
> > avoid shooting themselves in the foot here. But at the same time, when the
> user
> > *does* know what they're doing, it's a drag if pub pretends to know better
> than
> > they do and prohibits it.
> 
> The thing is, it's going to be prohibited one way or another almost all the
> time. If we add the analyzer as a linting transformer, it will break. If the
> user starts using Polymer, it will break. If the user starts using Dartium, it
> will break. If the user shares the package, it will break.
> 
> I'm also worried about users starting to use this and creating a culture where
> all transformer authors feel obligated to add special-casing for filesystem
> paths in order to be compatible with existing Dart code.
> 
> > > Besides, if users are writing quick hacky code, they won't be running it
> > through
> > > dart2js, they'll be running it in Dartium, not dart2js.
> > 
> > One thing I've learned since we launched the new pub build is that users use
> it
> > quite frequently, even while debugging or otherwise playing around.
> > 
> > How about I leave this in but add a warning when it gets hit?
> 
> A warning is definitely better than nothing. It's you really think this is a
net
> benefit, leave it in, but I'd much rather see this gone. I don't think we'd
> include it if we were writing the dart2js transformer today.

Deleted it.

https://codereview.chromium.org/207423003/diff/40001/sdk/lib/_internal/pub/li...
File sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart (right):

https://codereview.chromium.org/207423003/diff/40001/sdk/lib/_internal/pub/li...
sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart:246: //
TODO(rnystrom): Fix this if $17751 is fixed.
On 2014/03/24 23:17:14, nweiz wrote:
> "$" -> "#"

Done.

Powered by Google App Engine
This is Rietveld 408576698