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

Issue 148913003: Improve how we handle packages/ HTML imports. This resolves better any valid (Closed)

Created:
6 years, 10 months ago by Siggi Cherem (dart-lang)
Modified:
6 years, 10 months ago
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Improve how we handle packages/ HTML imports. This improves resolution of URLs containing "package/" under the web/ directory. Resolution under 'lib' is the same, but it and gives better suggestions if the path looks wrong. This summarizes what changed: - source file: lib/b.html import to "packages/c/d.html" was error, now is error + suggestion import to "../packages/c/d.html" was error, now is error + suggestion import to "../../packages/c/d.html" was resolved, now is resolved too - source file: lib/a/b.html import to "packages/c/d.html" was error, now is error + suggestion import to "../packages/c/d.html" was error, now is error + suggestion import to "../../packages/c/d.html" was error, now is error + suggestion import to "../../../packages/c/d.html" was resolved, now is resolved too - source file: web/b.html import to "packages/c/d.html" was and continues to be resolved import to "../packages/c/d.html" was error, now is resolved - source file: web/a/b.html import to "packages/c/d.html" was error, now is resolved import to "../packages/c/d.html" was and continues to be resolved import to "../../packages/c/d.html" was and continues to be resolved Note: polymer-build and development mode are slightly different: polymer-build detects and issues an error for bad paths inside lib/. These are not detected by our package-resolution in loader.dart, but as long as users are not creating symlinks by hand, Dartium should detect if the paths are wrong. When we switch to start using pub-serve by default, we should be able to go back to the web-ui style of using "package:" urls directly in HTML. R=jmesserly@google.com, kustermann@google.com Committed: https://code.google.com/p/dart/source/detail?r=32170

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Total comments: 9

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -199 lines) Patch
M pkg/pkg.status View 1 4 chunks +16 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/lib/e.html View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/lib/f.html View 1 chunk +1 line, -1 line 0 comments Download
D pkg/polymer/example/canonicalization/test/canonicalization_deploy_test.dart View 1 chunk +0 lines, -39 lines 0 comments Download
D pkg/polymer/example/canonicalization/test/canonicalization_deploy_test.html View 1 chunk +0 lines, -18 lines 0 comments Download
D pkg/polymer/example/canonicalization/test/canonicalization_test.dart View 1 chunk +0 lines, -35 lines 0 comments Download
D pkg/polymer/example/canonicalization/test/canonicalization_test.html View 1 chunk +0 lines, -18 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy2_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy2_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy3_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy3_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy_test.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/deploy_test.html View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev2_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev2_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev3_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev3_test.html View 1 chunk +2 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev_test.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dev_test.html View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/deploy2_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/deploy2_test.html View 1 chunk +3 lines, -3 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/deploy_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/deploy_test.html View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/dev2_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/dev2_test.html View 1 chunk +3 lines, -3 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/dev_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization/test/dir/dev_test.html View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/a.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/a.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/b.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/b.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/c.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/d.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/lib/g.html View 1 chunk +5 lines, -1 line 0 comments Download
A pkg/polymer/example/canonicalization2/pubspec.yaml View 1 1 chunk +6 lines, -0 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/test/bad_lib_import2_negative_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization2/test/bad_lib_import2_negative_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization2/test/bad_lib_import_negative_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization2/test/bad_lib_import_negative_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/a.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/a.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/b.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/b.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/c.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/d.dart View 0 chunks +-1 lines, --1 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/lib/g.html View 1 chunk +5 lines, -1 line 0 comments Download
A pkg/polymer/example/canonicalization3/pubspec.yaml View 1 1 chunk +6 lines, -0 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/test/bad_lib_import2_negative_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization3/test/bad_lib_import2_negative_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
A + pkg/polymer/example/canonicalization3/test/bad_lib_import_negative_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/polymer/example/canonicalization3/test/bad_lib_import_negative_test.html View 1 chunk +3 lines, -2 lines 0 comments Download
M pkg/polymer/lib/src/build/common.dart View 2 chunks +40 lines, -18 lines 0 comments Download
M pkg/polymer/lib/src/build/import_inliner.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/polymer/lib/src/loader.dart View 2 chunks +20 lines, -8 lines 0 comments Download
M pkg/polymer/pubspec.yaml View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/dart/test_controller.js View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tools/testing/dart/test_suite.dart View 1 3 chunks +26 lines, -23 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Siggi Cherem (dart-lang)
Martin - I'm making a small change in test_suite to support subdirectories in polymer tests ...
6 years, 10 months ago (2014-01-29 01:28:59 UTC) #1
kustermann
https://codereview.chromium.org/148913003/diff/60001/tools/testing/dart/test_suite.dart File tools/testing/dart/test_suite.dart (right): https://codereview.chromium.org/148913003/diff/60001/tools/testing/dart/test_suite.dart#newcode1136 tools/testing/dart/test_suite.dart:1136: } while (!new File(pubspec).existsSync()); There is already logic to ...
6 years, 10 months ago (2014-01-29 20:48:39 UTC) #2
Siggi Cherem (dart-lang)
https://codereview.chromium.org/148913003/diff/60001/tools/testing/dart/test_suite.dart File tools/testing/dart/test_suite.dart (right): https://codereview.chromium.org/148913003/diff/60001/tools/testing/dart/test_suite.dart#newcode1136 tools/testing/dart/test_suite.dart:1136: } while (!new File(pubspec).existsSync()); On 2014/01/29 20:48:40, kustermann wrote: ...
6 years, 10 months ago (2014-01-29 22:15:07 UTC) #3
Jennifer Messerly
lgtm https://codereview.chromium.org/148913003/diff/80001/pkg/pkg.status File pkg/pkg.status (right): https://codereview.chromium.org/148913003/diff/80001/pkg/pkg.status#newcode125 pkg/pkg.status:125: polymer/example/canonicalization2: Skip just curious, would the above line ...
6 years, 10 months ago (2014-01-29 23:07:16 UTC) #4
Siggi Cherem (dart-lang)
thx! https://codereview.chromium.org/148913003/diff/80001/pkg/pkg.status File pkg/pkg.status (right): https://codereview.chromium.org/148913003/diff/80001/pkg/pkg.status#newcode125 pkg/pkg.status:125: polymer/example/canonicalization2: Skip On 2014/01/29 23:07:16, John Messerly wrote: ...
6 years, 10 months ago (2014-01-29 23:10:14 UTC) #5
kustermann
Testing script changes: lgtm. Thanks for the explanation. @ricow: This relative path to polymer pubspec.yaml ...
6 years, 10 months ago (2014-01-30 01:41:34 UTC) #6
Siggi Cherem (dart-lang)
https://codereview.chromium.org/148913003/diff/80001/pkg/polymer/example/canonicalization2/pubspec.yaml File pkg/polymer/example/canonicalization2/pubspec.yaml (right): https://codereview.chromium.org/148913003/diff/80001/pkg/polymer/example/canonicalization2/pubspec.yaml#newcode4 pkg/polymer/example/canonicalization2/pubspec.yaml:4: path: ../../ On 2014/01/30 01:41:34, kustermann wrote: > The ...
6 years, 10 months ago (2014-01-30 02:25:00 UTC) #7
Siggi Cherem (dart-lang)
Committed patchset #4 manually as r32170 (presubmit successful).
6 years, 10 months ago (2014-01-30 20:51:56 UTC) #8
kustermann
6 years, 10 months ago (2014-01-31 19:15:09 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/148913003/diff/80001/pkg/polymer/example/cano...
File pkg/polymer/example/canonicalization2/pubspec.yaml (right):

https://codereview.chromium.org/148913003/diff/80001/pkg/polymer/example/cano...
pkg/polymer/example/canonicalization2/pubspec.yaml:4: path: ../../
On 2014/01/30 02:25:00, Siggi Cherem (dart-lang) wrote:
> On 2014/01/30 01:41:34, kustermann wrote:
> > The canonicalization2 package is using polymer and that should be it. 
> > 
> > You should not use any relative paths here. 
> 
> I'm not sure why? These packages are apps used for testing only and are never
> intended to be published.
> 
> > Why can't you just use 'polymer' as a dependency?
> 
> I guess you mean 'polymer: any'?
> 
> We often accumulate several changes before we publish them. I'm using a
relative
> path to capture more accurately when a test depends on unpublished features.
> 
> That being said, I'm not sure how are these version dependencies used by the
> bots. Are the bots going to test with pub's hosted version of polymer, or are
we
> overriding the dependency to use the existing sources from the repo?
> 
> In the case of 'canonicalization*', some of these tests will fail if we run
them
> with the currently published version of polymer (0.9.4). I plan to release
0.9.5
> soon afterwards (I just updated this CL to include a version bump on polymer),
> but in the meantime we need to run them against the repo sources.
> 
> If the bots ignore/override the dependency version, then I can change the
> dependency here to say:
>   polymer: ">=0.9.5"

It will be an issue once all our bots will use "real" package-roots (currently
we stupidly create symlinks int out/ReleaseIA32/packages ...):

It was requested that we test all our packages/samples with packages from the
repository AND with packages from pub.dartlang.org. We've created infrastructure
for doing this:
- for every test we see if it's inside a package (canonicalization2 in this
case)
- we will then copy that pubspec.yaml into a temporary place and call 'pub get'
to fetch the dependencies (**)
- we will use the packages directory created by 'pub get' as a package-root for
the test (i.e. we pass it to dart2js/vm/...)

(**) When using public packages we don't modify the pubspec.yaml file. When
using the packages in the repository, we use "dependency overrides" for the
packages we have in the repo.

Now you probably see the issue: If you use a relative path to polymer, and we
copy the pubspec.yaml file to another place and call 'pub get', the relative
path is wrong. I'm not sure if we should have relative paths at all, or we
should special case this situation ....

Note that even though the infrastructure is there (./tools/test.py
--use-public-packages / ./tools/test.py --use-repository-packages), it's not
enabled on the bots yet.

For further discussions please get in touch with rico :)

Powered by Google App Engine
This is Rietveld 408576698