From f165650350a9eeeb10b632b7de65bf7ea3fdaec9 Mon Sep 17 00:00:00 2001 From: mama Date: Mon, 4 Dec 2017 16:56:27 +0100 Subject: [PATCH] =?UTF-8?q?:arrow=5Fup:=20Mise=20=C3=A0=20jour=20des=20d?= =?UTF-8?q?=C3=A9pendances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour utiliser les Fragments de React 16.2 --- package.json | 33 +++++++++++++++--------------- source/.babelrc | 8 ++++---- source/components/ResultsGrid.js | 13 ++++++------ source/components/Simulateur.js | 2 +- source/engine/generateQuestions.js | 3 +-- source/webpack.config.js | 4 ++-- 6 files changed, 31 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 38b3a014b..9eb2d4b87 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "node": ">=6.2.0 <9.0.0" }, "dependencies": { - "babel-runtime": "^6.23.0", + "@babel/polyfill": "^7.0.0-beta.34", "classnames": "^2.2.5", "dedent-js": "^1.0.1", "deep-assign": "^2.0.0", @@ -22,9 +22,9 @@ "nearley": "^2.9.2", "npm": "^5.3.0", "ramda": "0.24.1", - "react": "^16.0.0", + "react": "^16.2.0", "react-addons-css-transition-group": "^15.6.2", - "react-dom": "^16.0.0", + "react-dom": "^16.2.0", "react-helmet": "^5.2.0", "react-redux": "^5.0.6", "react-router": "^4.2.0", @@ -44,29 +44,28 @@ "yaml-loader": "^0.5.0" }, "devDependencies": { + "@babel/core": "^7.0.0-beta.34", + "@babel/plugin-proposal-decorators": "^7.0.0-beta.34", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.34", + "@babel/plugin-syntax-decorators": "^7.0.0-beta.34", + "@babel/preset-env": "^7.0.0-beta.34", + "@babel/preset-react": "^7.0.0-beta.34", "akh": "^3.1.2", "autoprefixer": "^7.1.1", - "babel-cli": "^6.24.1", - "babel-core": "^6.24.1", - "babel-eslint": "^8.0.1", - "babel-loader": "^7.0.0", + "babel-loader": "8.0.0-beta.0", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-decorators-legacy": "^1.3.4", + "babel-plugin-transform-decorators": "^6.24.1", "babel-plugin-transform-do-expressions": "^6.22.0", - "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-webpack-alias": "^2.1.2", - "babel-polyfill": "^6.23.0", - "babel-preset-env": "^1.4.0", - "babel-preset-react": "^6.24.1", "chai": "^4.0.2", "chokidar": "^1.7.0", "core-js": "^2.4.1", "css-loader": "^0.28.1", "csv-loader": "^2.1.1", "daggy": "^1.1.0", - "eslint": "^4.8.0", - "eslint-plugin-react": "^7.0.1", + "eslint": "^4.12.1", + "eslint-plugin-react": "^7.5.1", "express": "^4.15.3", "fantasy-combinators": "0.0.1", "fantasy-land": "^3.3.0", @@ -81,15 +80,15 @@ "nearley-loader": "0.0.2", "postcss-loader": "^2.0.5", "ramda-fantasy": "^0.8.0", - "react-hot-loader": "^3.0.0-beta.6", + "react-hot-loader": "^3.1.3", "redux-devtools": "^3.4.1", "redux-devtools-dock-monitor": "^1.1.2", "redux-devtools-log-monitor": "^1.4.0", "source-map-support": "^0.5.0", "style-loader": "^0.19.0", "url-loader": "^0.6.2", - "webpack": "^3.6.0", - "webpack-dev-server": "^2.9.1" + "webpack": "^3.9.1", + "webpack-dev-server": "^2.9.5" }, "scripts": { "start": "node source/server.js", diff --git a/source/.babelrc b/source/.babelrc index 9704dc308..51ceef661 100644 --- a/source/.babelrc +++ b/source/.babelrc @@ -1,17 +1,17 @@ { "presets": [ - ["env", { + ["@babel/env", { "targets": { "browsers": ["last 2 versions", "safari >= 7"] }, "modules": false }], - "react" + "@babel/react" ], "plugins": [ - "transform-decorators-legacy", + "@babel/plugin-proposal-decorators", "transform-do-expressions", - "transform-object-rest-spread", + "@babel/plugin-proposal-object-rest-spread", "transform-class-properties", "syntax-dynamic-import", "react-hot-loader/babel", diff --git a/source/components/ResultsGrid.js b/source/components/ResultsGrid.js index df370c386..da8b8498b 100644 --- a/source/components/ResultsGrid.js +++ b/source/components/ResultsGrid.js @@ -11,10 +11,11 @@ import { capitalise0 } from '../utils' import { nameLeaf } from 'Engine/rules' // Filtered variables and rules can't be filtered in a uniform way, for now -let paidBy = which => R.pathEq(['explanation', 'cotisation', 'dû par'], which) -let filteredBy = which => R.pathEq(['cotisation', 'dû par'], which) +let paidBy = R.pathEq(['explanation', 'cotisation', 'dû par']) -export let byName = branch => R.groupBy(R.prop('dottedName'), branch) +let filteredBy = R.pathEq(['cotisation', 'dû par']) + +export let byName = R.groupBy(R.prop('dottedName')) export let cell = (branch, payer, analysis) => { let row = byBranch(analysis)[branch], @@ -116,15 +117,15 @@ export default class ResultsGrid extends Component { })} - {relevantSalaries.has('salaire net') && [ + {relevantSalaries.has('salaire net') && <> = - , + {humanFigure(2)(net)}{' '} Salaire net - ]} + } {relevantSalaries.has('salaire total') && [ = diff --git a/source/components/Simulateur.js b/source/components/Simulateur.js index 12e2542b3..dcfc48b4e 100644 --- a/source/components/Simulateur.js +++ b/source/components/Simulateur.js @@ -91,7 +91,6 @@ export default class extends Component { content={R.pluck('description', this.targetRules).join(' - ')} /> - + ) diff --git a/source/engine/generateQuestions.js b/source/engine/generateQuestions.js index 79b43c88e..173b4cd84 100644 --- a/source/engine/generateQuestions.js +++ b/source/engine/generateQuestions.js @@ -8,7 +8,6 @@ import formValueTypes from 'Components/conversation/formValueTypes' import { findRuleByDottedName, - findRuleByName, disambiguateRuleReference } from './rules' import { collectNodeMissing } from './evaluation' @@ -41,7 +40,7 @@ export let collectMissingVariables = targets => )(targets) export let getNextSteps = (situationGate, analysis) => { - let impact = ([variable, objectives]) => R.length(objectives) + let impact = ([, objectives]) => R.length(objectives) let missingVariables = collectMissingVariables(analysis.targets), pairs = R.toPairs(missingVariables), diff --git a/source/webpack.config.js b/source/webpack.config.js index 1f5f3b7af..8406c2d3f 100644 --- a/source/webpack.config.js +++ b/source/webpack.config.js @@ -6,13 +6,13 @@ var webpack = require('webpack'), module.exports = { devtool: 'cheap-module-source-map', entry: prodEnv ? [ - 'babel-polyfill', + '@babel/polyfill', 'whatwg-fetch', './source/entry.js' ] : [ 'webpack-dev-server/client?http://localhost:3000/', 'webpack/hot/only-dev-server', - 'babel-polyfill', + '@babel/polyfill', 'react-hot-loader/patch', './source/entry.js' ],