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

Issue 2928483005: Add an incremental reloader example and a utility tool to trigger a reload by (Closed)

Created:
3 years, 6 months ago by Siggi Cherem (dart-lang)
Modified:
3 years, 6 months ago
Reviewers:
Paul Berry, scheglov
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add an incremental reloader example and a utility tool to trigger a reload by hand. The example includes: - an interactive UI that lets you trigger reloads without typing commands - a wrapper of the incremental kernel generator that invalidates files based on modification time stamps BUG= R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/aecfab68aa562cec0781f03c242990324618eb1f

Patch Set 1 #

Total comments: 8

Patch Set 2 : CL comments #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+522 lines, -8 lines) Patch
A pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart View 1 1 chunk +185 lines, -0 lines 0 comments Download
A pkg/front_end/example/incremental_reload/run.dart View 1 chunk +284 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/incremental/file_state.dart View 1 2 chunks +7 lines, -2 lines 0 comments Download
M pkg/front_end/lib/src/incremental_kernel_generator_impl.dart View 1 3 chunks +5 lines, -6 lines 0 comments Download
M pkg/front_end/test/incremental_kernel_generator_test.dart View 1 1 chunk +20 lines, -0 lines 3 comments Download
A pkg/front_end/tool/vm/reload.dart View 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
Siggi Cherem (dart-lang)
Paul/Konstantin - think of the example folder as what we need to do in flutter_tools. ...
3 years, 6 months ago (2017-06-06 23:49:46 UTC) #2
scheglov
https://codereview.chromium.org/2928483005/diff/1/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart File pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart (right): https://codereview.chromium.org/2928483005/diff/1/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart#newcode37 pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart:37: ? new FileByteStore('/tmp/ikg_cache') This will not work on Windows. ...
3 years, 6 months ago (2017-06-07 01:04:42 UTC) #3
Siggi Cherem (dart-lang)
PTAL https://codereview.chromium.org/2928483005/diff/1/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart File pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart (right): https://codereview.chromium.org/2928483005/diff/1/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart#newcode37 pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart:37: ? new FileByteStore('/tmp/ikg_cache') On 2017/06/07 01:04:42, scheglov wrote: ...
3 years, 6 months ago (2017-06-07 20:17:12 UTC) #4
scheglov
LGTM https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incremental_kernel_generator_test.dart File pkg/front_end/test/incremental_kernel_generator_test.dart (right): https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incremental_kernel_generator_test.dart#newcode672 pkg/front_end/test/incremental_kernel_generator_test.dart:672: expect(_getLibraryText(_getLibrary(program, aUri)), contains("int a =")); On 2017/06/07 20:17:11, ...
3 years, 6 months ago (2017-06-07 20:26:32 UTC) #5
Siggi Cherem (dart-lang)
Committed patchset #2 (id:20001) manually as aecfab68aa562cec0781f03c242990324618eb1f (presubmit successful).
3 years, 6 months ago (2017-06-07 20:45:03 UTC) #7
Siggi Cherem (dart-lang)
thanks https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incremental_kernel_generator_test.dart File pkg/front_end/test/incremental_kernel_generator_test.dart (right): https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incremental_kernel_generator_test.dart#newcode672 pkg/front_end/test/incremental_kernel_generator_test.dart:672: expect(_getLibraryText(_getLibrary(program, aUri)), contains("int a =")); On 2017/06/07 20:26:32, ...
3 years, 6 months ago (2017-06-07 20:51:09 UTC) #8
scheglov
3 years, 6 months ago (2017-06-07 21:00:46 UTC) #9
Message was sent while issue was closed.
On 2017/06/07 20:51:09, Siggi Cherem (dart-lang) wrote:
> thanks
> 
>
https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incr...
> File pkg/front_end/test/incremental_kernel_generator_test.dart (right):
> 
>
https://codereview.chromium.org/2928483005/diff/20001/pkg/front_end/test/incr...
> pkg/front_end/test/incremental_kernel_generator_test.dart:672:
> expect(_getLibraryText(_getLibrary(program, aUri)), contains("int a ="));
> On 2017/06/07 20:26:32, scheglov wrote:
> > On 2017/06/07 20:17:11, Siggi Cherem (dart-lang) wrote:
> > > Let me know if you prefer that I check the full text of the library. I
felt
> > that
> > > this was the main relevant subset to compare before and after.
> > > 
> > > Aside -- I find it a bit hard to navigate code when we have multiline
> strings
> > > inlined, especially when those strings start from the margin and are not
> > > indented. Would you be OK if we indent them? It is easy to do for the
input
> > > programs, but we'd need to trim the whitespace to do it also for the
output
> > > expectations. Another alternative would be to move code snippets to the
> bottom
> > > of the file and add a bunch of top-level variables/getters for those.
> > 
> > Verifying only relevant parts is perfectly fine.
> > 
> > Multiline strings work fine when you use IDEA with its semantic
highlighting.
> > All tests in Analyzer and Analysis Server are written in this style.
> > 
> 
> I have highlighting too :) - the problem is that I do like scanning code
> visually and indentation helps with that. The multi-line strings break that
flow
> for me.
> 
> > I would prefer to keep our test methods self contained, without external
> > variables.
> 
> I can relate to that. The other idea of indenting is a small change. Basically
> instead of:
> 
>   test_compile_export_cycle() async {
>     Uri cUri = writeFile(
>         cPath,
>         r'''
> import 'b.dart';
> A a;
> B b;
> ''');
> 
>     expect(
>         _getLibraryText(library),
>         r'''
> library;
> import self as self;
> import "./a.dart" as a;
> import "./b.dart" as b;
> 
> static field a::A a;
> static field b::B b;
> ''');
>   }
> 
> 
> We would write it as:
> 
>   test_compile_export_cycle() async {
>     Uri cUri = writeFile(
>         cPath,
>         r'''
>         import 'b.dart';
>         A a;
>         B b;
>         ''');
> 
>     expect(
>         _getLibraryText(library),
>         r'''
>         library;
>         import self as self;
>         import "./a.dart" as a;
>         import "./b.dart" as b;
> 
>         static field a::A a;
>         static field b::B b;
>         '''.replaceAll('\n          ','\n'));
>   }
> 
> 
> 
> (or we could compare ignoring whitespace, or automate the process of trimming
> indentation based on the whitespace on the first line)
> 
> Thoughts?

I think it's just a matter of getting used to this code style.
The version with indentation breaks my flow.

Powered by Google App Engine
This is Rietveld 408576698