Skip to content

Commit c9d607d

Browse files
committed
Merge branch 'source' into update-typescript-spanish
2 parents 52a3ea8 + 1c23770 commit c9d607d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+752
-2753
lines changed

license.txt

Lines changed: 359 additions & 0 deletions
Large diffs are not rendered by default.

src/content/0/en/part0a.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The course contains fourteen parts, the first of which is numbered 0 for consist
3737

3838
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.
3939

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.
4141

4242
The speed of completing the course is flexible.
4343

@@ -198,7 +198,7 @@ The exercises are submitted through GitHub and marking them as done on the "my s
198198
199199
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.
200200
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.
202202
203203
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.
204204
@@ -340,7 +340,7 @@ Despite changes <i>all the submitted exercises remain valid</i>, and the course
340340
341341
Recent major changes
342342
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
344344
345345
### Expanding on a previously completed course
346346

src/content/0/es/part0a.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Una vez que haya completado suficientes ejercicios para aprobar, puede descargar
5757

5858
#### 3 créditos
5959

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.
6161

6262
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.
6363

src/content/0/es/part0b.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ xhttp.onreadystatechange = function() {
279279
280280
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>.
281281
282-
### Modelo de Objeto de Documento o DOM
282+
### Modelo de Objetos del Documento o DOM
283283
284284
Podemos pensar en las páginas HTML como estructuras de árbol implícitas.
285285
@@ -464,7 +464,7 @@ Los datos se envían como el [cuerpo](https://developer.mozilla.org/en-US/docs/W
464464
465465
El servidor puede acceder a los datos accediendo al campo <em>req.body</em> del objeto de solicitud <em>req</em>.
466466
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>.
468468
469469
```js
470470
notes.push({
@@ -552,9 +552,9 @@ form.onsubmit = function(e) {
552552
}
553553
```
554554
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.
556556
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.
558558
559559
El código para enviar la nota al servidor es el siguiente:
560560
@@ -571,7 +571,7 @@ var sendToServer = function(note) {
571571
}
572572
```
573573
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.
575575
576576
El código de la aplicación está disponible en <https://github.com/mluukkai/example_app>.
577577
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
599599
600600
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.
601601
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.
603603
604604
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.
605605

src/content/0/fi/osa0a.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Kurssilla ei ole enää vuosittaisia versiota. Kurssi on siis käynnissä koko a
282282
Muutoksista huolimatta <i>kaikki jo tehdyt palautukset säilyvät voimassa</i>, eli voit jatkaa kurssia päivityksistä huolimatta normaaliin tapaan.
283283

284284
Viimeaikaisia isompia muutoksia
285-
- Osat 1-7 (11-26.8.2023): Create React app korvattu Vitellä
285+
- Osat 1-9 (11.9-5.10.2023): Create React app korvattu Vitellä
286286

287287
### Aiemmin suoritetun kurssin täydentäminen
288288

src/content/1/en/part1a.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The easiest way to get started by far is by using a tool called
1515
Let's create an application called <i>part1</i>, navigate to its directory and install the libraries:
1616

1717
```bash
18-
npm create vite@latest part1 -- --template react
18+
npm create vite@latest part1 --template react
1919
cd part1
2020
npm install
2121
```
@@ -407,7 +407,7 @@ module.exports = {
407407
'warn',
408408
{ allowConstantExport: true },
409409
],
410-
'react/prop-types': false // highlight-line
410+
'react/prop-types': 0 // highlight-line
411411
},
412412
}
413413
```

src/content/1/en/part1b.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ JavaScript has advanced rapidly in the last few years and in this course, we use
1313

1414
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.
1515

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.
1717

1818
[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.
1919

@@ -61,7 +61,7 @@ console.log(t.length) // 4 is printed
6161
console.log(t[1]) // -1 is printed
6262

6363
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
6565
})
6666
```
6767

src/content/1/fi/osa1a.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Konsoli kertoo että sovellus on käynnistynyt localhostin porttiin 5173, eli os
2929

3030
![](../../images/1/1-vite1.png)
3131

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.
3333

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:
3535

3636
![](../../images/1/1-vite4.png)
3737

@@ -72,7 +72,7 @@ Kurssia ollaan tällä hetkellä (11.8.2023) päivittämässä käyttämään Vi
7272

7373
### Komponentti
7474

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
7676

7777
```js
7878
ReactDOM.createRoot(document.getElementById('root')).render(<App />)
@@ -624,7 +624,7 @@ code .
624624

625625
<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>
626626

627-
Luo Vitellä uusi sovellus. Muuta <i>main.jsc</i> muotoon
627+
Luo Vitellä uusi sovellus. Muuta <i>main.jsx</i> muotoon
628628

629629
```js
630630
import ReactDOM from 'react-dom/client'

src/content/10/en/part10b.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Now that we have set up our development environment we can get into React Native
1111

1212
### Core components
1313

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:
1515

1616
```javascript
1717
const HelloWorld = props => {
@@ -575,7 +575,7 @@ const Main = () => {
575575
<AppBar />
576576
// highlight-start
577577
<Routes>
578-
<Route path="/" element={<RepositoryList />} exact />
578+
<Route path="/" element={<RepositoryList />} />
579579
<Route path="*" element={<Navigate to="/" replace />} />
580580
</Routes>
581581
// highlight-end

src/content/10/en/part10c.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ npm install @apollo/client graphql
180180
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:
181181

182182
```shell
183-
npm install @expo/metro-config
183+
npm install @expo/metro-config@0.4.0
184184
```
185185

186186
Then, we can add the following configuration to a <i>metro.config.js</i> in the root directory of our project:
@@ -699,7 +699,7 @@ export default createApolloClient;
699699

700700
### Using React Context for dependency injection
701701

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://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:
703703

704704
```javascript
705705
import { createContext } from 'react';
@@ -738,7 +738,7 @@ const App = () => {
738738
export default App;
739739
```
740740

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:
742742

743743
```javascript
744744
// ...
@@ -752,7 +752,7 @@ const useSignIn = () => {
752752
};
753753
```
754754

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.
756756

757757
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:
758758

@@ -781,7 +781,7 @@ const useSignIn = () => {
781781

782782
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.
783783

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.
785785

786786
</div>
787787

0 commit comments

Comments
 (0)