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

Issue 22825012: Introduce transformers for: (Closed)

Created:
7 years, 4 months ago by Siggi Cherem (dart-lang)
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org, web-ui-dev+reviews_dartlang.org
Base URL:
git@github.com:dart-lang/web-ui.git@master
Visibility:
Public.

Description

Introduce transformers for: - inlined code extraction - inlining html imports - combining multiple script tags See http://dartbug.com/12511

Patch Set 1 #

Patch Set 2 : #

Total comments: 47
Unified diffs Side-by-side diffs Delta from patch set Stats (+959 lines, -2 lines) Patch
A + lib/src/transform.dart View 1 1 chunk +5 lines, -2 lines 0 comments Download
A lib/src/transform/code_extractor.dart View 1 1 chunk +45 lines, -0 lines 13 comments Download
A lib/src/transform/common.dart View 1 1 chunk +72 lines, -0 lines 11 comments Download
A lib/src/transform/import_inliner.dart View 1 1 chunk +88 lines, -0 lines 8 comments Download
A lib/src/transform/script_compactor.dart View 1 1 chunk +122 lines, -0 lines 10 comments Download
M test/run_all.dart View 2 chunks +6 lines, -0 lines 0 comments Download
A test/transform/code_extractor_test.dart View 1 1 chunk +82 lines, -0 lines 3 comments Download
A test/transform/common.dart View 1 1 chunk +104 lines, -0 lines 0 comments Download
A test/transform/import_inliner_test.dart View 1 1 chunk +352 lines, -0 lines 0 comments Download
A test/transform/script_compactor_test.dart View 1 1 chunk +83 lines, -0 lines 2 comments Download

Messages

Total messages: 13 (0 generated)
Siggi Cherem (dart-lang)
John/Terry - here are a couple phases of our new deploy story. Terry, we should ...
7 years, 4 months ago (2013-08-19 21:23:38 UTC) #1
Bob Nystrom
I just skimmed it, but this looks really cool! There's definitely a few things we ...
7 years, 4 months ago (2013-08-19 22:28:59 UTC) #2
Jennifer Messerly
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart File lib/src/transform/code_extractor.dart (right): https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart#newcode10 lib/src/transform/code_extractor.dart:10: import 'package:path/path.dart' as path; not sure if you want ...
7 years, 4 months ago (2013-08-19 22:57:26 UTC) #3
Bob Nystrom
https://chromiumcodereview.appspot.com/22825012/diff/2001/test/transform/code_extractor_test.dart File test/transform/code_extractor_test.dart (right): https://chromiumcodereview.appspot.com/22825012/diff/2001/test/transform/code_extractor_test.dart#newcode15 test/transform/code_extractor_test.dart:15: testPhases('no changes', [[new InlineCodeExtractor()]], { On 2013/08/19 22:57:26, John ...
7 years, 4 months ago (2013-08-19 23:05:45 UTC) #4
terry
Saw each of the transforms but I'm assuming the order in which a transform is ...
7 years, 4 months ago (2013-08-20 17:03:24 UTC) #5
Bob Nystrom
> Saw each of the transforms but I'm assuming the order in which a transform ...
7 years, 4 months ago (2013-08-20 17:20:05 UTC) #6
Jennifer Messerly
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/common.dart File lib/src/transform/common.dart (right): https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/common.dart#newcode28 lib/src/transform/common.dart:28: var parser = new HtmlParser(contents, generateSpans: true, it sounds ...
7 years, 4 months ago (2013-08-20 17:50:55 UTC) #7
Siggi Cherem (dart-lang)
Thanks everyone. Now that polymer moved to the SVN repo, I moved the files of ...
7 years, 4 months ago (2013-08-21 20:35:41 UTC) #8
Bob Nystrom
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart File lib/src/transform/code_extractor.dart (right): https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart#newcode35 lib/src/transform/code_extractor.dart:35: var id = inputId.addExtension('.$count.dart'); On 2013/08/21 20:35:42, Siggi Cherem ...
7 years, 4 months ago (2013-08-21 21:18:21 UTC) #9
Siggi Cherem (dart-lang)
On 2013/08/21 21:18:21, Bob Nystrom wrote: > https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart > File lib/src/transform/code_extractor.dart (right): > > https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/code_extractor.dart#newcode35 ...
7 years, 4 months ago (2013-08-21 22:10:49 UTC) #10
Bob Nystrom
On 2013/08/21 22:10:49, Siggi Cherem (dart-lang) wrote: > On 2013/08/21 21:18:21, Bob Nystrom wrote: > ...
7 years, 4 months ago (2013-08-21 22:19:48 UTC) #11
Jennifer Messerly
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/script_compactor.dart File lib/src/transform/script_compactor.dart (right): https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/script_compactor.dart#newcode52 lib/src/transform/script_compactor.dart:52: // TODO(sigmund): should we detect/remove duplicates? On 2013/08/21 20:35:42, ...
7 years, 4 months ago (2013-08-21 23:35:28 UTC) #12
Siggi Cherem (dart-lang)
7 years, 4 months ago (2013-08-22 00:02:09 UTC) #13
On 2013/08/21 23:35:28, John Messerly wrote:
>
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/s...
> File lib/src/transform/script_compactor.dart (right):
> 
>
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/s...
> lib/src/transform/script_compactor.dart:52: // TODO(sigmund): should we
> detect/remove duplicates?
> On 2013/08/21 20:35:42, Siggi Cherem (dart-lang) wrote:
> > On 2013/08/19 22:57:26, John Messerly wrote:
> > > i think so. don't want to generate erroneous code that imports the same
> > library
> > > twice. however, we probably should run the main twice.
> > > 
> > > Try running foo:
> > > <script src="foo.dart"></script>
> > > Try running foo again:
> > > <script src="foo.dart"></script>
> > > 
> > > foo.dart:
> > > main() => print('FOO!');
> > 
> > But then, wouldn't it be ok to import it twice? (we anyways import them with
a
> > prefix)
> 
> good point, importing twice would be fine assuming it doesn't trigger a Dart
> language level error. if they are imported with unique prefixes that should
work
> great :)
> 
>
https://chromiumcodereview.appspot.com/22825012/diff/2001/lib/src/transform/s...
> lib/src/transform/script_compactor.dart:119:
> currentMirrorSystem().findLibrary(const Symbol('app_bootstrap'))
> On 2013/08/21 20:35:42, Siggi Cherem (dart-lang) wrote:
> > On 2013/08/19 22:57:26, John Messerly wrote:
> > > seems unfortunate to need to use mirrors for this. couldn't we get the
> HTML's
> > > base URL?
> > 
> > good question. I opened a bug to investigate.
> 
> btw, I discovered another pattern using mirrors that is slightly simpler
> (doesn't depend on findLibrary):
> 
> currentMirrorSystem().isolate.rootLibrary.uri

cool, I didn't know about rootLibrary! thx

Powered by Google App Engine
This is Rietveld 408576698