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

Issue 11275029: Support for specifying an output directory (issue #106) (Closed)

Created:
8 years, 1 month ago by Siggi Cherem (dart-lang)
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/dart-web-components.git@master
Visibility:
Public.

Description

Support for specifying an output directory. This adds a directive-parser for dart code which we use to extract imports and rewrite them. We also apply the rewrite logic in CSS/js urls so that the html can be used form the output location. Committed: https://github.com/dart-lang/dart-web-components/commit/4468789

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+760 lines, -143 lines) Patch
M lib/src/analyzer.dart View 1 2 3 3 chunks +8 lines, -0 lines 0 comments Download
M lib/src/codegen.dart View 1 1 chunk +28 lines, -0 lines 0 comments Download
M lib/src/compiler.dart View 1 2 3 4 chunks +11 lines, -3 lines 0 comments Download
A lib/src/directive_parser.dart View 1 2 3 4 1 chunk +382 lines, -0 lines 0 comments Download
M lib/src/emitters.dart View 1 2 5 chunks +58 lines, -48 lines 0 comments Download
M lib/src/info.dart View 1 3 chunks +49 lines, -11 lines 0 comments Download
M lib/src/messages.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M lib/src/options.dart View 1 chunk +1 line, -1 line 0 comments Download
M lib/web_component.dart View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/bind_hyphenated_attribute_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/code_in_dart_file_component.dart View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/code_in_dart_file_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/component_imports_component2_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/component_imports_component_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/component_in_main_test.html View 1 chunk +3 lines, -4 lines 0 comments Download
M test/data/input/component_inherit_noscript_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/component_inherit_test.html View 3 chunks +2 lines, -6 lines 0 comments Download
M test/data/input/conditional2_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/conditional3_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/conditional4_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/conditional5_test.html View 1 chunk +2 lines, -3 lines 0 comments Download
M test/data/input/conditional_component.html View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/conditional_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/empty_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/list2_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/list_component.html View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/list_component_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/list_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/main_code_in_dart_file.dart View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/main_code_in_dart_file_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/path_normalization_test.html View 2 chunks +2 lines, -4 lines 0 comments Download
M test/data/input/template_multiple_children_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/template_zero_children_test.html View 2 chunks +2 lines, -3 lines 0 comments Download
M test/data/input/watch_global_var2_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/watch_global_var3_test.html View 1 chunk +1 line, -2 lines 0 comments Download
M test/data/input/watch_global_var_component.html View 1 chunk +1 line, -1 line 0 comments Download
M test/data/input/watch_global_var_test.html View 1 chunk +2 lines, -3 lines 0 comments Download
A test/directive_parser_test.dart View 1 2 3 1 chunk +164 lines, -0 lines 0 comments Download
M test/run.sh View 3 chunks +10 lines, -6 lines 0 comments Download
M test/run_all.dart View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Siggi Cherem (dart-lang)
8 years, 1 month ago (2012-10-25 03:29:10 UTC) #1
Jennifer Messerly
a few minor things, but lgtm otherwise https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_parser.dart File lib/src/directive_parser.dart (right): https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_parser.dart#newcode78 lib/src/directive_parser.dart:78: libraryName = ...
8 years, 1 month ago (2012-10-25 04:26:25 UTC) #2
Siggi Cherem (dart-lang)
8 years, 1 month ago (2012-10-25 05:17:28 UTC) #3
thanks John, submitting!

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_p...
File lib/src/directive_parser.dart (right):

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_p...
lib/src/directive_parser.dart:78: libraryName = parseQualifiedName();
On 2012/10/25 04:26:25, John Messerly wrote:
> fyi, this is not allowed by Dart language spec when I checked last week... it
> only had an identifier and VM didn't like foo.bar :(

Good question - it's not perfectly clear. The spec grammar says only identifier,
the vm crashes, but the text under the gramar (here
http://www.dartlang.org/docs/spec/latest/dart-language-specification.html#id....)

says:
A named library begins with the word library (possibly prefaced by any
applicable metadata annotations), followed by a **qualified identifier** that
gives the name of the library.

dart2js/dart_analyer accept it too, so I'll keep it in.

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_p...
lib/src/directive_parser.dart:125: messages.error('expected an import url, but
found ${token}', null);
On 2012/10/25 04:26:25, John Messerly wrote:
> would be good to include the file name

Done.

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_p...
lib/src/directive_parser.dart:128: var uri = token.value;
On 2012/10/25 04:26:25, John Messerly wrote:
> does the spec allow sequential string concat? i.e. to break up a long line

fixed. the spec allows it, but the vm crashes on it.

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/directive_p...
lib/src/directive_parser.dart:288: Token string() {
On 2012/10/25 04:26:25, John Messerly wrote:
> does spec allow raw or triple quoted strings? interpolation (gosh I hope not)?
> 
> I can't see any value in implementing those as they would be useless in
imports,
> but would be worth a note...
> 

ok added a note - seems that yes, multiline strings are allowed. Interpolation
not, the strings must be consts.

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/emitters.dart
File lib/src/emitters.dart (right):

https://chromiumcodereview.appspot.com/11275029/diff/2001/lib/src/emitters.da...
lib/src/emitters.dart:638: if (tag.attributes['rel'] == 'stylesheet' && href !=
null) {
On 2012/10/25 04:26:25, John Messerly wrote:
> I think this should be != "components". there are a bunch of link tags:
> 
> http://blog.whatwg.org/the-road-to-html-5-link-relations
> http://dev.w3.org/html5/spec/links.html#linkTypes

Done.

Powered by Google App Engine
This is Rietveld 408576698