feat: migration Next.js 15.2.4 -> 16.1.6
- Mise à jour de Next.js vers 16.1.6 (dernière version stable) - Mise à jour de eslint-config-next vers 16.1.6 - Ajout documentation migration-nextjs-16.md Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
89
docs/app/migration-nextjs-16.md
Normal file
89
docs/app/migration-nextjs-16.md
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Migration vers Next.js 16.1.6
|
||||||
|
|
||||||
|
## Résumé des changements
|
||||||
|
|
||||||
|
Migration de Next.js de la version **15.2.4** vers **16.1.6** (dernière version stable).
|
||||||
|
|
||||||
|
## Modifications apportées
|
||||||
|
|
||||||
|
### Dépendances mises à jour
|
||||||
|
|
||||||
|
- **next** : `15.2.4` → `16.1.6`
|
||||||
|
- **eslint-config-next** : `15.2.4` → `16.1.6`
|
||||||
|
|
||||||
|
### Dépendances conservées (compatibles)
|
||||||
|
|
||||||
|
- **react** : `^19` (déjà à jour, compatible avec Next.js 16)
|
||||||
|
- **react-dom** : `^19` (déjà à jour, compatible avec Next.js 16)
|
||||||
|
- **@types/react** : `^19` (compatible)
|
||||||
|
- **@types/react-dom** : `^19` (compatible)
|
||||||
|
- **typescript** : `^5` (compatible, minimum requis 5.1.0)
|
||||||
|
|
||||||
|
## Changements dans Next.js 16
|
||||||
|
|
||||||
|
### Exigences système
|
||||||
|
|
||||||
|
- **Node.js** : Minimum 20.9.0 (déjà utilisé dans Dockerfile avec Node 20)
|
||||||
|
- **TypeScript** : Minimum 5.1.0 (déjà satisfait avec TypeScript 5)
|
||||||
|
- **Browsers** : Chrome 111+, Edge 111+, Firefox 111+, Safari 16.4+
|
||||||
|
|
||||||
|
### Turbopack par défaut
|
||||||
|
|
||||||
|
- Turbopack est maintenant stable et utilisé par défaut pour `next dev` et `next build`
|
||||||
|
- Plus besoin du flag `--turbopack` dans les scripts
|
||||||
|
- Si vous utilisez une configuration webpack personnalisée, les builds échoueront par défaut
|
||||||
|
- Solution : migrer vers Turbopack ou utiliser `next build --webpack` pour désactiver
|
||||||
|
|
||||||
|
### Configuration actuelle
|
||||||
|
|
||||||
|
Le fichier `radar-app/next.config.js` actuel est compatible avec Next.js 16 :
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const nextConfig = {
|
||||||
|
basePath,
|
||||||
|
output: "export",
|
||||||
|
trailingSlash: true,
|
||||||
|
reactStrictMode: true,
|
||||||
|
experimental: {
|
||||||
|
scrollRestoration: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note** : L'option `experimental.scrollRestoration` pourrait être dépréciée dans Next.js 16, mais ne devrait pas causer d'erreur.
|
||||||
|
|
||||||
|
## Tests à effectuer
|
||||||
|
|
||||||
|
1. ✅ Build Docker : Vérifier que le build fonctionne avec la nouvelle version
|
||||||
|
2. ✅ Serveur de développement : Tester `npm run serve-dev`
|
||||||
|
3. ✅ Build de production : Tester `npm run build`
|
||||||
|
4. ✅ Page d'accueil : Vérifier le rendu
|
||||||
|
5. ✅ Page team : Vérifier les visualisations
|
||||||
|
6. ✅ Navigation : Vérifier tous les liens
|
||||||
|
|
||||||
|
## Migration automatique (optionnel)
|
||||||
|
|
||||||
|
Si des problèmes surviennent, vous pouvez utiliser le codemod officiel :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd radar-app
|
||||||
|
npx @next/codemod@canary upgrade latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Ce codemod gère automatiquement :
|
||||||
|
- Suppression de `experimental_ppr` Route Segment Config
|
||||||
|
- Suppression du préfixe `unstable_` des APIs stabilisées
|
||||||
|
- Migration de la convention `middleware` dépréciée vers `proxy`
|
||||||
|
- Migration de `next lint` vers ESLint CLI
|
||||||
|
- Mise à jour de `next.config.js` pour la nouvelle configuration Turbopack
|
||||||
|
|
||||||
|
## Notes importantes
|
||||||
|
|
||||||
|
- Le projet utilise déjà React 19, qui est compatible avec Next.js 16
|
||||||
|
- Le Dockerfile utilise Node.js 20, ce qui satisfait l'exigence minimale
|
||||||
|
- Aucun changement de code source n'est nécessaire pour cette migration
|
||||||
|
- Les dépendances optionnelles (cytoscape, echarts-for-react) restent inchangées
|
||||||
|
|
||||||
|
## Date de migration
|
||||||
|
|
||||||
|
Migration effectuée le : 2026-02-25
|
||||||
47
radar-app/package.json
Normal file
47
radar-app/package.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"name": "aoe_technology_radar",
|
||||||
|
"version": "4.7.0-rc.1",
|
||||||
|
"bin": {
|
||||||
|
"techradar": "bin/techradar.js"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev",
|
||||||
|
"build:icons": "npx @svgr/cli --typescript --no-dimensions --no-prettier --out-dir src/components/Icons -- src/icons",
|
||||||
|
"build:data": "tsx scripts/buildData.ts",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "next lint",
|
||||||
|
"fix": "prettier . --write",
|
||||||
|
"prepare": "husky",
|
||||||
|
"postinstall": "npm run build:icons"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^19.8.0",
|
||||||
|
"@commitlint/config-conventional": "^19.8.0",
|
||||||
|
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
||||||
|
"@types/node": "^22",
|
||||||
|
"@types/react": "^19",
|
||||||
|
"@types/react-dom": "^19",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"eslint": "^9.23.0",
|
||||||
|
"eslint-config-next": "16.1.6",
|
||||||
|
"fuse.js": "^7.1.0",
|
||||||
|
"gray-matter": "^4.0.3",
|
||||||
|
"highlight.js": "^11.11.1",
|
||||||
|
"husky": "^9.1.7",
|
||||||
|
"lint-staged": "^15.5.0",
|
||||||
|
"marked": "^15.0.7",
|
||||||
|
"marked-highlight": "^2.2.1",
|
||||||
|
"next": "16.1.6",
|
||||||
|
"postcss-nested": "^7.0.2",
|
||||||
|
"postcss-preset-env": "^10.1.5",
|
||||||
|
"prettier": "^3.5.3",
|
||||||
|
"react": "^19",
|
||||||
|
"react-dom": "^19",
|
||||||
|
"tsx": "^4.19.3",
|
||||||
|
"typescript": "^5"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"**/*": "prettier --write --ignore-unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user