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/1/en/part1a.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,12 +66,19 @@ The files <i>App.css</i> and <i>index.css</i>, and the directory <i>assets</i> m
66
66
67
67
Instead of Vite you can also use the older generation tool [create-react-app](https://github.com/facebookincubator/create-react-app) in the course to set up the applications. The most visible difference to Vite is the name of the application startup file, which is <i>index.js</i>.
68
68
69
-
The way to start the application is also different, it is started with a command
69
+
The way to start the application is also different in CRA, it is started with a command
70
70
71
71
```
72
72
npm start
73
73
```
74
74
75
+
in contrast to Vite's
76
+
77
+
```
78
+
npm run dev
79
+
```
80
+
81
+
75
82
The course is currently (11 August 2023) being updated to use Vite. Some brands may still use the application base created with create-react-app.
76
83
77
84
### Component
@@ -252,7 +259,9 @@ but when writing JSX, the tag needs to be closed:
252
259
253
260
### Multiple components
254
261
255
-
Let's modify the file <i>App.jsx</i> as follows (NB: export at the bottom is left out in these <i>examples</i>, now and in the future. It is still needed for the code to work):
262
+
Let's modify the file <i>App.jsx</i> as follows:
263
+
264
+
256
265
257
266
```js
258
267
// highlight-start
@@ -292,6 +301,9 @@ const App = () => {
292
301
}
293
302
```
294
303
304
+
**NB**: <em>export</em> at the bottom is left out in these <i>examples</i>, now and in the future. It is still needed for the code to work
305
+
306
+
295
307
Writing components with React is easy, and by combining components, even a more complex application can be kept fairly maintainable. Indeed, a core philosophy of React is composing applications from many specialized reusable components.
296
308
297
309
Another strong convention is the idea of a <i>root component</i> called <i>App</i> at the top of the component tree of the application. Nevertheless, as we will learn in [part 6](/en/part6), there are situations where the component <i>App</i> is not exactly the root, but is wrapped within an appropriate utility component.
@@ -412,7 +424,7 @@ React has been configured to generate quite clear error messages. Despite this,
412
424
413
425
As we already mentioned, when programming with React, it is possible and worthwhile to write <em>console.log()</em> commands (which print to the console) within your code.
414
426
415
-
Also, keep in mind that **React component names must be capitalized**. If you try defining a component as follows:
427
+
Also, keep in mind that **First letter of React component names must be capitalized**. If you try defining a component as follows:
Copy file name to clipboardExpand all lines: src/content/11/en/part11c.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
@@ -252,7 +252,7 @@ Before moving to next exercise, fix your deployment and ensure that the applicat
252
252
253
253
#### 11.12. Custom health check
254
254
255
-
**NOTE:** at the moment the the custom health check feature in Fly.io does not work. You can mark this exercise done without doing anything. A replacement for this exercise will be developed later...
255
+
**NOTE:** at the moment the custom health check feature in Fly.io does not work. You can mark this exercise done without doing anything. A replacement for this exercise will be developed later...
256
256
257
257
Besides TCP and HTTP based health checks, Fly.io allows to use very flexible shell script based health checks. The feature is still undocumented but e.g. [this](https://community.fly.io/t/verifying-services-script-checks-is-supported/1464) shows you how to use it.
Copy file name to clipboardExpand all lines: src/content/13/en/part13a.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -600,7 +600,9 @@ In the tasks of this section, we will build a blog application backend similar t
600
600
601
601
#### Task 13.1.
602
602
603
-
Create a GitHub repository for the application and create a new Heroku or Fly.io application for it, as well as a Postgres database. Make sure you are able to establish a connection to the application database.
603
+
Create a GitHub repository for the application and create a new Fly.io or Heroku application for it, as well as a Postgres database. As mentioned [here](/en/part13/using_relational_databases_with_sequelize#application-database) you might set up your database also somewhere else, and in that case the Fly.io of Heroku app is not needed.
604
+
605
+
Make sure you are able to establish a connection to the application database.
Copy file name to clipboardExpand all lines: src/content/13/fi/osa13a.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
@@ -572,7 +572,7 @@ Teemme tämän osan tehtävissä [osan 4](/osa4) tehtävien kanssa samanlaisen b
572
572
573
573
#### Tehtävä 13.1.
574
574
575
-
Tee sovellukselle GitHub-repositorio ja luo sen sisällä sovellusta varten Heroku-sovellus sekä Postgres-tietokanta. Varmista, että saat luotua yhteyden sovelluksen tietokantaan.
575
+
Tee sovellukselle GitHub-repositorio ja luo sen sisällä sovellusta varten Fly.io tai Heroku-sovellus sekä Postgres-tietokanta. Varmista, että saat luotua yhteyden sovelluksen tietokantaan. Kuten [täällä](/osa13/relaatiotietokannan_kaytto_sequelize_kirjastolla#sovelluksen-tietokanta) mainittiin, voit hoitaa tietokannan myös esim. Dockerin avulla, tällöin et tarvitse Fly.io- tai Heroku-sovellusta.
Copy file name to clipboardExpand all lines: src/content/2/en/part2c.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
@@ -473,7 +473,7 @@ Now we can see more clearly that the function [useEffect](https://react.dev/refe
473
473
474
474
So by default, the effect is <i>always</i> run after the component has been rendered. In our case, however, we only want to execute the effect along with the first render.
475
475
476
-
The second parameter of <em>useEffect</em> is used to [specify how often the effect is run](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect). If the second parameter is an empty array <em>[]</em>, then the effect is only run along with the first render of the component.
476
+
The second parameter of <em>useEffect</em> is used to [specify how often the effect is run]https://react.dev/reference/react/useEffect#parameters). If the second parameter is an empty array <em>[]</em>, then the effect is only run along with the first render of the component.
477
477
478
478
There are many possible use cases for an effect hook other than fetching data from the server. However, this use is sufficient for us, for now.
Copy file name to clipboardExpand all lines: src/content/2/fi/osa2.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
@@ -9,6 +9,6 @@ lang: fi
9
9
Jatkamme Reactiin tutustumista. Ensin käsitellään datakokoelmien, esimerkiksi useamman taulukkoon sijoitetun nimen renderöimistä ruudulle. Tämän jälkeen tarkastellaan miten käyttäjä voi antaa tietoja React-sovellukselle HTML:n lomakkeiden avulla. Sen jälkeen fokus siirtyy siihen, miten selaimessa oleva JavaScript-koodi käsittelee palvelimelle talletettua dataa. Osan lopussa tarkastelemme nopeasti paria yksinkertaista tapaa CSS-tyylien lisäämiseksi React-sovellukseen.
Copy file name to clipboardExpand all lines: src/content/2/fi/osa2c.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
@@ -471,7 +471,7 @@ Nyt huomaamme selvemmin, että funktiolle [useEffect]((https://react.dev/referen
471
471
472
472
Eli oletusarvoisesti efekti suoritetaan <i>aina</i> sen jälkeen, kun komponentti renderöidään. Meidän tapauksessamme haluamme suorittaa efektin vain ensimmäisen renderöinnin yhteydessä.
473
473
474
-
Funktion <em>useEffect</em> toista parametria käytetään [tarkentamaan sitä, miten usein efekti suoritetaan](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect). Jos toisena parametrina on tyhjä taulukko <em>[]</em>, suoritetaan efekti ainoastaan komponentin ensimmäisen renderöinnin jälkeen.
474
+
Funktion <em>useEffect</em> toista parametria käytetään [tarkentamaan sitä, miten usein efekti suoritetaan](https://react.dev/reference/react/useEffect#parameters). Jos toisena parametrina on tyhjä taulukko <em>[]</em>, suoritetaan efekti ainoastaan komponentin ensimmäisen renderöinnin jälkeen.
475
475
476
476
Effect hookien avulla on mahdollisuus tehdä paljon muutakin kuin hakea dataa palvelimelta, mutta tämä riittää meille tässä vaiheessa.
Copy file name to clipboardExpand all lines: src/content/5/en/part5.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
@@ -8,7 +8,7 @@ lang: en
8
8
9
9
In this part we return to the frontend, first looking at different possibilities for testing the React code. We will also implement token based authentication which will enable users to log in to our application.
0 commit comments