Skip to content

Commit 613b031

Browse files
author
Walle Cyril
committed
add no transpile
1 parent 7352085 commit 613b031

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

html/use_es2015_strategies.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Strategies for using ES2015+
1+
# Strategies for using ES2015+ for the browser
22

33
There are various ways to deliver a functioning web app while using ES2015+ JavaScript as a development language.
44

55

66
## Build overview
77

8-
8+
* Transpile nothing
99
* Transpile everything
1010
* Multiple builds
1111
* Multiple front ends
@@ -24,19 +24,35 @@ There are various ways to deliver a functioning web app while using ES2015+ Java
2424

2525
## Build
2626

27+
## Transpile nothing
28+
29+
Only build and minify in the build step. Makes sense when target audience uses new browsers, or when the web app relies on features that are only available in new browsers anyway.
30+
31+
32+
### Advantages
33+
34+
Easiest to set up and understand.
35+
36+
37+
### Disadvantages
38+
39+
The developer has to manually track sets of features that are available in a high enough percentage to be used. Older browser will not be supported unless a fallback is used.
40+
41+
2742
## Transpile everything
2843

44+
2945
Generate a single ES5 file (depending on your target).
3046

3147

3248
### Advantages
3349

34-
Easiest to set up and understand.
50+
Easy to set up and understand.
3551

3652

3753
### Disadvantages
3854

39-
Probably a certain number of users use a modern browser that understands modern ES2015+ syntax and download unnecessary polyfills and more, which slows down page load compared to Multiple builds.
55+
Probably a certain number of users use a modern browser that understands modern ES2015+ syntax and download unnecessary polyfills and more, which slows down page load compared to Multiple builds. Also some features, may be inefficient after transpilation like `for of loops`.
4056

4157

4258

@@ -178,6 +194,12 @@ A polyfill in JavaScript is a back-port of a standard feature for not yet up to
178194
Submit an issue or a pull request.
179195

180196

197+
198+
## Notes
199+
200+
Written in late 2017. Might be obsolete in 2020-2025
201+
202+
181203
## Links
182204

183205
* [script type module for ES2015](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/)

0 commit comments

Comments
 (0)