-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dart2js: Importing unittest disables tree shaking #12862
Comments
Stephen, why do you think this a dart2js bug? Added NeedsInfo label. |
unittest uses the stacks package, which uses the path package, which imports dart:mirrors. cc @nex3. |
Why is it a problem that importing unittest disables tree-shaking? No one should be deploying code that imports unittest. For reference, path is using dart:mirrors as a workaround for issue #6943. |
path should probably be using the MirrorsUsed annotation to control this. |
It is. |
Nathan, I believe Stephen's concern is that the unittest tests could otherwise be useful for finding tree shaking bugs, but if we never tree shake, then we won't get that benefit. |
Added this to the M7 milestone. |
Removed Priority-Unassigned label. |
I have a use case for doing just that. I currently see a 10x increase in code size if I import unittest, which is less then ideal. |
If unittest is written under the assumption that it can force code to run in a mode that isn't appropriate for production, then you can't use unittest to test production code. |
Uri.base is in, which is half of what's needed to get rid of this dependence on mirrors. I don't believe we have a way of knowing the platform (browser, mac, linux, windows) yet. |
Removed this from the 1.6 milestone. |
I think this is no longer true. Added CannotReproduce label. |
It seems unfortunate and perhaps unintended that simply using unittest disables such an important optimization.
To repro, patch in https://codereview.chromium.org/23653003/
and run
$ tools/test.py -mrelease -cdart2js -rd8 dart2js_extra/tree_woe_test
The text was updated successfully, but these errors were encountered: