Skip to content

Commit 7352085

Browse files
author
Walle Cyril
committed
Strategies for using ES2015+ polish
1 parent c8142b5 commit 7352085

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

html/use_es2015_strategies.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ Serving a file that are is very close to the original source files also makes th
5353

5454
### Disadvantages
5555

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.
5757

5858

5959
## Multiple front ends
6060

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.
6262

6363
### Advantages
6464

@@ -69,7 +69,7 @@ Can make assumptions such as: The device that does not have recent features will
6969

7070
### Disadvantages
7171

72-
Time cost is higher. Requires feature detection.
72+
Development time is higher. Requires feature detection. Experience maybe less consistent.
7373

7474

7575

@@ -84,7 +84,7 @@ No detection is usually paired with Transpile everything
8484
### Server side feature detection
8585

8686

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.
8888

8989
### Client side feature detection
9090

@@ -187,4 +187,5 @@ Submit an issue or a pull request.
187187
* [rollup module bundler](https://rollupjs.org/)
188188
* [babel transpiler standard, extensible](https://babeljs.io/)
189189
* [bublé transpiler efficient, zero configuration](https://buble.surge.sh/guide/)
190-
* [Safari 10 nomodule fix](https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc)
190+
* [Safari 10 nomodule fix](https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc)
191+
* [History of the browser user-agent string](https://webaim.org/blog/user-agent-string-history/)

0 commit comments

Comments
 (0)