Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Webpack section in README #331

Merged
merged 1 commit into from May 20, 2016
Merged

Conversation

tarikjn
Copy link

@tarikjn tarikjn commented May 19, 2016

The currently linked solution for Webpack usage is incorrect as it does not define fetch as a global and as a result will fail when an application uses external modules which expect fetch to be available, as those will generally not be processed by Webpack's ProvidePlugin.

Including fetch in the entry configuration of Webpack is the correct way to polyfill and fixes this issue. This is consistent with how other polyfills are used e.g. babel-polyfill, and does not require any special loader.

@mislav
Copy link
Contributor

mislav commented May 19, 2016

Thanks for the heads-up. Could you simply remove all Webpack documentation instead? We don't want to be updating this every time, and we don't use Webpack ourselves so we can't assess the validity of this over time.

@tarikjn
Copy link
Author

tarikjn commented May 19, 2016

Up to you, this part of the Webpack API is pretty stable and is identical in the upcoming v2 of Webpack, and it has always been in Webpack, so I don't think it will change much over time.

I can remove this section and post a gist with the instructions. But, the advantage of pointing to the correct instructions is it will help reduce the number of users using the wrong setup. We can also simply point to the Webpack entry documentation

@tarikjn
Copy link
Author

tarikjn commented May 19, 2016

PS: It looks as if Travis CI is having some issues with some of the tests taking too long and thus showing as failing. This is unlikely to be related to this PR.

@mislav
Copy link
Contributor

mislav commented May 20, 2016

OK for now I will merge this, but I'm not keen on keeping up with module loader configuration examples if they keep changing. Thanks for the update!

@mislav mislav merged commit 4bde617 into JakeChampion:master May 20, 2016
@vieks
Copy link

vieks commented Jun 1, 2016

@tarikjn Your 'solution' doesn't work at all !

npm install whatwg-fetch --save
entry: ['whatwg-fetch', ...]
import 'whatwg-fetch';

'fetch is not defined'

The old one is OK. Please remove this pull request...

@tarikjn
Copy link
Author

tarikjn commented Jun 1, 2016

@vieks you're not supposed to import it when you place it in your entry point. If you still haven't figured it out, please open an issue an mention me, I will also need to look at your full (or more detailed) Webpack config so I can help you.

@vieks
Copy link

vieks commented Jun 2, 2016

@tarikjn Sorry mate, I spoke too fast, in fact both solutions are OK, but as you said your one is the way to go.
My problem was about isomorphic execution, where obviously this 'fetch' implementation is not defined on server side.

Have a good day|night.

jpsalo added a commit to City-of-Helsinki/outdoors-sports-map that referenced this pull request Jan 29, 2020
jpsalo added a commit to City-of-Helsinki/outdoors-sports-map that referenced this pull request Jan 30, 2020
* Cleanup

* Intermediate webpack update. Development configuration mostly works

* Fixed loading map markers

* Uninstalled unintended packages

* Use Node.js v12 in Docker since upgraded node-sass supports it

* Use react hot loader only in development

* Intermediate webpack production config. All should work

* Minify JavaScript according to webpack v4

* Improved styles' source map generation and minimized styled for production

* Re-added css browsers support

* Updated package.json general information

* Updated readme

* Updated readme

* Update README.md

* Removed unused dependency.
See 62a0769

* Intermediate Babel 7 upgrade with `babel-upgrade` and necessary modifications for development

* Removed unused Babel plugin

* Sorted package.json

* Updated Babel presets. Upgraded deprecated polyfills to core-js

* Removed unnecessary experimental Babel plugins and upgraded remaining

* Upgraded @babel/register

* Upgraded Jest and config

* Setup React-Hot-Loader from Babel config instead of webpack.
See https://github.com/gaearon/react-hot-loader\#getting-started

* Updated readme

* Disabled jest watch for now to be CI compatible

* Updated jest configuration in CI

* package.json auto format

* Bump normalize.css from 5.0.0 to 8.0.1

* Bump lodash from 4.16.4 to 4.17.15

* Bump moment from 2.15.2 to 2.24.0

* Bump date-fns from 1.28.5 to 2.9.0

* Bump react-markdown from 2.4.6 to 4.3.1 and necessary modifications

* Use Airbnb's ESLint config in tandem with (updated) Flow ESLint

* Auto eslint

* Enabled ESLint webpack loader

* Added sensible and necessary local ESLint configuration

* Manually fixed or locally disabled ESLint errors

* Use ESLint with Docker builds

* Manually fixed or locally disabled ESLint errors (run from command line)

* Bump bootstrap from 3.3.7 to 3.4.1. Bump react-bootstrap from 0.30.6 to 0.33.1.
Bump to latest after React 16 upgrade

* Bump normalizr from 2.2.1 to 3.5.0 and necessary modifications

* Bump fetch from 1.0.0 to 3.0.0 and necessary modifications

* Removed unnecessary dependencies.
See a663973 and JakeChampion/fetch#331

* Fixed address bar marker icon.
See 46089f0

* Added FIXME (ULK-66)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants