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

map files from 'pub build' #22174

Closed
jtalley opened this issue Jan 27, 2015 · 20 comments
Closed

map files from 'pub build' #22174

jtalley opened this issue Jan 27, 2015 · 20 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Milestone

Comments

@jtalley
Copy link

jtalley commented Jan 27, 2015

What steps will reproduce the problem?
1."dart2js -m test.dart" generates a source map file.
2.'pub build' does not generate a map file

What is the expected output? What do you see instead?
We want map files from pub build

What version of the product are you using?
1.8.3

On what operating system?
Mac/Win/Linux

Please provide any additional information below.

As we added transformers to our build we had to move away from calling dart2js directly and use 'pub build', which works, but we lost the ability to create map files for our release builds. I'd like to request optional map file generation for pub build.

@sethladd
Copy link
Contributor

Added Area-Pub, Pub-Build, Triaged labels.

@nex3
Copy link
Member

nex3 commented Jan 27, 2015

Pub will default to creating source maps in debug mode, but not in release mode since release mode doesn't include any Dart sources anyway. Generally we recommend using "pub serve" during development, but if you want to use "pub build" you can pass the --debug flag to include the Dart sources and source maps.


Added AsDesigned label.

@sethladd
Copy link
Contributor

Natalie,

Can we get:

minified code
source maps

From pub build, in any way? I know we can with dart2js

Thanks!

@munificent
Copy link
Member

Yeah, not doing this by default is deliberate, but I think it may be useful to allow it. See: https://groups.google.com/a/dartlang.org/forum/#!topic/misc/ZnSlw5lKTqU


Removed Type-Defect, Priority-Unassigned labels.
Added Type-Enhancement, Priority-Medium, Triaged labels.

@nex3
Copy link
Member

nex3 commented Jan 27, 2015

Marked this as being blocked by #16645.

@jtalley
Copy link
Author

jtalley commented Jan 27, 2015

You have to have 'release' maps available. If you don't, you cannot easily track down where crashes are coming from in the source. In live applications it will happen that bugs are found that can only be reproduced in the release build. Developers absolutely need access to map files for release builds in these circumstances.

@sethladd
Copy link
Contributor

Added C5 label.

@sethladd
Copy link
Contributor

Bumping to high for our customer. Thanks for taking a look!


Removed Priority-Medium label.
Added Priority-High label.

@sethladd
Copy link
Contributor

We'd like to propose a workaround:

Can you try:

pub build --debug

AND

add

minify:true

To your $dart2js transformer in your pubspec.yaml?

@jtalley
Copy link
Author

jtalley commented Jan 29, 2015

That could work, but it would mean having to modify the pubspec file to switch between a debug build and a release build. It would be better to have the option available as a build flag like "pub build --release --output_maps"

@sethladd
Copy link
Contributor

What's the difference between a debug build and a release build, if we set minify:true + mode=debug?

@jtalley
Copy link
Author

jtalley commented Jan 29, 2015

Sorry I wasn't clear. A debug build is not minified but a release build is minified. We'd want map files for both. We actually do find ourselves debugging the dart2js generated js, so having non-minified builds available is necessary.

@sethladd
Copy link
Contributor

Ah, yup! So the suggestion is: (and it's up to you to tell us if it's sufficient)

from the command line, do:

pub build --deploy

from inside your pubspec.yaml file, do this:

transformers:

  • $dart2js:
        minify: true

We think this gives you want you want:

* Minified output

  • source maps copied into build/

Please give it a try and let us know if this works for you.

Thanks!

@jtalley
Copy link
Author

jtalley commented Feb 3, 2015

The problem with this solution is that we ALWAYS get minified code unless we modify the pubspec.yaml file as part of the build process. It seems like adding a command line flag to produce map files in release would be a much better solution. Is there a reason this isn't desired? Seems like anyone trying to support a live service would want it.

@sethladd
Copy link
Contributor

sethladd commented Feb 3, 2015

Thanks for the feedback, John. We'll take a look.


Set owner to @cbracken.
Added this to the 1.9 milestone.

@DartBot
Copy link

DartBot commented Feb 3, 2015

This comment was originally written by @zoechi


If there was a way to pass pubspec.yaml as file path or to read from stdin the whole flexibility/configurability for pub build could be managed externally by various tools.

@cbracken
Copy link
Member

cbracken commented Feb 4, 2015

Added Accepted label.

@cbracken
Copy link
Member

cbracken commented Feb 6, 2015

Landed r43536 which adds a 'sourceMaps' boolean option to the $dart2js transformer in pub. If specified, pub emits sourcemaps based on the value; otherwise the beahviour is as previously, i.e., driven by --mode=release/debug. To always emit sourcemaps, add:

$dart2js:
    sourceMaps: true

to your pubspec.yaml


Added Fixed label.

@sethladd
Copy link
Contributor

sethladd commented Feb 6, 2015

Thanks Chris. Can we set this from the command line?

@jtalley jtalley added Type-Enhancement P1 A high priority bug; for example, a single project is unusable or has many test failures labels Feb 6, 2015
@jtalley jtalley added this to the 1.9 milestone Feb 6, 2015
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#1236.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants