Skip to content

Conversation

@luisdlopez
Copy link
Contributor

Proposed Changes

  • Bug fix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes, no api changes)
  • Build or CI related changes
  • Documentation content changes
  • Other, please describe:

What is the new behaviour?

Complete rewrite of the template, now using react router v7 as a framework.

It includes complete examples of:

  • public routes
  • protected routes (with auth guards at the clientLoader level)
  • a login form that uses clientAction method to handle submission
  • 2 data fetching strategies, both using tanstack query, using suspense query and a combination of promises and await
  • localized routing

Checklist

Please check that your PR fulfills the following requirements:

  • Documentation has been added/updated.

Other information

COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

Copy link

Choose a reason for hiding this comment

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

On en a encore besoin de ça?

Install the dependencies:

```bash
npm install
Copy link

Choose a reason for hiding this comment

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

Est-ce que tu pourrais adapter le readme à Yarn et checker si le docker ne va pas nous générer un package.lock.json? Ou supprimer le ReadMe et a partie docker

"react-refresh": reactRefresh.configs.vite,
},
rules: {
...reactHooks.configs.recommended.rules,
Copy link

Choose a reason for hiding this comment

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

Il y a un réglage ou un plugging vscode qui manque, il n'y a pas de warning quand il manque une dépendance dans les useEffect. C'est un des réglages les plus importants


html,
body {
min-height: 100vh;
Copy link

Choose a reason for hiding this comment

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

Peux-tu utiliser du dvh à la place? Ça règle les problèmes des browser qui ne prennent pas en compte quand le clavier est visible sur mobile

Scripts,
ScrollRestoration,
} from "react-router";
import type { Route } from "./+types/root";
Copy link

Choose a reason for hiding this comment

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

J'ai une erreur ici avec le path, est-ce qu'il y a des réglages manquants pour que ça ne soit pas le cas

);
}

export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Copy link

Choose a reason for hiding this comment

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

Ça gagnerait à être dans son propre component, je pense

.cookie-banner {
width: 100%;
position: fixed;
/* stylelint-disable-next-line custom-property-pattern */
Copy link

Choose a reason for hiding this comment

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

Pas moyen de désactiver le réglage dans eslint au lieu de plouer les css avec ça?

<Link
className="mr-a"
href={t("cookie_consent_link")}
sx={(theme) => ({ marginRight: theme.customProperties.spacing.a })}
Copy link

Choose a reason for hiding this comment

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

C'est pas bon d'utiliser le spacing de mui par multiple de 8 avec theme.spacing(x)?
Je suis encore traumatisée par toutes les variables de Bootstrap où je retenais pas qu'est-ce qui valait quoi, je devais toujours avoir le fichier des variables ouvert :')


Note that the path to the locales in these files is different (`#assets` instead of the expcted `@assets`).
When using react router as a framework, the routes are built via a vite.js plugin, running in node.js (not in the browser).
The alias here is different than the one define in the tsconfig file. This alias comes from the `imports` property in the package.json file.

Choose a reason for hiding this comment

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

Suggested change
The alias here is different than the one define in the tsconfig file. This alias comes from the `imports` property in the package.json file.
The alias here is different than the one defined in the tsconfig file. This alias comes from the `imports` property in the package.json file.

**`On subsequent renders`**, the `useSuspenseQuery` hook will return stale data while fetching any new data.

- **Pros**: The `useSuspenseQuery` hook ensures the component only renders when data is available.
- **Pros**: The `useSuspenseQuery` returns stale data immediately (if available) while new data is fetched.

Choose a reason for hiding this comment

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

Est-ce que c'est vraiment un pro dans toutes les situations ? Est-ce que ce comportement est configurable ?


This ensures that the dashboard route is only accessible to authenticated users.

At the moment, react rouvet v7 does not support middlewares (it is planned though). You have a couple of options as to **where** to use the `clientLoaderAuthGuard`:

Choose a reason for hiding this comment

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

Suggested change
At the moment, react rouvet v7 does not support middlewares (it is planned though). You have a couple of options as to **where** to use the `clientLoaderAuthGuard`:
At the moment, react router v7 does not support middlewares (it is planned though). You have a couple of options as to **where** to use the `clientLoaderAuthGuard`:

"https://docs.google.com/spreadsheets/d/e/2PACX-1vQe6sBfW-7S3xGPlYVaOB8v39yfZHx0FqCOeGEChuWlkObw-F5EsuVag_olya-psWYyKOuCl9y8ZGcf/pub?gid=1136921178&single=true&output=csv",
// Uikit
"https://docs.google.com/spreadsheets/d/e/2PACX-1vQe6sBfW-7S3xGPlYVaOB8v39yfZHx0FqCOeGEChuWlkObw-F5EsuVag_olya-psWYyKOuCl9y8ZGcf/pub?gid=268501364&single=true&output=csv",
// Settings

Choose a reason for hiding this comment

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

Est-ce qu'on a une update par rapport à TI/la sécurité en utilisant google sheet pour la localisation ?

@@ -12,13 +12,14 @@ The goal is to standardize how we build web projects in the company.

Choose a reason for hiding this comment

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

On veut peut-être donner une version spécifique de Yarn à viser. On peut peut-être aussi linker vers la doc qui est dans /frontend/ directement, plutôt que donner une première étape ici mais le reste dans l'autre README


To see the logs directly in your console, you can remove the -d flag. Otherwise, you can view output in Docker Desktop.

## Update locale files

Choose a reason for hiding this comment

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

Je pense qu'on pourrait conserver cette section, ainsi que la section "File structure" en dessous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants