You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although you should only modify files in the `homework` folder, we recommend that you always open the `JavaScript3` folder rather than directly opening the `homework` folder in VSCode. The `JavaScript3` folder contains the actual git repository and the configuration files required by the installed tools.
125
114
@@ -175,7 +164,7 @@ It should include the following components:
175
164
3. When the user changes the selection, the information in the web page should be refreshed for the newly selected repository.
176
165
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.
177
166
5. You should be able to click on a contributor to open a new browser tab with the GitHub page for that contributor.
178
-
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.
167
+
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.
179
168
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.
Copy file name to clipboardExpand all lines: Week2/MAKEME.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The homework for week 2 will build on the work you did in week 1. You will creat
43
43
You will continue to work on the files `index.js` and (possibly) `style.css`.
44
44
45
45
- Complete your GitHub app code from the previous week, if needed, to meet the requirements from that week's assignment.
46
-
- Replace all asynchronous callbacks (e.g. as used with XMLHttpRequest) by ES6 promises.
46
+
- Replace all asynchronous callbacks (e.g. as used with `XMLHttpRequest`) by ES6 promises.
47
47
- Beautify your app's styling.
48
48
- If not yet completed in week 1, make your app responsive (use CSS media queries and [Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)).
Copy file name to clipboardExpand all lines: Week3/MAKEME.md
+24-15Lines changed: 24 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,33 +37,42 @@ The homework for week 3 will build on the work you did in week 2. You will creat
37
37
38
38
This week you will work with all JavaScript files in the `src` folder. The assignment consists of two parts:
39
39
40
-
1. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
41
-
2. Make your app ARIA-compliant (see below).
42
-
3. Refactor your application to use ES6 classes.
40
+
1. Replace `XMLHttpRequest` with the `fetch` API.
41
+
2. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
42
+
3. Make your app ARIA-compliant (see below).
43
+
4. Refactor your application to use ES6 classes.
44
+
45
+
#### 2.2.1 Replace XMLHttpRequest with fetch
46
+
47
+
Replace `XMLHttpRequest` in the `fetchJSON` function with `fetch`. Because `fetch` returns a promise out of the box there is no need create a promise yourself with `new Promise(...)`.
43
48
44
-
#### 2.2.1 async/await
49
+
> `fetch` does not throw an error for HTTP errors. Review the documentation for [`response.ok`](https://developer.mozilla.org/en-US/docs/Web/API/Response/ok) for a clue how detect HTTP errors.
50
+
51
+
#### 2.2.2 async/await
45
52
46
53
**Instructions:**
47
54
48
55
1. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
49
56
50
57
2. Make sure that your error handling code still works. See the week2 MAKEME on how to force an error response from GitHub.
51
58
52
-
#### 2.2.2 ES6 Classes
59
+
#### 2.2.3 ES6 Classes
53
60
54
61
**_Deadline Saturday_**
55
62
56
63
This final assignment requires you to go the extra mile and master Object Oriented Programming and ES6 classes.
57
64
65
+
> The files to be modified are in the **homework-classes** folder.
66
+
58
67
In this assignment you need to redistribute and adapt the code from `index.js` to the files `App.js`, `Repository.js` and `Contributor.js`. You do not need to modify `Util.js`.
|`index2.html`| You should load this HTML file in your browser instead of `index.html` to work with the classes version of your homework. It loads the following JavaScript files through `<script>` tags in the `<body>` element:|
63
-
|`App.js`| The `App` class contains the start-up code and manages the overall orchestration of the app. |
64
-
|`Repository.js`| The `Repository` class holds code and data for a single repository. |
65
-
|`Contributor.js`| The `Contributor` class holds code and data for a single contributor. |
66
-
|`Util.js`| The `Util` class contains static helper methods for use in the other classes. |
|`App.js`| The `App` class contains the start-up code and manages the overall orchestration of the app. |
73
+
|`Repository.js`| The `Repository` class holds code and data for a single repository. |
74
+
|`Contributor.js`| The `Contributor` class holds code and data for a single contributor. |
75
+
|`Util.js`| The `Util` class contains static helper methods for use in the other classes. |
67
76
68
77
The `App.js`, `Repository.js` and `Contributor.js` files each contain skeleton code that you can use to migrate portions of your code from `index.js` to.
- More on ES6 classes: [ES6 Classes in Depth](https://ponyfoo.com/articles/es6-classes-in-depth)
74
83
75
-
#### 2.2.3 ARIA-compliance (BONUS)
84
+
#### 2.2.4 ARIA-compliance (BONUS)
76
85
77
86
Please review the material from the HTML/CSS module: [Get familiar with Accessible Rich Internet Applications (ARIA)](https://github.com/HackYourFuture/HTML-CSS/tree/master/Week1#get-familiar-with-accessible-rich-internet-applications-aria).
78
87
79
88
For the GitHub application ARIA-compliance means that the Contributors list should either be a native HTML list (i.e. using `ul` and `li` elements) or otherwise marked with an appropriate ARIA **role**. Furthermore, a user should be able to navigate through all interactive elements using the keyboard (e.g., using the **Tab** key). Pressing **Enter** on such an element should be equivalent to clicking the mouse.
80
89
81
-
#### 2.2.4 Handing in your homework
90
+
#### 2.2.5 Handing in your homework
82
91
83
92
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.
84
93
85
-
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:
94
+
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:
0 commit comments