forked from michaelsbradleyjr/WebSocket-Node
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use es5-ext/global as a more robust way to resolve browser's window
The [es5-ext/global][es5g] module is based on Mathias Bynens' [polyfill][poly] for [`globalThis`][gT]. It uses the same robust technique but is more conservative in that it does not add a `globalThis` property to the resolved object, i.e. `window` in a browser and `global` in Node. It also lacks the "old IE" fallback seen in a [demo][demo] of the original polyfill, but that is easily provided in this commit. [es5g]: https://github.com/medikoo/es5-ext/blob/master/global.js [poly]: https://mathiasbynens.be/notes/globalthis [gT]: https://github.com/tc39/proposal-global [demo]: https://mathiasbynens.be/demo/globalthis-ie
- Loading branch information
1 parent
f78487c
commit b134a75
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
}, | ||
"dependencies": { | ||
"debug": "^2.2.0", | ||
"es5-ext": "^0.10.50", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
michaelsbradleyjr
Author
|
||
"nan": "^2.14.0", | ||
"gulp": "^4.0.2", | ||
"typedarray-to-buffer": "^3.1.5", | ||
|
it would be nice to get rid of this large dependency, when auditing our apps usage of web3 I found that this dependency added around 1000 .js files to our installed module size