-
Create code anywhere empty box
-
Add nvm
-
Install node 7
-
Add yarn
-
Install yeoman
-
Add https://github.com/MiRinZhang/react-webpack-mobx generator
-
Create new app via Yeoman
-
Update webpack.config (devServer: disableHostCheck: true, open: false -- output: publicPath: <>)
-
Add mobs-react-devtools via yarn
-
In src/components/Todo.jsx add DevTools to imports and tag inside render method
-
yarn dev and validate DevTools working
-
Break dev task temporarily
-
In src/Components/Main Add new link to countries
-
In src/Router/Index add countries to chunks import and add route to countries
-
In src/Router/Chunks add export for countries (duplicate todo and change to countries)
-
Create src/Components/Countries.jsx by duplicating Intro
-
In newly created Countries comment out style import, change className, add DevTools (import + tag), remove info from inside div and create dummy text
-
Yarn dev. Check for errors and validate everything is working OK for new Countries page, including DevTools
-
Break dev task temporarily
-
Duplicate Style/Todo into Countries
-
Edit Style/Countries to only leave input - width: 150px
-
Add countries style to Components/Countries
-
Reactivate dev task
-
In Components/Countries change Dummy text and create an input with placeholder "Search..." and autofocus attr
-
Create first handleKeyDown implementation and add to onKeyDown attr as static
-
Move console.log to new static findCountries method
-
Implement request and log RestResponse.result
-
Create countries store in State by means of duplicating State/Index and implement similarly
-
In Components/Countries import { countries } store and apply assignment into findCountries
-
Add const { countriesList } = countries immediately inside render;
-
Create div and ul template for countries inside render, but outside list
-
Add @observer to class and import proper dependency
-
Create dummy Countries.viewDetails static method logging country
-
Add parsing to JS object into logging and add proper mobs import
-
In State/Countries change class name to CountriesStore, and fix export clause
-
Add @computed get totalCountries property and add computed to imports
-
In Components/Countries add const totalCountries prop assignment and add summary pseudo component based on total countries existence
-
Add styling to list items (.list) and summary (.found) in Style/Countries
-
Generate flag sprites, download to local, and upload images (blank+flags) to new assets folder inside src
-
Install dev copy-webpack-plugin and add to webpack config
-
Fix handling of png files in WDS
-
Update viewDetails function and get the info from web service using request
-
In State/Countries add new observable selectedCountry property to CountriesStore
-
In Components/Countries add inside render method a div with the info of the new property
-
Add selectedCountry property to countries assignment and selectedCountry inside viewDetails
NVM: https://github.com/creationix/nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
Yarn: https://yarnpkg.com curl -o- -L https://yarnpkg.com/install.sh | bash
A react boilerplate with webpack(2.2.1)、React-router(3.0.2)、Mobxjs(3.1.0) and fetch(2.0.2)
npm i -g yo | yarn add global yo npm i -g generator-react-webpack-mobx | yarn add global generator-react-webpack-mobx
yo react-webpack-mobx
cd npm run dev | yarn dev Opens http://localhost:4040
** APIS
-
https://jsonplaceholder.typicode.com/ (Users, Posts, Photos, Albums, Todos) https://github.com/typicode/jsonplaceholder#how-to
-
http://www.geonames.org/export/web-services.html (Country info) http://api.geonames.org/countryInfoJSON?lang=es&country=DE&username=thedull
(Country code by lat, long) http://api.geonames.org/countryCodeJSON?lat=-43.9509&lng=-34.4618&username=thedull
-
http://services.groupkt.com/country/search?text=un (Countries by name)
-
https://www.flag-sprites.com/es/ (Flag sprites)