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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 993213003: Support browser caching using hashes in serverMode (fixes #93, fixes #92) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/codegen/html_codegen.dart ('k') | lib/src/dependency_graph.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 028a5152f56f0ae9ab30c4dd018c910a93fdb44d..16cd725d030d0a2863283dcc09c4c6890a6d6770 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -1926,7 +1926,7 @@ class JSGenerator extends CodeGenerator {
JSGenerator(String outDir, Uri root, TypeRules rules, this.options)
: super(outDir, root, rules);
- void generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
+ String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
CheckerReporter reporter) {
JS.Program jsTree =
new JSCodegenVisitor(info, rules).generateLibrary(units, reporter);
@@ -1941,10 +1941,14 @@ class JSGenerator extends CodeGenerator {
printer, path.dirname(outputPath)), jsTree);
printer.add('//# sourceMappingURL=$outFilename.map');
// Write output file and source map
- new File(outputPath).writeAsStringSync(printer.text);
+ var text = printer.text;
+ new File(outputPath).writeAsStringSync(text);
new File('$outputPath.map').writeAsStringSync(printer.map);
+ return computeHash(text);
} else {
- new File(outputPath).writeAsStringSync(jsNodeToString(jsTree));
+ var text = jsNodeToString(jsTree);
+ new File(outputPath).writeAsStringSync(text);
+ return computeHash(text);
}
}
}
« no previous file with comments | « lib/src/codegen/html_codegen.dart ('k') | lib/src/dependency_graph.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698