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
Copy file name to clipboardExpand all lines: src/content/0/en/part0a.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ The course contains fourteen parts, the first of which is numbered 0 for consist
37
37
38
38
Proceeding from part <i>n</i> to part <i>n+1</i> is not sensible before enough know-how of the topics in part <i>n</i> has been achieved. In pedagogic terms, the course uses [Mastery Learning](https://en.wikipedia.org/wiki/Mastery_learning), and you are only intended to proceed to the next part after doing enough of the exercises of the previous part.
39
39
40
-
In parts 1-4 you are expected to do <i>at least</i> all of the exercises that are not marked with an asterisk(*). Exercises marked with an asterisk count towards your final grade, but skipping them does not prevent you from doing the compulsory exercises in the next parts. Parts 5-13 do not have asterisk marked exercises since there is no similar dependency on previous parts.
40
+
In parts 1-4 you are expected to do <strong>all</strong> of the exercises that are marked with an asterisk(*). Exercises marked with an asterisk count towards your final grade, but skipping them does not prevent you from doing the compulsory exercises in the next parts. Parts 5-13 do not have asterisk marked exercises since there is no similar dependency on previous parts.
41
41
42
42
The speed of completing the course is flexible.
43
43
@@ -198,7 +198,7 @@ The exercises are submitted through GitHub and marking them as done on the "my s
198
198
199
199
If you are submitting exercises from different parts to the same repository, use an appropriate system for naming your directories. You can of course create a new repository for each part. If you are using a private repository, add <i>mluukkai</i> as a collaborator.
200
200
201
-
Exercises are submitted **one part at a time**. Once you have submitted exercises for a part, you can no longer submit any more exercises for that part.
201
+
Exercises are submitted **one part at a time**. You will mark the number of exercises you have completed from that module. Once you have submitted exercises for a part, you can no longer submit any more exercises for that part.
202
202
203
203
A system for detecting plagiarism is used to check exercises submitted to GitHub. If code is found from model answers or multiple students hand in the same code, the situation is handled according to the [policy on plagiarism](https://guide.student.helsinki.fi/en/article/what-cheating-and-plagiarism) of the University of Helsinki.
204
204
@@ -340,7 +340,7 @@ Despite changes <i>all the submitted exercises remain valid</i>, and the course
340
340
341
341
Recent major changes
342
342
343
-
- Parts 1-7 (11th-26th August): Create React app replaced with Vite
343
+
- Parts 1-9 (11th September - 5th October): Create React app replaced with Vite
Copy file name to clipboardExpand all lines: src/content/0/es/part0a.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
@@ -57,7 +57,7 @@ Una vez que haya completado suficientes ejercicios para aprobar, puede descargar
57
57
58
58
#### 3 créditos
59
59
60
-
Para tres créditos, debe enviar todos los ejercicios obligatorios (sin asteriscos) para las partes 0-3.
60
+
Para tres créditos, debe enviar todos los ejercicios obligatorios (con asteriscos) para las partes 0-3.
61
61
62
62
Para los créditos universitarios, el curso de tres créditos también requiere aprobar el examen del curso. El examen se realiza en Moodle, al que se puede acceder a través de la [página del curso de Open University](https://courses.helsinki.fi/en/aytkt21009en/131840261) una vez que se haya [registrado](/es/part0/informacion_general#registrate-para-el-examen) para el examen.
El mecanismo de invocación de controladores de eventos es muy común en JavaScript. Las funciones del controlador de eventos se denominan funciones [callback](https://developer.mozilla.org/en-US/docs/Glossary/Callback_function). El código de la aplicación no invoca las funciones en sí, sino el entorno de ejecución -el navegador-, invoca la función en el momento adecuado, cuando se ha producido el <i>evento</i>.
281
281
282
-
### Modelo de Objeto de Documento o DOM
282
+
### Modelo de Objetos del Documento o DOM
283
283
284
284
Podemos pensar en las páginas HTML como estructuras de árbol implícitas.
285
285
@@ -464,7 +464,7 @@ Los datos se envían como el [cuerpo](https://developer.mozilla.org/en-US/docs/W
464
464
465
465
El servidor puede acceder a los datos accediendo al campo <em>req.body</em> del objeto de solicitud <em>req</em>.
466
466
467
-
El servidor crea un nuevo objeto de nota y lo agrega a una matriz llamada <em>notes</em>.
467
+
El servidor crea un nuevo objeto de nota y lo agrega a un arreglo llamado <em>notes</em>.
468
468
469
469
```js
470
470
notes.push({
@@ -552,9 +552,9 @@ form.onsubmit = function(e) {
552
552
}
553
553
```
554
554
555
-
El comando <em>document.getElementById('notes_form')</em> le indica al código que busque el elemento form de la página, y para registrar un <i>controlador de eventos</i> para manejar el evento de envío del formulario. El controlador de eventos llama inmediatamente al método <em>e.preventDefault()</em> para evitar el manejo predeterminado del envío de formularios. El método predeterminado enviaría los datos al servidor y provocaría una nueva solicitud GET, lo que no queremos que suceda.
555
+
El comando <em>document.getElementById('notes_form')</em> le indica al código que obtenga el elemento form de la página y que registre un <i>event handler</i> para manejar el evento de envío del formulario. El controlador de eventos llama inmediatamente al método <em>e.preventDefault()</em> para evitar el manejo por defecto del envío de formularios. El método por defecto enviaría los datos al servidor y causaría una nueva solicitud GET, lo cual no queremos que suceda.
556
556
557
-
Luego, el controlador de eventos crea una nueva nota, la agrega a la lista de notas con el comando <em>notes.push(note)</em>, vuelve a representar la lista de notas en la página y envía la nueva nota al servidor.
557
+
Luego el controlador de eventos crea una nueva nota, la agrega a la lista de notas con el comando <em>notes.push(note)</em>, vuelve a renderizar la lista de notas en la página y envía la nueva nota al servidor.
558
558
559
559
El código para enviar la nota al servidor es el siguiente:
560
560
@@ -571,7 +571,7 @@ var sendToServer = function(note) {
571
571
}
572
572
```
573
573
574
-
El código determina que los datos se enviarán con una solicitud HTTP POST y el tipo de datos será JSON. El tipo de datos se determina con una cabecera <i>Content-type</i>. Luego, los datos se envían como JSON-string.
574
+
El código determina que los datos se enviarán con una solicitud HTTP POST y el tipo de datos será JSON. El tipo de datos se determina con una cabecera <i>Content-type</i>. Luego los datos se envían como JSON-string.
575
575
576
576
El código de la aplicación está disponible en <https://github.com/mluukkai/example_app>.
577
577
Vale la pena recordar que la aplicación solo está destinada a demostrar los conceptos del curso. El código sigue un estilo de desarrollo deficiente en cierta medida y no debe usarse como ejemplo al crear sus propias aplicaciones. Lo mismo ocurre con las URL utilizadas. La URL <i>new_note_spa</i>, a la que se envían las nuevas notas, no cumple con las mejores prácticas actuales.
@@ -599,7 +599,7 @@ El estado de React parece sólido, pero el mundo de JavaScript cambia constantem
599
599
600
600
Prácticamente todas las aplicaciones web tienen (al menos) dos "capas": el navegador, al estar más cerca del usuario final, es la capa superior y el servidor, la inferior. A menudo también hay una capa de base de datos debajo del servidor. Por lo tanto, podemos pensar en la <i>arquitectura</i> de una aplicación web como una especie de <i>stack (pila)</i> de capas.
601
601
602
-
A menudo, también hablamos sobre el [frontend](https://en.wikipedia.org/wiki/Front_and_back_ends) y el [backend](https://en.wikipedia.org/wiki/Front_and_back_ends). El navegador es la interfaz y JavaScript que se ejecuta en el navegador es el código de la interfaz. El servidor, por otro lado, es el backend.
602
+
A menudo, también hablamos sobre el [frontend](https://en.wikipedia.org/wiki/Front_and_back_ends) y el [backend](https://en.wikipedia.org/wiki/Front_and_back_ends). El navegador es la interfaz y JavaScript que se ejecuta en el navegador es el código de frontend. El servidor, por otro lado, es el backend.
603
603
604
604
En el contexto de este curso, el desarrollo web full stack significa que nos enfocamos en todas las partes de la aplicación: el frontend, el backend y la base de datos. A veces, el software del servidor y su sistema operativo se ven como parte del stack, pero no vamos a entrar en ellos.
Copy file name to clipboardExpand all lines: src/content/1/en/part1b.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ JavaScript has advanced rapidly in the last few years and in this course, we use
13
13
14
14
Browsers do not yet support all of JavaScript's newest features. Due to this fact, a lot of code run in browsers has been <i>transpiled</i> from a newer version of JavaScript to an older, more compatible version.
15
15
16
-
Today, the most popular way to do transpiling is by using [Babel](https://babeljs.io/). Transpilation is automatically configured in React applications created with create-react-app. We will take a closer look at the configuration of the transpilation in [part 7](/en/part7) of this course.
16
+
Today, the most popular way to do transpiling is by using [Babel](https://babeljs.io/). Transpilation is automatically configured in React applications created with vite. We will take a closer look at the configuration of the transpilation in [part 7](/en/part7) of this course.
17
17
18
18
[Node.js](https://nodejs.org/en/) is a JavaScript runtime environment based on Google's [Chrome V8](https://developers.google.com/v8/) JavaScript engine and works practically anywhere - from servers to mobile phones. Let's practice writing some JavaScript using Node. The latest versions of Node already understand the latest versions of JavaScript, so the code does not need to be transpiled.
19
19
@@ -61,7 +61,7 @@ console.log(t.length) // 4 is printed
61
61
console.log(t[1]) // -1 is printed
62
62
63
63
t.forEach(value=> {
64
-
console.log(value) // numbers 1, -1, 3, 5 are printed, each to own line
64
+
console.log(value) // numbers 1, -1, 3, 5 are printed, each on its own line
Copy file name to clipboardExpand all lines: src/content/1/fi/osa1a.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,9 @@ Konsoli kertoo että sovellus on käynnistynyt localhostin porttiin 5173, eli os
29
29
30
30

31
31
32
-
Vite käynnistää sovelluksen [oletusarvoisesti](https://vitejs.dev/config/server-options.html#server-port) porttiin 5173. Jos se ei ole vapaana, käyttä Vite seuraavaa vapaata porttinumeroa.
32
+
Vite käynnistää sovelluksen [oletusarvoisesti](https://vitejs.dev/config/server-options.html#server-port) porttiin 5173. Jos se ei ole vapaana, käyttää Vite seuraavaa vapaata porttinumeroa.
33
33
34
-
Avataan selan sekä tekstieditori siten, että näet koodin ja web-sivun samaan aikaan ruudulla:
34
+
Avataan selain sekä tekstieditori siten, että näet koodin ja web-sivun samaan aikaan ruudulla:
35
35
36
36

37
37
@@ -72,7 +72,7 @@ Kurssia ollaan tällä hetkellä (11.8.2023) päivittämässä käyttämään Vi
72
72
73
73
### Komponentti
74
74
75
-
Tiedosto <i>App.js</i> määrittelee nyt React-[komponentin](https://react.dev/learn/your-first-component) nimeltään <i>App</i>. Tiedoston <i>main.jsx</i> viimeisen rivin komento
75
+
Tiedosto <i>App.jsx</i> määrittelee nyt React-[komponentin](https://react.dev/learn/your-first-component) nimeltään <i>App</i>. Tiedoston <i>main.jsx</i> viimeisen rivin komento
<i>Tässä tehtävässä aloitettavaa ohjelmaa kehitellään eteenpäin muutamassa seuraavassa tehtävässä. Tässä ja kurssin aikana muissakin vastaan tulevissa tehtäväsarjoissa ohjelman lopullisen version palauttaminen riittää. Voit toki halutessasi tehdä commitin jokaisen tehtävän jälkeisestä tilanteesta, mutta se ei ole välttämätöntä.</i>
626
626
627
-
Luo Vitellä uusi sovellus. Muuta <i>main.jsc</i> muotoon
627
+
Luo Vitellä uusi sovellus. Muuta <i>main.jsx</i> muotoon
Copy file name to clipboardExpand all lines: src/content/10/en/part10b.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Now that we have set up our development environment we can get into React Native
11
11
12
12
### Core components
13
13
14
-
In the previous parts, we have learned that we can use React to define components as functions, which receive props as an argument and returns a tree of React elements. This tree is usually represented with JSX syntax. In the browser environment, we have used the [ReactDOM](https://reactjs.org/docs/react-dom.html) library to turn these components into a DOM tree that can be rendered by a browser. Here is a concrete example of a very simple component:
14
+
In the previous parts, we have learned that we can use React to define components as functions, which receive props as an argument and returns a tree of React elements. This tree is usually represented with JSX syntax. In the browser environment, we have used the [ReactDOM](https://react.dev/reference/react-dom) library to turn these components into a DOM tree that can be rendered by a browser. Here is a concrete example of a very simple component:
Before we can start using Apollo Client, we will need to slightly configure the Metro bundler so that it handles the <i>.cjs</i> file extensions used by the Apollo Client. First, let's install the <i>@expo/metro-config</i> package which has the default Metro configuration:
181
181
182
182
```shell
183
-
npm install @expo/metro-config
183
+
npm install @expo/metro-config@0.4.0
184
184
```
185
185
186
186
Then, we can add the following configuration to a <i>metro.config.js</i> in the root directory of our project:
The last piece of the sign-in puzzle is to integrate the storage to the <em>useSignIn</em> hook. To achieve this the hook must be able to access token storage instance we have initialized in the <em>App</em> component. React [Context](https://reactjs.org/docs/context.html) is just the tool we need for the job. Create a directory <i>contexts</i> in the <i>src</i> directory. In that directory create a file <i>AuthStorageContext.js</i> with the following content:
702
+
The last piece of the sign-in puzzle is to integrate the storage to the <em>useSignIn</em> hook. To achieve this the hook must be able to access token storage instance we have initialized in the <em>App</em> component. React [Context](https://react.dev/learn/passing-data-deeply-with-context) is just the tool we need for the job. Create a directory <i>contexts</i> in the <i>src</i> directory. In that directory create a file <i>AuthStorageContext.js</i> with the following content:
703
703
704
704
```javascript
705
705
import { createContext } from'react';
@@ -738,7 +738,7 @@ const App = () => {
738
738
exportdefaultApp;
739
739
```
740
740
741
-
Accessing the storage instance in the <em>useSignIn</em> hook is now possible using the React's [useContext](https://reactjs.org/docs/hooks-reference.html#usecontext) hook like this:
741
+
Accessing the storage instance in the <em>useSignIn</em> hook is now possible using the React's [useContext](https://react.dev/reference/react/useContext) hook like this:
742
742
743
743
```javascript
744
744
// ...
@@ -752,7 +752,7 @@ const useSignIn = () => {
752
752
};
753
753
```
754
754
755
-
Note that accessing a context's value using the <em>useContext</em> hook only works if the <em>useContext</em> hook is used in a component that is a <i>descendant</i> of the [Context.Provider](https://reactjs.org/docs/context.html#contextprovider) component.
755
+
Note that accessing a context's value using the <em>useContext</em> hook only works if the <em>useContext</em> hook is used in a component that is a <i>descendant</i> of the [Context.Provider](https://react.dev/reference/react/createContext#provider) component.
756
756
757
757
Accessing the <em>AuthStorage</em> instance with <em>useContext(AuthStorageContext)</em> is quite verbose and reveals the details of the implementation. Let's improve this by implementing a <em>useAuthStorage</em> hook in a <i>useAuthStorage.js</i> file in the <i>hooks</i> directory:
758
758
@@ -781,7 +781,7 @@ const useSignIn = () => {
781
781
782
782
The ability to provide data to component's descendants opens tons of use cases for React Context, as we already saw in the [last chapter](/en/part6/react_query_use_reducer_and_the_context) of part 6.
783
783
784
-
To learn more about these use cases, read Kent C. Dodds' enlightening article [How to use React Context effectively](https://kentcdodds.com/blog/how-to-use-react-context-effectively) to find out how to combine the [useReducer](https://reactjs.org/docs/hooks-reference.html#usereducer) hook with the context to implement state management. You might find a way to use this knowledge in the upcoming exercises.
784
+
To learn more about these use cases, read Kent C. Dodds' enlightening article [How to use React Context effectively](https://kentcdodds.com/blog/how-to-use-react-context-effectively) to find out how to combine the [useReducer](https://react.dev/reference/react/useReducer) hook with the context to implement state management. You might find a way to use this knowledge in the upcoming exercises.
0 commit comments