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

Issue 882823003: Adds @HtmlImport with both dynamic and transformer based implementations. Still need an HtmlInliner… (Closed)

Created:
5 years, 11 months ago by jakemac
Modified:
5 years, 10 months ago
CC:
reviews_dartlang.org, Siggi Cherem (dart-lang)
Base URL:
git@github.com:dart-lang/web-components.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Adds @HtmlImport with both dynamic and transformer based implementations. Still need an HtmlInliner to inline the imports, but this will statically add them to the entry document. R=jmesserly@google.com Committed: https://github.com/dart-lang/core-elements/commit/2aaa0b548c02fd094d3903009546bf15a3984568

Patch Set 1 #

Total comments: 15

Patch Set 2 : format and update to use InitializerPluginTransformer #

Patch Set 3 : remove common.dart test file #

Total comments: 4

Patch Set 4 : update pubspec/changelog and add some error logging #

Patch Set 5 : update test to use new string formatter so it looks nicer #

Patch Set 6 : update status file #

Patch Set 7 : assign logger #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+375 lines, -38 lines) Patch
M .gitignore View 1 chunk +1 line, -1 line 0 comments Download
M .status View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M CHANGELOG.md View 1 2 3 1 chunk +24 lines, -0 lines 2 comments Download
A lib/build/html_import_annotation_inliner.dart View 1 2 3 4 5 6 1 chunk +124 lines, -0 lines 4 comments Download
M lib/custom_element_proxy.dart View 1 chunk +2 lines, -0 lines 0 comments Download
A lib/html_import_annotation.dart View 1 1 chunk +36 lines, -0 lines 0 comments Download
A lib/src/normalize_path.dart View 1 1 chunk +28 lines, -0 lines 0 comments Download
M pubspec.yaml View 1 2 3 4 2 chunks +12 lines, -2 lines 0 comments Download
A test/build/html_import_annotation_inliner_test.dart View 1 2 3 4 1 chunk +80 lines, -0 lines 0 comments Download
M test/custom_element_proxy_test.dart View 1 1 chunk +30 lines, -32 lines 0 comments Download
A test/html_import_annotation_test.dart View 1 1 chunk +28 lines, -0 lines 2 comments Download
A + test/html_import_annotation_test.html View 2 chunks +5 lines, -3 lines 0 comments Download
A test/my_import.html View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
jakemac
Sending this to you John since Siggi is going to be out :)
5 years, 11 months ago (2015-01-27 23:38:49 UTC) #2
Jennifer Messerly
On 2015/01/27 23:38:49, jakemac wrote: > Sending this to you John since Siggi is going ...
5 years, 10 months ago (2015-01-29 21:23:11 UTC) #3
Jennifer Messerly
this looks like a great start to me. should I take a look at the ...
5 years, 10 months ago (2015-01-29 21:32:38 UTC) #4
jakemac
Replied to everything and updated to use the new ImportPluginTransformer. https://codereview.chromium.org/882823003/diff/1/lib/build/html_import_annotation_inliner.dart File lib/build/html_import_annotation_inliner.dart (right): https://codereview.chromium.org/882823003/diff/1/lib/build/html_import_annotation_inliner.dart#newcode88 ...
5 years, 10 months ago (2015-02-02 20:55:57 UTC) #5
Jennifer Messerly
lgtm https://codereview.chromium.org/882823003/diff/1/pubspec.yaml File pubspec.yaml (right): https://codereview.chromium.org/882823003/diff/1/pubspec.yaml#newcode13 pubspec.yaml:13: html5lib: '>=0.12.0 <0.13.0' On 2015/02/02 20:55:57, jakemac wrote: ...
5 years, 10 months ago (2015-02-02 21:07:51 UTC) #6
jakemac
added some extra error logs and updated the pubspec/changelog https://codereview.chromium.org/882823003/diff/40001/lib/build/html_import_annotation_inliner.dart File lib/build/html_import_annotation_inliner.dart (right): https://codereview.chromium.org/882823003/diff/40001/lib/build/html_import_annotation_inliner.dart#newcode23 lib/build/html_import_annotation_inliner.dart:23: ...
5 years, 10 months ago (2015-02-02 21:53:56 UTC) #7
jakemac
Committed patchset #7 (id:120001) manually as 2aaa0b548c02fd094d3903009546bf15a3984568 (presubmit successful).
5 years, 10 months ago (2015-02-03 15:14:32 UTC) #8
Siggi Cherem (dart-lang)
I'm just catching up with this change - I added a few side comments, but ...
5 years, 10 months ago (2015-02-12 16:49:44 UTC) #10
jakemac
5 years, 10 months ago (2015-02-12 17:04:09 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/882823003/diff/120001/CHANGELOG.md
File CHANGELOG.md (right):

https://codereview.chromium.org/882823003/diff/120001/CHANGELOG.md#newcode20
CHANGELOG.md:20: - web_components/build/html_import_annotation_inliner:
On 2015/02/12 16:49:44, Siggi Cherem (dart-lang) wrote:
> maybe we should provide a second transformer:
>  - html_initialize
> 
> that combines what initialize + html_import_annotation_inliner do.
> 
> If a user depends on initialize on their own, they can use this form you
present
> here, but if they don't, they can do everything with a single transformer.
> 
> WDYT?

In the new version of this stuff there will only be a web_components
transformer, which itself calls the initialize transformer (with an html imports
plugin).

https://codereview.chromium.org/882823003/diff/120001/lib/build/html_import_a...
File lib/build/html_import_annotation_inliner.dart (right):

https://codereview.chromium.org/882823003/diff/120001/lib/build/html_import_a...
lib/build/html_import_annotation_inliner.dart:64: ..attributes = {'rel':
'import', 'href': importPath,};
On 2015/02/12 16:49:44, Siggi Cherem (dart-lang) wrote:
> nit: remove trailing comma `,`?

oh I probably had these on separate lines in which case the trailing comma made
sense, and then the formatter removed it, will do

https://codereview.chromium.org/882823003/diff/120001/lib/build/html_import_a...
lib/build/html_import_annotation_inliner.dart:86: // supported for the
transformer.
On 2015/02/12 16:49:44, Siggi Cherem (dart-lang) wrote:
> FYI - I opened https://github.com/dart-lang/initialize/issues/22 based on our
> discussions from earlier this week.

I replied there, but basically in the new plugin architecture this isn't needed.
Plugins have access to a Resolver and can do this on their own as desired.

https://codereview.chromium.org/882823003/diff/120001/test/html_import_annota...
File test/html_import_annotation_test.dart (right):

https://codereview.chromium.org/882823003/diff/120001/test/html_import_annota...
test/html_import_annotation_test.dart:4: @HtmlImport(importPath)
On 2015/02/12 16:49:44, Siggi Cherem (dart-lang) wrote:
> I'm surprised this works in the transformer without using the constant
evaluator
> (as in https://github.com/dart-lang/initialize/issues/22), am I missing
> something? 

This works but will be injected at runtime since the transformer doesn't know
how to deal with it. Again though in the next version its not an issue at all
:).

Powered by Google App Engine
This is Rietveld 408576698