forked from electrode-io/electrode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup and fixes for xarc/webapp packages (electrode-io#1686)
- Loading branch information
1 parent
e60105d
commit 6a6f36b
Showing
63 changed files
with
1,224 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* eslint-disable */ | ||
|
||
require("foo-blah"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use strict"; | ||
|
||
const FOO_BUNDLE = { | ||
css: "foo", | ||
js: "foo" | ||
}; | ||
const BAR_BUNDLE = { | ||
css: "bar", | ||
js: "bar" | ||
}; | ||
const DEFAULT_BUNDLE = { | ||
css: "home", | ||
js: "home" | ||
}; | ||
const MULTI_BUNDLE = { | ||
css: ["foo", "bar"], | ||
js: "home" | ||
}; | ||
|
||
module.exports = request => { | ||
if (request.path.endsWith("/foo")) { | ||
return FOO_BUNDLE; | ||
} else if (request.path.endsWith("/bar")) { | ||
return BAR_BUNDLE; | ||
} else if (request.path.endsWith("/multi-chunk")) { | ||
return MULTI_BUNDLE; | ||
} else if (request.path.endsWith("/empty")) { | ||
return {}; | ||
} | ||
|
||
return DEFAULT_BUNDLE; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
color: green; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = "hello"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"empty": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"html": [ | ||
"<meta name=\"mobile-web-app-capable\" content=\"yes\">", | ||
"<meta name=\"application-name\" content=\"Electrode\">", | ||
"<link rel=\"icon\" href=\"\/js\/favicon-32x32.png\">" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!--%{INITIALIZE}--> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<!--%{META_TAGS}--> | ||
<!--%{PAGE_TITLE}--> | ||
<!--%{CRITICAL_CSS}--> | ||
<!--%{WEBAPP_HEADER_BUNDLES}--> | ||
<!--%{ user-header-token }--> | ||
</head> | ||
|
||
<body> | ||
<div>test html-1</div> | ||
<!--%{user-spot-token}--> | ||
<div class="js-content"> | ||
<!--%{user-token-unhandled}--> | ||
<!--%{SSR_CONTENT}--> | ||
</div> | ||
<!--%{PREFETCH_BUNDLES}--> | ||
<!--%{user-promise-token}--> | ||
<!--%{WEBAPP_BODY_BUNDLES}--> | ||
<script> | ||
if (window.webappStart) webappStart(); | ||
</script> | ||
<!--%{#../fixtures/custom-1}--> | ||
<!--%{user-token-1}--> | ||
<!--%{user-token-2}--> | ||
<noscript> | ||
<h4>JavaScript is Disabled</h4> | ||
<p>Sorry, this webpage requires JavaScript to function correctly.</p> | ||
<p>Please enable JavaScript in your browser and reload the page.</p> | ||
</noscript> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!--%{INITIALIZE}--> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<!--%{INITIALIZE_HELMET}--> | ||
<!--%{META_TAGS}--> | ||
<!--%{PAGE_TITLE}--> | ||
<!--%{CRITICAL_CSS}--> | ||
<!--%{WEBAPP_HEADER_BUNDLES}--> | ||
</head> | ||
|
||
<body> | ||
<div>test html-2</div> | ||
<div class="js-content"> | ||
<!--%{SSR_CONTENT}--> | ||
</div> | ||
<!--%{PREFETCH_BUNDLES}--> | ||
<!--%{WEBAPP_BODY_BUNDLES}--> | ||
<script> | ||
if (window.webappStart) webappStart(); | ||
</script> | ||
<noscript> | ||
<h4>JavaScript is Disabled</h4> | ||
<p>Sorry, this webpage requires JavaScript to function correctly.</p> | ||
<p>Please enable JavaScript in your browser and reload the page.</p> | ||
</noscript> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<!--%{INITIALIZE}--> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<!--%{META_TAGS}--> | ||
<!--%{PAGE_TITLE}--> | ||
<!--%{CRITICAL_CSS}--> | ||
<!--%{WEBAPP_HEADER_BUNDLES}--> | ||
</head> | ||
<!--%{HEAD_CLOSED}--> | ||
|
||
<body> | ||
<div>test perf 1 html</div> | ||
<!--%{user-spot-token}--> | ||
<div class="js-content"> | ||
<!--%{SSR_CONTENT}--> | ||
</div> | ||
<!--%{AFTER_SSR_CONTENT}--> | ||
<!--%{PREFETCH_BUNDLES}--> | ||
<!--%{user-promise-token}--> | ||
<!--%{WEBAPP_BODY_BUNDLES}--> | ||
<script> | ||
if (window.webappStart) webappStart(); | ||
</script> | ||
<!--%{#../fixtures/custom-1}--> | ||
<!--%{user-token-1}--> | ||
<!--%{user-token-2}--> | ||
<noscript> | ||
<h4>JavaScript is Disabled</h4> | ||
<p>Sorry, this webpage requires JavaScript to function correctly.</p> | ||
<p>Please enable JavaScript in your browser and reload the page.</p> | ||
</noscript> | ||
</body> | ||
<!--%{BODY_CLOSED}--> | ||
|
||
</html> | ||
<!--%{HTML_CLOSED}--> |
71 changes: 71 additions & 0 deletions
71
packages/xarc-webapp/test/data/stats-test-multibundle.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"assetsByChunkName": { | ||
"foo": [ | ||
"foo.bundle.f07a873ce87fc904a6a5.js", | ||
"foo.style.f07a873ce87fc904a6a5.css" | ||
], | ||
"bar": [ | ||
"bar.bundle.f07a873ce87fc904a6a5.js", | ||
"bar.style.f07a873ce87fc904a6a5.css" | ||
], | ||
"home": [ | ||
"home.bundle.f07a873ce87fc904a6a5.js", | ||
"home.style.f07a873ce87fc904a6a5.css" | ||
] | ||
}, | ||
"assets": [{ | ||
"name": "foo.style.f07a873ce87fc904a6a5.css", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"foo" | ||
] | ||
}, { | ||
"name": "foo.bundle.f07a873ce87fc904a6a5.js", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"foo" | ||
] | ||
}, { | ||
"name": "bar.style.f07a873ce87fc904a6a5.css", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"bar" | ||
] | ||
}, { | ||
"name": "bar.bundle.f07a873ce87fc904a6a5.js", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"bar" | ||
] | ||
}, { | ||
"name": "home.style.f07a873ce87fc904a6a5.css", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"home" | ||
] | ||
}, { | ||
"name": "home.bundle.f07a873ce87fc904a6a5.js", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"home" | ||
] | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"assetsByChunkName": { | ||
"bundle": [ | ||
"bundle.f07a873ce87fc904a6a5.js", | ||
"style.f07a873ce87fc904a6a5.css" | ||
] | ||
}, | ||
"assets": [{ | ||
"name": "style.f07a873ce87fc904a6a5.css", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"main" | ||
] | ||
}, { | ||
"name": "bundle.f07a873ce87fc904a6a5.js", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"main" | ||
] | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"assetsByChunkName": { | ||
"bundle": [ | ||
"bundle.f07a873ce87fc904a6a5.js", | ||
"style.f07a873ce87fc904a6a5.css" | ||
], | ||
"bar": [ | ||
"bar.bundle.f07a873ce87fc904a6a5.js", | ||
"bar.style.f07a873ce87fc904a6a5.css" | ||
] | ||
}, | ||
"assets": [{ | ||
"name": "style.f07a873ce87fc904a6a5.css", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"bundle" | ||
] | ||
}, { | ||
"name": "bundle.f07a873ce87fc904a6a5.js", | ||
"size": 888, | ||
"chunks": [ | ||
0 | ||
], | ||
"chunkNames": [ | ||
"bundle" | ||
] | ||
}, { | ||
"name": "manifest.json", | ||
"size": 888, | ||
"chunks": [], | ||
"chunkNames": [] | ||
}] | ||
} |
Oops, something went wrong.