Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traduction data.md #8

Merged
merged 9 commits into from
May 27, 2017
Merged

Traduction data.md #8

merged 9 commits into from
May 27, 2017

Conversation

MachinisteWeb
Copy link
Member

@MachinisteWeb MachinisteWeb commented May 19, 2017

C'est le temps de la review !

Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
@MachinisteWeb MachinisteWeb self-assigned this May 19, 2017
@MachinisteWeb MachinisteWeb changed the title Starting translation of data.md Traduction data.md May 19, 2017
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci pour la traduction, voici ma review ^^

en/data.md Outdated

To address this, the fetched data needs to live outside the view components, in a dedicated data store, or a "state container". On the server, we can pre-fetch and fill data into the store before rendering. In addition, we will serialize and inline the state in the HTML. The client-side store can directly pick up the inlined state before we mount the app.
Pour résoudre cela, les données pré-chargées doivent vivre en dehors de la vue du composant, dans un gestionnaire de données, ou dans un « gestionnaire d'état ». Côté serveur, nous pouvons pré-charger et remplir les données dans le gestionnaire de donnée avant le rendu. De plus, nous allons en sérialiser et en injecter l'état dans le HTML. Le gestionnaire de données côté client pourra directement récupérer l'état depuis le HTML avant que l'application ne soit montée.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De plus, nous allons sérialiser et injecter l'état dans le HTML

en/data.md Outdated
@@ -44,7 +44,7 @@ export function createStore () {
}
```

And update `app.js`:
et mettons à jour `app.js`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Et

en/data.md Outdated

So, where do we place the code that dispatches the data-fetching actions?
Donc, ou devons nous appeler le code en charge de l'action de pré-chargement ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en/data.md Outdated

The data we need to fetch is determined by the route visited - which also determines what components are rendered. In fact, the data needed for a given route is also the data needed by the components rendered at that route. So it would be natural to place the data fetching logic inside route components.
Les données que nous avons besoin de pré-charger sont déterminées par la route visitée, qui va aussi déterminée quel composant va être rendu. En fait, les données nécessaire a une route donnée sont aussi les données nécessaire au composant pour être rendu pour une route. Aussi il serait naturel de placer la logique de pré-chargement à l'intérieur des composants de route.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

va aussi déterminer

données nécessaires

données nécessaires

en/data.md Outdated

In `entry-server.js` we can get the components matched by a route with `router.getMatchedComponents()`, and call `asyncData` if the component exposes it. Then we need to attach resolved state to the render context.
Dans `entry-server.js` nous pouvons obtenir des composants qu'ils concordent avec une route grâce à `router.getMatchedComponents()`, et appeler `asyncData` si le composant l'expose. Nous avons ensuite besoin d'attacher l'état résolue au contexte de rendu.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

des composants qui concordent

l'état résolu

en/data.md Outdated
@@ -125,7 +125,7 @@ export default context => {
reject({ code: 404 })
}

// call asyncData() on all matched route components
// appeler `asyncData()` sur toutes les routes concordant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

les routes concordantes

en/data.md Outdated
// When we attach the state to the context, and the `template` option
// is used for the renderer, the state will automatically be
// serialized and injected into the HTML as window.__INITIAL_STATE__.
// Après que chaque hook de pré-chargement soit résolue, notre store est maintenant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soit résolu

en/data.md Outdated
// rempli avec l'état nécessaire au rendu de l'application.
// Quand nous attachons l'état au contexte, et que l'option `template`
// est utilisée pour faire le rendu, l'état va automatiquement être
// sérialisé et injecté dans le HTML pour alimenter window.__INITIAL_STATE__.
Copy link
Member

@Kocal Kocal May 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

être sérialisé et injecté dans le HTML en tant que window.__INITIAL_STATE__.

n'était pas bon ?

Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trompé, j'ai commenté au lieu de demandé des changements..

# Conflicts:
#	en/structure.md

Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
# Conflicts:
#	en/data.md

Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
@MachinisteWeb
Copy link
Member Author

MachinisteWeb commented May 27, 2017

J'ai refait une relecture ici.

Merci beaucoup @Kocal pour tes points !

Il me reste un doute pour « jeu de logique », c'est bien de cela dont il est question ?

@Kocal
Copy link
Member

Kocal commented May 27, 2017

Pas de problème :)

Mmmh, pour some mocked logic, j'ai vu que mock pouvait se traduire en simulacre, et qui correspond plutôt bien à une utilisation en informatique.

Cependant, je ne vois pas trop pourquoi some mocked logic a été utilisé, peut-être pour la fonction fetchItem du fichier api.js (import { fetchItem } from './api') ?

Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
@MachinisteWeb MachinisteWeb merged commit aa46e2c into vuejs-fr:working May 27, 2017
@MachinisteWeb MachinisteWeb deleted the data branch May 27, 2017 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants