Bug 1137702 - Load relooper independently from player to prevent Closure from destroying it

This commit is contained in:
Till Schneidereit 2015-02-27 16:39:23 +01:00
Родитель 44f01fed59
Коммит 4289c9e182
6 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -99,6 +99,7 @@
</script>
<script> console.time("Load Player Bundle"); </script>
<script src="../../build/libs/relooper.js"></script>
<script src="../../build/bundles/shumway.player.js"></script>
<script> console.timeEnd("Load Player Bundle"); </script>

Просмотреть файл

@ -36,8 +36,10 @@ build: ensureoutputdir
mkdir -p $(BUILD_DIR)/content/playerglobal
cp ../../build/playerglobal/playerglobal.json $(BUILD_DIR)/content/playerglobal/
cp ../../build/playerglobal/playerglobal.abcs $(BUILD_DIR)/content/playerglobal/
# Coping ABC and Relooper files
mkdir -p $(BUILD_DIR)/content/libs
cp ../../build/libs/builtin.abc $(BUILD_DIR)/content/libs/
cp ../../build/libs/relooper.js $(BUILD_DIR)/content/libs/
# Copying closure optimized shumway.js files
cp $(BUNDLES_DIR)/shumway*.js $(BUILD_DIR)/content/
cp ../../build/version/version.txt $(BUILD_DIR)/content/version.txt

Просмотреть файл

@ -20,6 +20,8 @@ limitations under the License.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<base href=""/>
// Loading the relooper from the asm.js cache takes 3x as long as compiling it, so no async.
<script src="../libs/relooper.js"></script>
<script src="../shumway.player.js"></script>
<script src="viewerPlayer.js"></script>
</head>

Просмотреть файл

@ -9,7 +9,7 @@ build/ts/tools.js
#!inline console.timeEnd("Load Shared Dependencies");
#!inline console.time("Load AVM2 Dependencies");
build/libs/relooper.js
#!skipbundle build/libs/relooper.js
build/ts/avm2.js
#!inline console.timeEnd("Load AVM2 Dependencies");

Просмотреть файл

@ -9,7 +9,7 @@ build/ts/tools.js
#!inline console.timeEnd("Load Shared Dependencies");
#!inline console.time("Load AVM2 Dependencies");
build/libs/relooper.js
#!skipbundle build/libs/relooper.js
build/ts/avm2.js
#!inline console.timeEnd("Load AVM2 Dependencies");

Просмотреть файл

@ -63,6 +63,9 @@ function updateLibRefs(filePath, manifestPath, lib, onlyIncludes) {
if (entry.indexOf('#!inline ') === 0) {
return indent + '<script> ' + entry.substr(9).trim() + ' </script>';
}
if (entry.indexOf('#!skipbundle ') === 0) {
return indent + '<script src="' + baseUrl + entry.substr(13).trim() + '"></script>';
}
console.error('Skipping unknown ' + entry);
return '';
}
@ -107,6 +110,9 @@ function updateJSLibRefs(filePath, manifestPath, lib, onlyIncludes) {
if (entry.indexOf('#!inline ') === 0) {
return indent + entry.substr(9).trim();
}
if (entry.indexOf('#!skipbundle ') === 0) {
return indent + 'load("' + baseUrl + entry.substr(13).trim() + '");';
}
console.error('Skipping unknown ' + entry);
return '';
}
@ -202,6 +208,9 @@ function packageRefs(includes, output, license) {
content += entry.substr(9).trim() + '\n';
return;
}
if (entry.indexOf('#!skipbundle ') === 0) {
return;
}
console.error('Skipping unknown ' + entry);
return;
}