Skip to content
Permalink
Browse files

bug: Browser-Sample hat old version constraint

  • Loading branch information...
MikeMitterer committed Nov 22, 2018
1 parent bf9d744 commit 5a400948be7c22b4309b7fc49313ba653930a53e
Showing with 2,669 additions and 301 deletions.
  1. +1 −1 build.jenkins
  2. +1,817 −0 example/browser/.deploy/.build.manifest
  3. BIN example/browser/{reflection/deploy → .deploy}/assets/images/favicon.png
  4. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/android-chrome-192x192.png
  5. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/android-chrome-512x512.png
  6. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/apple-touch-icon.png
  7. 0 example/browser/{reflection/deploy → .deploy}/assets/images/icon/browserconfig.xml
  8. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/favicon-16x16.png
  9. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/favicon-32x32.png
  10. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/favicon.ico
  11. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/mstile-144x144.png
  12. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/mstile-150x150.png
  13. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/mstile-310x150.png
  14. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/mstile-310x310.png
  15. BIN example/browser/{reflection/deploy → .deploy}/assets/images/icon/mstile-70x70.png
  16. 0 example/browser/{reflection/deploy → .deploy}/assets/images/icon/safari-pinned-tab.svg
  17. 0 example/browser/{reflection/deploy → .deploy}/assets/images/icon/site.webmanifest
  18. +1 −1 example/browser/{reflection/web → .deploy}/index.html
  19. 0 example/browser/{reflection/web → .deploy}/main.dart
  20. +257 −0 example/browser/.deploy/main.dart.bootstrap.js
  21. +81 −0 example/browser/.deploy/main.dart.js
  22. +139 −0 example/browser/.deploy/main.ddc.js
  23. +1 −0 example/browser/.deploy/main.ddc.js.map
  24. 0 example/browser/{reflection/web → .deploy}/styles.scss
  25. 0 example/browser/{reflection → }/.gitignore
  26. 0 example/browser/{reflection → }/.rsync
  27. 0 example/browser/{reflection → }/CHANGELOG.md
  28. 0 example/browser/{reflection → }/LICENSE
  29. 0 example/browser/{reflection → }/README.md
  30. 0 example/browser/{reflection → }/config/default.conf
  31. 0 example/browser/{reflection → }/deploy/.build.manifest
  32. BIN example/browser/{reflection/web → deploy}/assets/images/favicon.png
  33. BIN example/browser/{reflection/web → deploy}/assets/images/icon/android-chrome-192x192.png
  34. BIN example/browser/{reflection/web → deploy}/assets/images/icon/android-chrome-512x512.png
  35. BIN example/browser/{reflection/web → deploy}/assets/images/icon/apple-touch-icon.png
  36. 0 example/browser/{reflection/web → deploy}/assets/images/icon/browserconfig.xml
  37. BIN example/browser/{reflection/web → deploy}/assets/images/icon/favicon-16x16.png
  38. BIN example/browser/{reflection/web → deploy}/assets/images/icon/favicon-32x32.png
  39. BIN example/browser/{reflection/web → deploy}/assets/images/icon/favicon.ico
  40. BIN example/browser/{reflection/web → deploy}/assets/images/icon/mstile-144x144.png
  41. BIN example/browser/{reflection/web → deploy}/assets/images/icon/mstile-150x150.png
  42. BIN example/browser/{reflection/web → deploy}/assets/images/icon/mstile-310x150.png
  43. BIN example/browser/{reflection/web → deploy}/assets/images/icon/mstile-310x310.png
  44. BIN example/browser/{reflection/web → deploy}/assets/images/icon/mstile-70x70.png
  45. 0 example/browser/{reflection/web → deploy}/assets/images/icon/safari-pinned-tab.svg
  46. 0 example/browser/{reflection/web → deploy}/assets/images/icon/site.webmanifest
  47. 0 example/browser/{reflection → }/deploy/index.html
  48. 0 example/browser/{reflection → }/deploy/main.dart.js
  49. +2 −2 example/browser/{reflection → }/pubspec.yaml
  50. +0 −297 example/browser/reflection/web/main.reflectable.dart
  51. BIN example/browser/web/assets/images/favicon.png
  52. BIN example/browser/web/assets/images/icon/android-chrome-192x192.png
  53. BIN example/browser/web/assets/images/icon/android-chrome-512x512.png
  54. BIN example/browser/web/assets/images/icon/apple-touch-icon.png
  55. +9 −0 example/browser/web/assets/images/icon/browserconfig.xml
  56. BIN example/browser/web/assets/images/icon/favicon-16x16.png
  57. BIN example/browser/web/assets/images/icon/favicon-32x32.png
  58. BIN example/browser/web/assets/images/icon/favicon.ico
  59. BIN example/browser/web/assets/images/icon/mstile-144x144.png
  60. BIN example/browser/web/assets/images/icon/mstile-150x150.png
  61. BIN example/browser/web/assets/images/icon/mstile-310x150.png
  62. BIN example/browser/web/assets/images/icon/mstile-310x310.png
  63. BIN example/browser/web/assets/images/icon/mstile-70x70.png
  64. +57 −0 example/browser/web/assets/images/icon/safari-pinned-tab.svg
  65. +19 −0 example/browser/web/assets/images/icon/site.webmanifest
  66. +58 −0 example/browser/web/index.html
  67. +46 −0 example/browser/web/main.dart
  68. +181 −0 example/browser/web/styles.scss
