diff --git a/.eslintrc.json b/.eslintrc.json
index 53642f8ce..1c1b99549 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,5 +1,5 @@
{
- "extends": ["airbnb", "prettier"],
+ "extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"env": {
"browser": true,
@@ -9,7 +9,8 @@
"page": true,
"browser": true,
"context": true,
- "jestPuppeteer": true
+ "jestPuppeteer": true,
+ "axios": "readonly"
},
"rules": {
"prettier/prettier": ["error"],
@@ -17,6 +18,7 @@
"strict": "off",
"no-plusplus": "off",
"linebreak-style": "off",
+ "no-restricted-syntax": "off",
"no-param-reassign": [
"error",
{
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 000000000..469f36b11
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,10 @@
+{
+ "recommendations": [
+ "CoenraadS.bracket-pair-colorizer",
+ "dbaeumer.vscode-eslint",
+ "esbenp.prettier-vscode",
+ "ritwickdey.LiveServer",
+ "streetsidesoftware.code-spell-checker",
+ "techer.open-in-browser"
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index f9ecd22b9..e14914b2e 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -5,7 +5,12 @@
"editor.detectIndentation": false,
"editor.tabSize": 2,
"cSpell.words": [
+ "READYSTATE",
+ "Traversy",
+ "ajaxcrash",
"networkidle",
- "tabindex"
+ "remarcmij",
+ "tabindex",
+ "whiteframe"
]
-}
\ No newline at end of file
+}
diff --git a/README.md b/README.md
index fa97dad57..1cf77c02d 100644
--- a/README.md
+++ b/README.md
@@ -3,13 +3,13 @@ or links, please share them by [opening a pull request](https://github.com/HackY
# HackYourFuture JavaScript 3
-Here you can find course content and homework for the JavaScript3 modules
+Here you can find course content and homework for the JavaScript3 modules.
|Week|Topic|Read|Homework|
|----|-----|----|--------|
-|1.|• Structure for a basic SPA (Single Page Application) • [XMLHttpRequests](../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md) • API calls|[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)|
-|2.|• [Event Loop (order of execution)](../../../fundamentals/blob/master/fundamentals/event_loop.md) • [Promises](../../../fundamentals/blob/master/fundamentals/promises.md)|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|
-|3.|• [try...catch](../../../fundamentals/blob/master/fundamentals/try_catch.md) • [async/await](../../../fundamentals/blob/master/fundamentals/async_await.md) • [The `this` keyword](../../../fundamentals/blob/master/fundamentals/this.md) • call, apply, bind • [Object Oriented Programming and ES6 Classes](../../../fundamentals/blob/master/fundamentals/oop_classes.md)|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|
+|1.|• Structure for a basic SPA (Single Page Application) • AJAX & XMLHttpRequests • API calls|[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)|
+|2.|• Event Loop (order of execution) • Promises|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|
+|3.|• fetch, axios • async/await • try...catch • The `this` keyword • call, apply, bind • Object Oriented Programming and ES6 Classes|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|
__Kind note:__
@@ -18,6 +18,6 @@ We expect you to __always__ come prepared to the class on Sunday.
### Overall
A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](../../../fundamentals/blob/master/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear.
-*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)*
+*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it* :).
This work is licensed under a Creative Commons Attribution 4.0 International License.
diff --git a/Week1/MAKEME.md b/Week1/MAKEME.md
index c09be166f..515032461 100644
--- a/Week1/MAKEME.md
+++ b/Week1/MAKEME.md
@@ -19,14 +19,12 @@ _This homework is more extensive and challenging than previous homework! Please
You are going to write a _Single Page Application_ (SPA) that uses the [GitHub API](https://developer.github.com/guides/getting-started/).
-This application should display information about the available [HYF GitHub repositories](https://github.com/hackyourfuture). The functionalities we would like to see in your application are as follows:
+This application should display information about the available [HYF GitHub repositories](https://github.com/hackyourfuture). The functionalities we would like to see in your application in the first week are as follows:
-- The user should be able to select a repository from a list of available repositories.
-- The application should display high-level information about the selected repository and show a list of its contributors.
-- When clicking on the name of the selected repository the GitHub page for the corresponding repository should be opened in a new browser tab.
-- When clicking on a contributor, the GitHub page for the contributor should be opened in a new browser tab.
+- The application should fetch repository information for the HYF GitHub account and display summary information for each repository.
+- This list of repositories should be sorted alphabetically by repository name.
-Figure 1 below shows an example of what your application could look like. Note that this is just an example. If you find it boring or unimaginative, please improve on it! On the other hand, a simpler version is OK too, so long as you implement the expected functionality.
+Figure 1 below shows an example of what your application could look like.

@@ -48,11 +46,7 @@ If you open this URL in the browser (_try it!_) you will receive JSON data about
The returned JSON data contains some basic information about each repository, such as `name`, `full_name`, `description` etc. There are also many properties that contain URLs that can be used to obtain detail information about certain aspects of the repository.
-#### 1.2.2 Get contributor information for a repository
-
-The JSON data that is returned from the initial request to get repository information includes a property named `contributors_url`. Use the value of this property to fetch a list of contributors.
-
-#### 1.2.3 GitHub API documentation
+#### 1.2.2 GitHub API documentation
You can find detailed information about the GitHub API by means of the link listed below. However, the documentation is very extensive and not easy to digest. For this homework it is not necessary to study the GitHub API documentation. We provide the link here for completeness.
@@ -70,11 +64,11 @@ While you do not need to read this guide in detail, it is recommended that you r
You will be working on the same application during the next three weeks. For each week you will need to create a new Git branch, as listed in the Table 1 below.
-| Week | Branch | Assignment |
-| :--: | ------- | -------------------------------------------------------------------------------------------------------------------------------- |
-| 1 | `week1` | - Create a basic application using callbacks to handle network requests. |
-| 2 | `week2` | Based on the `week1` branch: - Refactor the callbacks to promises. - Make the UI responsive. |
-| 3 | `week3` | Based on the `week2` branch: - Refactor the application to use ES6 Classes and async/await. - Make the app ARIA-compliant. |
+| Week | Branch | Assignment |
+| :--: | ------- | ---------- |
+| 1 | `week1` | - Create a basic application using callbacks to handle network requests. |
+| 2 | `week2` | Based on the `week1` branch: - Display details on a single repository and its contributors - Refactor the callbacks to promises. |
+| 3 | `week3` | Based on the `week2` branch: - Refactor the application to use `fetch` and `async`/`await`. - Reuse portions of the code to complete a provided Object Oriented (OOP) version of the application that uses ES6 classes. |
Table 1. Homework schedule
@@ -83,17 +77,13 @@ You will be working on the same application during the next three weeks. For eac
1. Fork the JavaScript3 repository (_this repository_) to your own GitHub account.
2. Clone the fork to your laptop.
3. Open the newly created `JavaScript3` folder from the cloned repository in VSCode.
-4. Install the following extension in VSCode:
-
- **Prettier - Code formatter**.
-
-5. Open a Terminal window in VSCode and type the following command to install Prettier and ESLint tools as required for the homework:
+4. Open a Terminal window in VSCode and type the following command to install Prettier and ESLint tools as required for the homework:
```
npm install
```
-6. Create a new branch for the week 1 homework with the following command:
+5. Create a new branch for the week 1 homework with the following command:
```
git checkout -b week1
@@ -135,37 +125,23 @@ _**Do not change or delete any files outside of the `homework` folder!**_
| `createAndAppend` | A utility function for easily creating and appending HTML elements. |
| `main` | Contains the start-up code for the application. |
- `index.js` also contains a constant with the URL for the HYF repositories as listed in section 2.2.1:
+ `index.js` also contains a constant with the URL required for fetching information about the HYF repositories:
```js
const HYF_REPOS_URL = 'https://api.github.com/orgs/HackYourFuture/repos?per_page=100';
```
-3. Open the `index.html` file in your browser. Notice that it produces the same JSON output that you saw previously when you opened the URL directly in the browser.
+3. Open the `index.html` file in your browser. You will see an unordered list with the names of the HYF repositories.
-4. Review the `main()` function in `index.js` and examine how this code renders the JSON output in the browser by means of a `pre` HTML element (for demonstration purposes).
+4. Review the `main()` function in `index.js` and examine how this code fetches the JSON data and calls renders the data as unordered list in the web page.
### 1.6 Week 1 Assignment
-The assignment is to produce an application similar to the one illustrated in Figure 1 above.
-
-It should include the following components:
-
-1. An HTML `select` element from which the user can select a HYF repository. This `select` element must be populated with `option` elements, one for each HYF repository.
-2. A left-hand column that displays basic information about the selected repository.
-3. A right-hand column that displays a list of contributors to the repository.
+1. The assignment is to produce an application similar to the one illustrated in Figure 1 above.
- > In case you run out of time, you can also do the contributors list in week 2.
+2. You should render network errors to the DOM (see Figure 2 below for an example). Do not use `console.log` as regular users will not see the console output. Use the predefined `alert-error` class from `style.css` to style your error.
-**Functional Requirements:**
-
-1. The list of repositories in the `select` element should be sorted (case-insensitive) on repository name.
-2. At start-up your application should display information about the first repository as displayed in the `select` element.
-3. When the user changes the selection, the information in the web page should be refreshed for the newly selected repository.
-4. You should be able to click on the repository name of the selected repository to open a new browser tab with the GitHub page for that repository.
-5. You should be able to click on a contributor to open a new browser tab with the GitHub page for that contributor.
-6. You should render network errors to the DOM (see Figure 2 below for an example). Do not use `console.log` as regular users will not see the console output. Use the predefined `alert-error` class from `style.css` to style your error.
-7. Your UI should be responsive. Try it with Chrome Developer Tools in the browser, using a mobile phone format and a tablet format, portrait and landscape. If necessary, you can also do this work in week 2.
+3. Your UI should be responsive. Try it with Chrome Developer Tools in the browser, using a mobile phone format and a tablet format, portrait and landscape. If necessary, you can also do this work in week 2.

@@ -179,19 +155,11 @@ It should include the following components:
**`style.css`**
-- Add your own styling.
-
-**Hints:**
+- Add your own CSS styling. Use `style.css` for all your styling your HTML. Avoid using JavaScript for styling unless there is a genuine need.
-- Add one `option` element per repository to the `select` element, where each `option` element has the array index of the repository as its `value` attribute and the name of the repository as its text content:
+ **You are not allowed to use a CSS library such as Bootstrap.**
- ```html
-
- ```
+**Hints:**
* To sort the list repositories use [`.sort()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) and [`.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
@@ -199,11 +167,12 @@ It should include the following components:
* To force a `404` network error so that you can test the rendering of errors, change the URL to make an invalid GitHub request, e.g. append an `x` to `orgs`: `orgsx`.
+
### 1.7 Handing in your homework
If necessary, review the instructions how to [Hand in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md) using GitHub pull request.
-To test whether your code will be accepted when you submit your homework as a pull request you need to ensure that it does not contain ESLinr errors. Open a terminal window in VSCode and type the following command:
+To test whether your code will be accepted when you submit your homework as a pull request you need to ensure that it does not contain ESLint errors. Open a terminal window in VSCode and type the following command:
```
npm test
diff --git a/Week1/README.md b/Week1/README.md
index 6756bb92d..4e586c32d 100644
--- a/Week1/README.md
+++ b/Week1/README.md
@@ -3,32 +3,73 @@
```
In week one we will discuss the following topics:
• Structure for a basic SPA (Single Page Application)
-• XMLHttpRequests
+• AJAX & XMLHttpRequests
• API calls
```
Here are resources that we like you to read as a preparation for the first lecture:
-### Fundamentals
+## 1. DOM manipulation
-- [XMLHttpRequest](../../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md)
+To refresh your DOM manipulation skills, watch this YouTube video series from Traversy Media:
-### APIs
+- [JavaScript DOM Crash Course](https://youtu.be/0ik6X4DJKCc).
-- Read about APIS: https://www.programmableweb.com/api-university/what-are-apis-and-how-do-they-work
+You will be using these particular DOM manipulation methods and properties in the JS3 homework for the next three weeks:
-### XMLHttpRequests
+#### Course Video Part 1 (39 mins):
+
+- `document.getElementById()`
+- `element.textContent`
+
+#### Course Video Part 2 (21 mins):
+
+- `document.createElement()`
+- `element.setAttribute()`
+- `element.appendChild()`
+
+#### Course Video Part 3 (34 mins):
+
+- `change` event (`