Update README.md to mention global variable#569
Update README.md to mention global variable#569turquoisemelon wants to merge 1 commit intoJakeChampion:masterfrom
Conversation
Proposing updating the installation section of the docs to mention polyfill global. There was an issue opened about this in the past: JakeChampion#539 . Please let me know what you think of my correction. I'd be more than happy to update it based on project maintainers' feedback.
mislav
left a comment
There was a problem hiding this comment.
Thank you for the improvements! I have a couple of questions.
| ``` | ||
|
|
||
| In either case the polyfill sets up a global variable. The module does not export | ||
| anything directly, so do not use the `import fetch from ...` form of the import statement. |
There was a problem hiding this comment.
Is this necessary to point out to clarify webpack instructions?
There was a problem hiding this comment.
I thought it's a good idea to add an explanation as to why both approaches work. Especially after seeing the comments in this closed issue: #539
There was a problem hiding this comment.
Sorry that this never got merged. The library went to some changes since then, and now it exports the fetch() method and associated classes. I will update the README documentation to reflect that.
| ... or require the file: | ||
|
|
||
| ```javascript | ||
| require('whatwg-fetch') |
There was a problem hiding this comment.
Is require() something specific to webpack? I'm not a webpack user.
There was a problem hiding this comment.
It's not specific to webpack but it's part of the common usage. I pointed it out as it is another way to load the package, in addition to the first one that was included in the docs.
Proposing updating the installation section of the docs to mention polyfill global. There was an issue opened about this in the past: #539 .
Please let me know what you think of my correction. I'd be more than happy to update it based on project maintainers' feedback.