@@ -38,7 +38,7 @@ pipeline {
steps {
timeout(time: 30, unit: 'MINUTES') {
ansiColor('xterm') {
sh 'deploySamples.sh --deploy'
sh 'deploySamples.sh --deploy --release'
sh 'deploySamples.sh --publish --force'
}
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -45,7 +45,7 @@
<footer id="pageFooter" class="dark-mode">
<div>Sample for pub-package:
<a href="https://pub.dartlang.org/packages/reflected_mustache" target="_blank">reflected_mustache</a>
<span class="published">/ published: <span class="pubdate">2018-07-06 / 11:14:00</span></span>
<span class="published">/ published: <span class="pubdate">2018-11-22 / 12:14:00</span></span>
</div>

<div>
File renamed without changes.
@@ -0,0 +1,257 @@
/* ENTRYPOINT_EXTENTION_MARKER */
(function() {
var baseUrl = (function () {
// Attempt to detect --precompiled mode for tests, and set the base url
// appropriately, otherwise set it to '/'.
var pathParts = location.pathname.split("/");
if (pathParts[0] == "") {
pathParts.shift();
}
if (pathParts.length > 1 && pathParts[1] == "test") {
return "/" + pathParts.slice(0, 2).join("/") + "/";
}
// Attempt to detect base url using <base href> html tag
// base href should start and end with "/"
if (typeof document !== 'undefined') {
var el = document.getElementsByTagName('base');
if (el && el[0] && el[0].getAttribute("href") && el[0].getAttribute
("href").startsWith("/") && el[0].getAttribute("href").endsWith("/")){
return el[0].getAttribute("href");
}
}
// return default value
return "/";
}());

let modulePaths = {
"dart_sdk": "packages/$sdk/dev_compiler/amd/dart_sdk",
"packages/logging/logging": "packages/logging/logging.ddc",
"packages/reflectable/capability": "packages/reflectable/capability.ddc",
"packages/reflectable/mirrors": "packages/reflectable/mirrors.ddc",
"packages/reflectable/src/encoding_constants": "packages/reflectable/src/encoding_constants.ddc",
"packages/reflected_mustache/mustache": "packages/reflected_mustache/mustache.ddc",
"web/main": "main.ddc"
};
if(!window.$dartLoader) {
window.$dartLoader = {
moduleIdToUrl: new Map(),
urlToModuleId: new Map(),
rootDirectories: new Array(),
// Used in package:build_runner/src/server/build_updates_client/hot_reload_client.dart
moduleParentsGraph: new Map(),
moduleLoadingErrorCallbacks: new Map(),
forceLoadModule: function (moduleName, callback, onError) {
// dartdevc only strips the final extension when adding modules to source
// maps, so we need to do the same.
if (moduleName.endsWith('.ddc')) {
moduleName = moduleName.substring(0, moduleName.length - 4);
}
if (typeof onError != 'undefined') {
var errorCallbacks = $dartLoader.moduleLoadingErrorCallbacks;
if (!errorCallbacks.has(moduleName)) {
errorCallbacks.set(moduleName, new Set());
}
errorCallbacks.get(moduleName).add(onError);
}
requirejs.undef(moduleName);
requirejs([moduleName], function() {
if (typeof onError != 'undefined') {
errorCallbacks.get(moduleName).delete(onError);
}
if (typeof callback != 'undefined') {
callback();
}
});
},
getModuleLibraries: null, // set up by _initializeTools
};
}
let customModulePaths = {};
window.$dartLoader.rootDirectories.push(window.location.origin + baseUrl);
for (let moduleName of Object.getOwnPropertyNames(modulePaths)) {
let modulePath = modulePaths[moduleName];
if (modulePath != moduleName) {
customModulePaths[moduleName] = modulePath;
}
var src = window.location.origin + '/' + modulePath + '.js';
// dartdevc only strips the final extension when adding modules to source
// maps, so we need to do the same.
if (moduleName != 'dart_sdk') {
moduleName += '.ddc';
}
if (window.$dartLoader.moduleIdToUrl.has(moduleName)) {
continue;
}
$dartLoader.moduleIdToUrl.set(moduleName, src);
$dartLoader.urlToModuleId.set(src, moduleName);
}
// Whenever we fail to load a JS module, try to request the corresponding
// `.errors` file, and log it to the console.
(function() {
var oldOnError = requirejs.onError;
requirejs.onError = function(e) {
if (e.requireModules) {
if (e.message) {
// If error occurred on loading dependencies, we need to invalidate ancessor too.
var ancesor = e.message.match(/needed by: (.*)/);
if (ancesor) {
e.requireModules.push(ancesor[1]);
}
}
for (const module of e.requireModules) {
var errorCallbacks = $dartLoader.moduleLoadingErrorCallbacks.get(module);
if (errorCallbacks) {
for (const callback of errorCallbacks) callback(e);
errorCallbacks.clear();
}
}
}
if (e.originalError && e.originalError.srcElement) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
var message;
if (this.status == 200) {
message = this.responseText;
} else {
message = "Unknown error loading " + e.originalError.srcElement.src;
}
console.error(message);
var errorEvent = new CustomEvent(
'dartLoadException', { detail: message });
window.dispatchEvent(errorEvent);
}
};
xhr.open("GET", e.originalError.srcElement.src + ".errors", true);
xhr.send();
}
// Also handle errors the normal way.
if (oldOnError) oldOnError(e);
};
}());

var baseUrl = (function () {
// Attempt to detect --precompiled mode for tests, and set the base url
// appropriately, otherwise set it to '/'.
var pathParts = location.pathname.split("/");
if (pathParts[0] == "") {
pathParts.shift();
}
if (pathParts.length > 1 && pathParts[1] == "test") {
return "/" + pathParts.slice(0, 2).join("/") + "/";
}
// Attempt to detect base url using <base href> html tag
// base href should start and end with "/"
if (typeof document !== 'undefined') {
var el = document.getElementsByTagName('base');
if (el && el[0] && el[0].getAttribute("href") && el[0].getAttribute
("href").startsWith("/") && el[0].getAttribute("href").endsWith("/")){
return el[0].getAttribute("href");
}
}
// return default value
return "/";
}());
;

require.config({
baseUrl: baseUrl,
waitSeconds: 0,
paths: customModulePaths
});

const modulesGraph = new Map();
function getRegisteredModuleName(moduleMap) {
if ($dartLoader.moduleIdToUrl.has(moduleMap.name + '.ddc')) {
return moduleMap.name + '.ddc';
}
return moduleMap.name;
}
requirejs.onResourceLoad = function (context, map, depArray) {
const name = getRegisteredModuleName(map);
const depNameArray = depArray.map(getRegisteredModuleName);
if (modulesGraph.has(name)) {
// TODO Move this logic to better place
var previousDeps = modulesGraph.get(name);
var changed = previousDeps.length != depNameArray.length;
changed = changed || depNameArray.some(function(depName) {
return !previousDeps.includes(depName);
});
if (changed) {
console.warn("Dependencies graph change for module '" + name + "' detected. " +
"Dependencies was [" + previousDeps + "], now [" + depNameArray.map((depName) => depName) +"]. " +
"Page can't be hot-reloaded, firing full page reload.");
window.location.reload();
}
} else {
modulesGraph.set(name, []);
for (const depName of depNameArray) {
if (!$dartLoader.moduleParentsGraph.has(depName)) {
$dartLoader.moduleParentsGraph.set(depName, []);
}
$dartLoader.moduleParentsGraph.get(depName).push(name);
modulesGraph.get(name).push(depName);
}
}
};
define("main.dart.bootstrap", ["web/main", "dart_sdk"], function(app, dart_sdk) {
dart_sdk.dart.ignoreWhitelistedErrors(false);
dart_sdk.dart.setStartAsyncSynchronously(true);
dart_sdk._isolate_helper.startRootIsolate(() => {}, []);
var baseUrl = (function () {
// Attempt to detect --precompiled mode for tests, and set the base url
// appropriately, otherwise set it to '/'.
var pathParts = location.pathname.split("/");
if (pathParts[0] == "") {
pathParts.shift();
}
if (pathParts.length > 1 && pathParts[1] == "test") {
return "/" + pathParts.slice(0, 2).join("/") + "/";
}
// Attempt to detect base url using <base href> html tag
// base href should start and end with "/"
if (typeof document !== 'undefined') {
var el = document.getElementsByTagName('base');
if (el && el[0] && el[0].getAttribute("href") && el[0].getAttribute
("href").startsWith("/") && el[0].getAttribute("href").endsWith("/")){
return el[0].getAttribute("href");
}
}
// return default value
return "/";
}());

dart_sdk._debugger.registerDevtoolsFormatter();
$dartLoader.getModuleLibraries = dart_sdk.dart.getModuleLibraries;
if (window.$dartStackTraceUtility && !window.$dartStackTraceUtility.ready) {
window.$dartStackTraceUtility.ready = true;
let dart = dart_sdk.dart;
window.$dartStackTraceUtility.setSourceMapProvider(
function(url) {
url = url.replace(baseUrl, '/');
var module = window.$dartLoader.urlToModuleId.get(url);
if (!module) return null;
return dart.getSourceMap(module);
});
}
if (typeof document != 'undefined') {
window.postMessage({ type: "DDC_STATE_CHANGE", state: "start" }, "*");
}

app.main.main();
var bootstrap = {
hot$onChildUpdate: function(childName, child) {
if (childName === "main.dart") {
child.main();
return true;
}
}
}
dart_sdk.dart.trackLibraries("main.dart.bootstrap", {
"main.dart.bootstrap": bootstrap
}, '');
return {
bootstrap: bootstrap
};
});
})();
@@ -0,0 +1,81 @@
(function() {
var _currentDirectory = (function () {
var _url;
var lines = new Error().stack.split('\n');
function lookupUrl() {
if (lines.length > 2) {
var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
// Chrome.
if (match) return match[1];
// Chrome nested eval case.
match = lines[1].match(/^\s+at eval [(](.+):\d+:\d+[)]$/);
if (match) return match[1];
// Edge.
match = lines[1].match(/^\s+at.+\((.+):\d+:\d+\)$/);
if (match) return match[1];
// Firefox.
match = lines[0].match(/[<][@](.+):\d+:\d+$/)
if (match) return match[1];
}
// Safari.
return lines[0].match(/(.+):\d+:\d+$/)[1];
}
_url = lookupUrl();
var lastSlash = _url.lastIndexOf('/');
if (lastSlash == -1) return _url;
var currentDirectory = _url.substring(0, lastSlash + 1);
return currentDirectory;
})();

var baseUrl = (function () {
// Attempt to detect --precompiled mode for tests, and set the base url
// appropriately, otherwise set it to '/'.
var pathParts = location.pathname.split("/");
if (pathParts[0] == "") {
pathParts.shift();
}
if (pathParts.length > 1 && pathParts[1] == "test") {
return "/" + pathParts.slice(0, 2).join("/") + "/";
}
// Attempt to detect base url using <base href> html tag
// base href should start and end with "/"
if (typeof document !== 'undefined') {
var el = document.getElementsByTagName('base');
if (el && el[0] && el[0].getAttribute("href") && el[0].getAttribute
("href").startsWith("/") && el[0].getAttribute("href").endsWith("/")){
return el[0].getAttribute("href");
}
}
// return default value
return "/";
}());


var mapperUri = baseUrl + "packages/build_web_compilers/src/" +
"dev_compiler_stack_trace/stack_trace_mapper.dart.js";
var requireUri = baseUrl + "packages/$sdk/dev_compiler/amd/require.js";
var mainUri = _currentDirectory + "main.dart.bootstrap";

if (typeof document != 'undefined') {
var el = document.createElement("script");
el.defer = true;
el.async = false;
el.src = mapperUri;
document.head.appendChild(el);

el = document.createElement("script");
el.defer = true;
el.async = false;
el.src = requireUri;
el.setAttribute("data-main", mainUri);
document.head.appendChild(el);
} else {
importScripts(mapperUri, requireUri);
require.config({
baseUrl: baseUrl,
});
// TODO: update bootstrap code to take argument - dart-lang/build#1115
window = self;
require([mainUri + '.js']);
}
})();
Oops, something went wrong.

0 comments on commit 5a40094

Please sign in to comment.
You can’t perform that action at this time.