Commit 02fdf984 authored by dbeam's avatar dbeam Committed by Commit bot

MD Downloads: strip combined, minified JS from vulcanized output

Duplicating these resources were adding too much size to Chrome
compared to the performance benefit they add.

In my cursory perf testing I saw no tangible difference,
but I still need to test on memory constrained systems.

Shrinks crisper.js by 44.4% and gzipped copy by 43%.

R=michaelpg@chromium.org
BUG=541455

Review URL: https://codereview.chromium.org/1639513002

Cr-Commit-Position: refs/heads/master@{#371610}
parent 5a526d96
......@@ -26,23 +26,32 @@ _JS_RESOURCES_PATH = os.path.join(_RESOURCES_PATH, 'js')
_POLYMER_PATH = os.path.join(
_SRC_PATH, 'third_party', 'polymer', 'v1_0', 'components-chromium')
_WEB_ANIMATIONS_PATH = os.path.join(
_SRC_PATH, 'third_party', 'web-animations-js', 'sources')
_VULCANIZE_ARGS = [
'--exclude', 'crisper.js',
# These files are already combined and minified.
'--exclude', 'polymer-extracted.js',
'--exclude', 'polymer-micro-extracted.js',
'--exclude', 'polymer-mini-extracted.js',
'--exclude', 'polymer_config.js',
'--exclude', 'web-animations-next-lite.min.js',
# These files are dynamically created by C++.
'--exclude', 'load_time_data.js',
'--exclude', 'strings.js',
'--exclude', 'text_defaults.css',
'--inline-css',
'--inline-scripts',
'--redirect', 'chrome://downloads/|%s' % _HERE_PATH,
'--redirect', 'chrome://resources/cr_elements/|%s' % _CR_ELEMENTS_PATH,
'--redirect', 'chrome://resources/css/|%s' % _CSS_RESOURCES_PATH,
'--redirect', 'chrome://resources/html/|%s' % _HTML_RESOURCES_PATH,
'--redirect', 'chrome://resources/js/|%s' % _JS_RESOURCES_PATH,
'--redirect', 'chrome://resources/polymer/v1_0/web-animations-js/|%s' % _WEB_ANIMATIONS_PATH,
'--redirect', 'chrome://resources/polymer/v1_0/|%s' % _POLYMER_PATH,
'--strip-comments',
]
......
......@@ -65,6 +65,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
margin: 0;
}
</style>
<script src="chrome://resources/js/polymer_config.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://downloads/strings.js"></script>
<style>
......@@ -818,6 +819,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script src="chrome://resources/polymer/v1_0/web-animations-js/web-animations-next-lite.min.js"></script>
<style>
/* Copyright 2015 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
......@@ -1007,7 +1021,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</head>
<body><div hidden="" by-vulcanize=""><dom-module id="iron-list" assetpath="chrome://resources/polymer/v1_0/iron-list/">
<body><div hidden="" by-vulcanize=""><script src="chrome://resources/polymer/v1_0/polymer/polymer-micro-extracted.js"></script><script src="chrome://resources/polymer/v1_0/polymer/polymer-mini-extracted.js"></script><script src="chrome://resources/polymer/v1_0/polymer/polymer-extracted.js"></script><dom-module id="iron-list" assetpath="chrome://resources/polymer/v1_0/iron-list/">
<template>
<style>
:host {
......
......@@ -209,5 +209,4 @@ ui/webui/resources/js/cr/ui/array_data_model.js
# webkit/.
components/test_runner/helper/layout_test_helper_mac.mm
# Bundles of existing code.
chrome/browser/resources/md_downloads/crisper.js
chrome/browser/resources/md_downloads/vulcanized.html
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment