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

Issue 23543005: Make Transform a little more pleasant to use: (Closed)

Created:
7 years, 3 months ago by Bob Nystrom
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Transform a little more pleasant to use: - Provide the primaryInput asset synchronously (#12515). - Add convenience methods for reading input assets (#12516). R=nweiz@google.com, sigmund@google.com Committed: https://code.google.com/p/dart/source/detail?r=26822

Patch Set 1 #

Total comments: 12

Patch Set 2 : Revise test code for handling primaryInput. #

Total comments: 4

Patch Set 3 : Revise. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -47 lines) Patch
pkg/barback/lib/src/transform.dart View 1 2 5 chunks +38 lines, -7 lines 0 comments Download
pkg/barback/lib/src/utils.dart View 1 1 chunk +17 lines, -0 lines 0 comments Download
pkg/barback/test/package_graph/transform_test.dart View 1 2 1 chunk +33 lines, -0 lines 0 comments Download
pkg/barback/test/transformer/many_to_one.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
pkg/barback/test/transformer/mock.dart View 1 2 4 chunks +37 lines, -10 lines 0 comments Download
pkg/barback/test/transformer/one_to_many.dart View 1 1 chunk +1 line, -1 line 0 comments Download
pkg/barback/test/transformer/rewrite.dart View 1 1 chunk +1 line, -1 line 0 comments Download
pkg/barback/test/utils.dart View 1 1 chunk +0 lines, -1 line 0 comments Download
pkg/observe/lib/transform.dart View 3 chunks +4 lines, -5 lines 0 comments Download
pkg/observe/test/transform_test.dart View 1 chunk +2 lines, -3 lines 0 comments Download
pkg/polymer/lib/src/transform/code_extractor.dart View 1 chunk +2 lines, -2 lines 0 comments Download
pkg/polymer/lib/src/transform/common.dart View 1 chunk +0 lines, -9 lines 0 comments Download
pkg/polymer/lib/src/transform/import_inliner.dart View 2 chunks +3 lines, -3 lines 0 comments Download
pkg/polymer/lib/src/transform/script_compactor.dart View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Bob Nystrom
7 years, 3 months ago (2013-08-27 23:57:22 UTC) #1
Siggi Cherem (dart-lang)
lgtm thank you =) https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart File pkg/barback/lib/src/transform.dart (right): https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart#newcode71 pkg/barback/lib/src/transform.dart:71: if (encoding == null) encoding ...
7 years, 3 months ago (2013-08-28 00:12:30 UTC) #2
Bob Nystrom
https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart File pkg/barback/lib/src/transform.dart (right): https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart#newcode71 pkg/barback/lib/src/transform.dart:71: if (encoding == null) encoding = UTF8; On 2013/08/28 ...
7 years, 3 months ago (2013-08-28 19:11:33 UTC) #3
nweiz
https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart File pkg/barback/lib/src/transform.dart (right): https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart#newcode51 pkg/barback/lib/src/transform.dart:51: assert(_node.primary.state == AssetState.AVAILABLE); This shouldn't be an assertion. It's ...
7 years, 3 months ago (2013-08-28 19:29:43 UTC) #4
Bob Nystrom
https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart File pkg/barback/lib/src/transform.dart (right): https://codereview.chromium.org/23543005/diff/1/pkg/barback/lib/src/transform.dart#newcode51 pkg/barback/lib/src/transform.dart:51: assert(_node.primary.state == AssetState.AVAILABLE); On 2013/08/28 19:29:43, nweiz wrote: > ...
7 years, 3 months ago (2013-08-28 20:51:27 UTC) #5
nweiz
A couple suggestions, otherwise lgtm. https://codereview.chromium.org/23543005/diff/8001/pkg/barback/lib/src/transform.dart File pkg/barback/lib/src/transform.dart (right): https://codereview.chromium.org/23543005/diff/8001/pkg/barback/lib/src/transform.dart#newcode55 pkg/barback/lib/src/transform.dart:55: /// of running, it ...
7 years, 3 months ago (2013-08-28 21:15:00 UTC) #6
Bob Nystrom
Committed patchset #3 manually as r26822 (presubmit successful).
7 years, 3 months ago (2013-08-28 22:37:48 UTC) #7
Bob Nystrom
7 years, 3 months ago (2013-08-28 22:38:24 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/23543005/diff/8001/pkg/barback/lib/src/transf...
File pkg/barback/lib/src/transform.dart (right):

https://codereview.chromium.org/23543005/diff/8001/pkg/barback/lib/src/transf...
pkg/barback/lib/src/transform.dart:55: /// of running, it may be unavailable
when this transformer later resumes.
On 2013/08/28 21:15:00, nweiz wrote:
> This sentence is confusing and slightly inaccurate. It's not just the previous
> transform that can cause the input to change; it could be a source input. I
> don't think it's worth trying to explain the full reasoning that the input may
> not be available here. It's probably sufficient just to say that it may be
> unavailable.

Re-worded a bit.

https://codereview.chromium.org/23543005/diff/8001/pkg/barback/test/transform...
File pkg/barback/test/transformer/mock.dart (right):

https://codereview.chromium.org/23543005/diff/8001/pkg/barback/test/transform...
pkg/barback/test/transformer/mock.dart:130: void pauseGetPrimary() {
On 2013/08/28 21:15:00, nweiz wrote:
> I don't like making these separate from [pauseGetInput] and [resumeGetInput].
> They're visually difficult to distinguish from {pause,resume}IsPrimary, and
they
> mean that calling `pauseGetInput(primaryId)` won't work as expected.

I think it's important to split this out. This method hits the primaryInput
getter where getInput() does not. I want coverage on that codepath. I could make
pauseInput() check the ID and call primaryInput if the ID is the primary one,
but I think that obscures the intent of the tests.

I renamed the methods to pausePrimaryInput() and resumePrimaryInput() to be a
bit more distinct.

Powered by Google App Engine
This is Rietveld 408576698