You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/step-3/AppShell.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ import filmStrip from './filmstrip.png';
7
7
8
8
classAppShellextendsComponent{
9
9
render(){
10
-
constappShellCode=
10
+
constappShellCode=
11
11
`<!-- Header -->
12
12
<header class="header">
13
13
<div class="header__container">
@@ -34,8 +34,8 @@ class AppShell extends Component {
34
34
35
35
return(
36
36
<divclassName="introduction appshell">
37
-
<h1>App Shell Architecture</h1>
38
-
<p>An app shell architecture is minimal level <spanclassName="highlight bold no--bg">HTML, CSS, Javascript</span> required to power the application user interface.</p>
37
+
<h1>App Shell Architecture</h1>
38
+
<p>An app shell architecture is minimal level <spanclassName="highlight bold no--bg">HTML, CSS, Javascript</span> required to power the application user interface.</p>
39
39
40
40
<h3>Components for App Shell</h3>
41
41
<ulclassName="">
@@ -49,7 +49,7 @@ class AppShell extends Component {
49
49
<Highlightlang='html'value={appShellCode}/>
50
50
51
51
<i><b>Screenshot:</b></i>
52
-
52
+
53
53
<divclassName="offline__container">
54
54
<imgsrc={appShellImg}alt="app shell"/>
55
55
</div>
@@ -63,7 +63,7 @@ class AppShell extends Component {
<p>In webpagetest, we measured the same site in <spanclassName="highlight bold no--bg">Chrome - 3G</span>. Load time for repeat visits was <spanclassName="highlight bold no--bg">3.015s</span> Results are below.</p>
69
69
@@ -79,8 +79,8 @@ class AppShell extends Component {
<li><ahref="housing.com"target="_blank">Housing.com</a> mobile site</li>
81
81
</ul>
82
-
83
-
<Notetype="facts">
82
+
83
+
<Notetype="facts">
84
84
<p><span>Facts: </span> Using app shell model, <ahref="housing.com"target="_blank">Housing.com</a> were able to load the page 30% faster than before. Read thier full case study <ahref="https://developers.google.com/web/showcase/2016/pdfs/housing.pdf"target="_blank">here</a>.</p>
<p>More details about <ahref="https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage">Cache API</a>.</p>
57
57
58
-
<h2>Offline/Online Events</h2>
59
-
<p>By using <spanclassName="highlight bold no--bg">offline/online events</span>, we can let the user know when he is offline or call an API when he has connectivity again.</p>
60
-
61
-
<Highlightlang='javascript'value={offlineEvent}/>
62
-
58
+
<h2>Offline/Online Events</h2>
59
+
<p>By using <spanclassName="highlight bold no--bg">offline/online events</span>, we can let the user know when he is offline or call an API when he has connectivity again.</p>
Copy file name to clipboardExpand all lines: src/step-6/AppLike.js
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ import manifest from './manifest.png';
5
5
6
6
classAppLikeextendsComponent{
7
7
render(){
8
-
constmanifestJson=`{
8
+
constmanifestJson=`{
9
9
"name": "Application Name",
10
10
"short_name": "App Name",
11
11
"icons": [{
@@ -18,37 +18,37 @@ class AppLike extends Component {
18
18
"background_color": "#fff",
19
19
"display": "standalone",
20
20
"orientation": "portrait"
21
-
}`;
21
+
}`;
22
22
23
-
return(
23
+
return(
24
24
<divclassName="introduction">
25
25
<h1>AppLike</h1>
26
26
<p>Using <spanclassName="highlight bold no--bg">web manifest</span>, gives you extra control over the add to homescreen, splash screen experience. Add to homescreen gives us the ability to install the web application quickly without having to worry about the size of the application.</p>
27
-
28
-
<p>Manifest.json should contain the following criteria.</p>
29
27
30
-
<ul>
31
-
<li>Site should be in <spanclassName="highlight bold no--bg">HTTPS</span>.</li>
32
-
<li>Should have a <spanclassName="highlight bold no--bg">registered service worker</span>.</li>
33
-
<li>Should contain a <spanclassName="highlight bold no--bg">name</span>, <spanclassName="highlight bold no--bg">short_name</span> to display in banner and homescreen.</li>
34
-
<li>Icon should be <spanclassName="highlight bold no--bg">PNG</span> image and at least <spanclassName="highlight bold no--bg">144px</span> in dimension.</li>
35
-
<li><spanclassName="highlight bold no--bg">Add to homescreen</span> banner will show when user should visits your site at least twice with some time intervals in between.</li>
36
-
</ul>
28
+
<p>Manifest.json should contain the following criteria.</p>
37
29
38
-
<Note>
39
-
<p><span>Note: </span>Above listed criertia's will change over the time, for more info <ahref="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android#criteria-faq">Google Developers Site</a>.</p>
40
-
</Note>
30
+
<ul>
31
+
<li>Site should be in <spanclassName="highlight bold no--bg">HTTPS</span>.</li>
32
+
<li>Should have a <spanclassName="highlight bold no--bg">registered service worker</span>.</li>
33
+
<li>Should contain a <spanclassName="highlight bold no--bg">name</span>, <spanclassName="highlight bold no--bg">short_name</span> to display in banner and homescreen.</li>
34
+
<li>Icon should be <spanclassName="highlight bold no--bg">PNG</span> image and at least <spanclassName="highlight bold no--bg">144px</span> in dimension.</li>
35
+
<li><spanclassName="highlight bold no--bg">Add to homescreen</span> banner will show when user should visits your site at least twice with some time intervals in between.</li>
36
+
</ul>
41
37
42
-
<b>Sample Manifest</b>
43
-
44
-
<Highlightlang="json"value={manifestJson}/>
38
+
<Note>
39
+
<p><span>Note: </span>Above listed criertia's will change over the time, for more info <ahref="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android#criteria-faq">Google Developers Site</a>.</p>
40
+
</Note>
45
41
46
-
<p>More about manifest in <ahref="https://w3c.github.io/manifest/">W3C Specification</a>.</p>
42
+
<b>Sample Manifest</b>
43
+
44
+
<Highlightlang="json"value={manifestJson}/>
45
+
46
+
<p>More about manifest in <ahref="https://w3c.github.io/manifest/">W3C Specification</a>.</p>
47
47
48
48
<h2>Cross Browser</h2>
49
49
<p>Add to homescreen, splash screen are supported in <spanclassName="highlight bold no--bg">Chrome</span>, <spanclassName="highlight bold no--bg">Mozilla Firefox</span>, <spanclassName="highlight bold no--bg">Opera</span> and <spanclassName="highlight bold no--bg">Safari</span> as well.</p>
<p>The final step of this codelabs is deploying our github cards with HTTPS server.</p>
15
15
<h3>Follow the below steps.</h3>
16
-
<p><spanclassName="highlight bold no--bg">Step 1</span> - Install surge via npm.</p>
17
-
<Highlightlang="bash"value={surgeInstall}/>
16
+
<p><spanclassName="highlight bold no--bg">Step 1</span> - Install surge via npm.</p>
17
+
<Highlightlang="bash"value={surgeInstall}/>
18
18
19
-
<p><spanclassName="highlight bold no--bg">Step 2</span> - Go to <spanclassName="highlight bold no--bg">final directory</span> in sample repository.</p>
20
-
<Highlightlang="bash"value={finalDir}/>
21
-
22
-
<p><spanclassName="highlight bold no--bg">Step 3</span> - Type the below command to deploy.</p>
23
-
<Highlightlang="bash"value={surgeDeploy}/>
19
+
<p><spanclassName="highlight bold no--bg">Step 2</span> - Go to <spanclassName="highlight bold no--bg">final directory</span> in sample repository.</p>
20
+
<Highlightlang="bash"value={finalDir}/>
24
21
25
-
<p>After successful deployment, you will get an url in your terminal. Copy it and open in your desktop and mobile browsers :D</p>
22
+
<p><spanclassName="highlight bold no--bg">Step 3</span> - Type the below command to deploy.</p>
23
+
<Highlightlang="bash"value={surgeDeploy}/>
26
24
27
-
<h3>What next?</h3>
28
-
<p>Everything is perfect, except the deployed site is loading in HTTP unless we change the url to HTTPS. So lets fix it by forcing HTTP to redirect to HTTPS.</p>
29
-
30
-
<Highlightlang="bash"value={surgeDeployHTTPS}/>
25
+
<p>After successful deployment, you will get an url in your terminal. Copy it and open in your desktop and mobile browsers :D</p>
31
26
32
-
<Notetype="tips">
33
-
<p><span>Tips: </span><ahref="https://chrome.google.com/webstore/detail/blipmdconlkpinefehnmjammfjpmpbjk"target="_blank">Lighthouse</a> analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices. Our application score was <spanclassName="highlight bold no--bg">91/100</span>.</p>
34
-
</Note>
27
+
<h3>What next?</h3>
28
+
<p>Everything is perfect, except the deployed site is loading in HTTP unless we change the url to HTTPS. So lets fix it by forcing HTTP to redirect to HTTPS.</p>
35
29
36
-
<p>Thats it all done!!</p>
30
+
<Highlightlang="bash"value={surgeDeployHTTPS}/>
31
+
32
+
<Notetype="tips">
33
+
<p><span>Tips: </span><ahref="https://chrome.google.com/webstore/detail/blipmdconlkpinefehnmjammfjpmpbjk"target="_blank">Lighthouse</a> analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices. Our application score was <spanclassName="highlight bold no--bg">91/100</span>.</p>
0 commit comments