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: html/use_es2015_strategies.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,12 +53,12 @@ Serving a file that are is very close to the original source files also makes th
53
53
54
54
### Disadvantages
55
55
56
-
Serving different js files like ES3 ES5 and ES2015 also requires feature detection(See below).
56
+
Serving different js files like ES3 ES5 and ES2015 also requires feature detection.
57
57
58
58
59
59
## Multiple front ends
60
60
61
-
Manually create multiple front ends (HTML, JS, CSS) and each of those has its own js build. This pattern can be used for other media capabilities: such as mobile/desktop. For client-side feature detection, there are 2 strategies: Use the build with more requirement and inside an if statement in a script detect if downgrade is required (down grade if required). Or, by default serve a low requirement front end and inside an if statement in a script detect if an upgrade is possible (upgrade when possible)
61
+
Manually create multiple front ends (HTML, JS, CSS) and each of those has its own js build. This pattern can be used for other media capabilities: such as mobile/desktop. For client-side feature detection, there are 2 strategies: Use the build with more requirement and inside an if statement in a script detect if downgrade is required. Or, by default serve a low requirement front end, and inside an if statement in a script detect if an upgrade is possible.
62
62
63
63
### Advantages
64
64
@@ -69,7 +69,7 @@ Can make assumptions such as: The device that does not have recent features will
69
69
70
70
### Disadvantages
71
71
72
-
Time cost is higher. Requires feature detection.
72
+
Development time is higher. Requires feature detection. Experience maybe less consistent.
73
73
74
74
75
75
@@ -84,7 +84,7 @@ No detection is usually paired with Transpile everything
84
84
### Server side feature detection
85
85
86
86
87
-
When a user loads a web-page its computer will make a HTTP request to the server. That HTTP request contains information that the server can read before sending a response: URL, Cookies, User-Agent, Accept-Encoding, Accept etc. Those information can be used to guess what features are available on the requesting user-agent. The big problem is that this technique is not reliable on its own.
87
+
When a user loads a web-page its computer will make a HTTP request to the server. That HTTP request contains information that the server can read before sending a response: URL, Cookies, User-Agent, Accept-Encoding, Accept etc. Those information can be used to guess what features are available on the requesting user-agent. The big problem is that this technique is very fragile used on its own. The main reason is that most browsers lie about User-Agent.
88
88
89
89
### Client side feature detection
90
90
@@ -187,4 +187,5 @@ Submit an issue or a pull request.
0 commit comments