@@ -28,29 +28,62 @@ when `client.on('change')` is called.
28
28
### EventSource polyfill
29
29
30
30
If you need streaming support, and you wish to support browsers that do not
31
- support ` EventSource ` natively, you can install a polyfill, such as
31
+ support ` EventSource ` natively, you can install a polyfill such as
32
32
[ EventSource] ( https://github.com/Yaffle/EventSource ) .
33
33
34
- You can load the polyfill via a script tag in the ` <head> ` before the script
35
- where you initialize ` LDClient ` :
34
+ #### CDN
36
35
37
- < script src="/public/eventsource.js"></script>
36
+ You can load the polyfill via a script tag in the ` <head> ` before the script where you initialize ` LDClient ` :
38
37
39
- If you use [ webpack] ( https://webpack.github.io/ ) or
40
- [ browserify] ( http://browserify.org/ ) , make sure to require the polyfill before
41
- ` LDClient ` is initialized.
38
+ <script src="https://unpkg.com/[email protected] /src/eventsource.min.js"></script>
39
+
40
+ #### NPM or Yarn
41
+
42
+
43
+
44
+ Then import it before the module that initializes the LaunchDarkly client:
45
+
46
+ require('event-source-polyfill');
42
47
43
48
### Document.querySelectorAll() polyfill
44
49
45
50
If you need to run A/B tests on IE7 or IE8 you will need to install a polyfill
46
51
for ` document.querySelector() ` such as
47
52
[ polyfill-queryselector] ( https://github.com/cobbdb/polyfill-queryselector ) .
48
53
49
- You can load the polyfll via a script tag in the ` <head> ` :
54
+ #### CDN
55
+
56
+ You can load the polyfill via a script tag in the ` <head> ` before the script where you initialize ` LDClient ` :
57
+
58
+ <script src="https://unpkg.com/[email protected] /querySelector.js"></script>
59
+
60
+ #### NPM or Yarn
61
+
62
+
63
+
64
+ Then import it before the module that initializes the LaunchDarkly client:
65
+
66
+ require('polyfill-queryselector');
67
+
68
+ ### Promise polyfill
69
+
70
+ The newer versions of the use ` Promise ` . If you need to support older browsers, you will
71
+ need to install a polyfill for it, such as [ es6-promise] ( https://github.com/stefanpenner/es6-promise ) .
72
+
73
+ #### CDN
74
+
75
+ You can load the polyfill via a script tag in the ` <head> ` before the script where you initialize ` LDClient ` :
76
+
77
+ <script src="https://unpkg.com/[email protected] /dist/es6-promise.auto.min.js"></script>
78
+
79
+ #### NPM or Yarn
80
+
81
+
82
+
83
+ Then import it before the module that initializes the LaunchDarkly client:
50
84
51
- <script src="/public/querySelector.js"></script>
85
+ require('es6-promise/auto');
52
86
53
- You can also install it with ` npm install polyfill-queryselector ` or ` bower install polyfill-queryselector ` .
54
87
55
88
## Installation
56
89
0 commit comments