Skip to content

Commit

Permalink
Dependency Update April-October 2019 (#184)
Browse files Browse the repository at this point in the history
This is the regular batch update for outdated dependencies.

>>>> Deprecated Packages

The following packages have been deprecated in favour of new (scoped)
packages:

- `eslint-config-arcticicestudio` -> `@arcticicestudio/eslint-config`
- `gatsby-mdx` -> `gatsby-plugin-mdx`
- `jest-dom` -> `@testing-library/jest-dom`
- `react-hooks-testing-library` -> `@testing-library/react-hooks`
- `react-testing-library` -> `@testing-library/react`

>>>> Known Issues

The `react-pose` and `react-spring` package are intentionally not
updated in order to prevent incompatibilities. Due to the transitive
dependency of `react-pose` to the `stylefire` package, some SVG
animations would break because the latest version of `stylefire`
changed the way how `x` & `y` CSS `transform` and `translate` propertiy
values are handled. This results in SVG element not being scaled from
their original position but from the top of the `viewBox`.
Using the latest version of `react-spring` causes a `value not defined`
error for the animation of the floating port project logos.
Both problems will be solved later on by finding the root cause of the
undefined `value` as well as migrating away from the deprecated
`react-pose` package to the new `framer-motion` package and API.

>>>> Updated ESLint Configuration

The ESLint configuration has been adapted to the new
`@arcticicestudio/eslint-config` package. This simplifies the
configuration at all by removing custom overrides that were missing in
the preset. It also removes the import of the
`import/no-extraneous-dependencies` rule object from the
`@arcticicestudio/eslint-config-base` package since the rule is now
disabled for all files matching the `**/.gatsby/**/*.js` pattern.

The new preset also comes with the new development dependency package
`eslint-config-prettier`. In order to resolve alias imports the
`eslint-import-resolver-alias` package has also been added and
configured.

After updating all configurations the whole code base has been linted
and possible errors and warnings have been fixed.

>>>> Testing Setup

The awesome "react-testing" libraries moved to the `@testing-library`
package scope which required some changes to be done to migrate the
test setup:

1. Updated all package import paths, e.g. `react-testing-library` to
   `@testing-library/react`.
2. Removed the deprecated import of the `cleanup-after-each` function
   that yields the following warning:
   "The module `@testing-library/react/cleanup-after-each` has been
   deprecated and no longer does anything (it is not needed). You no
   longer need to import this module and can safely remove any import
   or configuration which imports this module."
3. Updated failing snapshots were only the class name of
   "styled components" changed. This is because the generated class
   names are now starting with a counter of `0` instead of `1` causing
   only changes like this:
   ```diff
   -.c1
   +.c0
   ```

>>>>>> Production Dependencies

- @mdx-js/react `1.0.6` -> `1.5.1`
- axios `0.18.0` -> `0.19.0`
- body-scroll-lock `2.6.1` -> `2.6.4`
- date-fns `2.0.0-alpha.27` -> `2.4.1`
- gatsby `2.3.29` -> `2.15.36`
- gatsby-image `2.0.40` -> `2.2.27`
- ~~gatsby-mdx `0.6.2`~~ -> gatsby-plugin-mdx `1.0.51`
- gatsby-plugin-canonical-urls `2.0.12` -> `2.1.11`
- gatsby-plugin-catch-links `2.0.13` -> `2.1.13`
- gatsby-plugin-google-gtag `1.0.16` -> `1.1.12`
- gatsby-plugin-lodash `3.0.5` -> `3.1.11`
- gatsby-plugin-manifest `2.0.29` -> `2.2.21`
- gatsby-plugin-netlify `2.0.15` -> 2.1.19``
- gatsby-plugin-no-sourcemaps `2.0.2` -> `2.1.1`
- gatsby-plugin-offline `2.0.25` -> `3.0.14`
- gatsby-plugin-react-helmet `3.0.12` -> `3.1.11`
- gatsby-plugin-remove-trailing-slashes `2.0.11` -> `2.1.10`
- gatsby-plugin-robots-txt `1.4.0` -> `1.5.0`
- gatsby-plugin-sharp `2.0.35` -> `2.2.29`
- gatsby-plugin-sitemap `2.0.12` -> `2.2.17`
- gatsby-plugin-styled-components `3.0.7` -> `3.1.9`
- gatsby-plugin-webpack-size `0.0.3` -> `1.0.0`
- gatsby-source-filesystem `2.0.32` -> `2.1.31`
- gatsby-source-graphql `2.0.18` -> `2.1.18`
- gatsby-transformer-sharp `2.1.18` -> `2.2.21`
- gatsby-transformer-yaml `2.1.12` -> `2.2.13`
- inter-ui `3.5.0` -> `3.10.0`
- lodash `4.17.11` -> `4.17.15`
- polished `3.2.0` -> `3.4.1`
- react `16.8.6` -> `16.10.2`
- react-dom `16.8.6` -> `16.10.2`
- react-helmet `5.2.0` -> `5.2.1`
- react-spring `8.0.7` -> `8.0.27`
- semver `6.0.0` -> `6.3.0`
- styled-components `4.2.0` -> `4.4.0`

>>>>>> Development Dependencies

- @babel/core `7.4.3` -> `7.6.4`
- @babel/plugin-proposal-class-properties `7.4.0` -> `7.5.5`
- @babel/plugin-proposal-export-default-from `7.2.0` -> `7.5.2`
- @babel/plugin-proposal-nullish-coalescing-operator `7.4.3` -> `7.4.4`
- @babel/plugin-proposal-optional-chaining `7.2.0` -> `7.6.0`
- @mdx-js/mdx `1.0.14` -> `1.5.1`
- @svgr/webpack `4.2.0` -> `4.3.3`
- babel-eslint `10.0.1` -> `10.0.3`
- babel-jest `24.7.1` -> `24.9.0`
- babel-plugin-styled-components `1.10.0` -> `1.10.6`
- babel-preset-gatsby `0.1.11` -> `0.2.18`
- del-cli `1.1.0` -> `3.0.0`
- eslint `5.16.0` -> `6.5.1`
- ~~eslint-config-arcticicestudio `>=0.4.0 <1.0.0`~~ -> @arcticicestudio/eslint-config `>=0.8.0 <1.0.0`
- eslint-config-prettier 🆕 `6.4.0`
- eslint-import-resolver-jest `2.1.1` -> `3.0.0`
- eslint-import-resolver-alias 🆕 `1.1.2`
- eslint-plugin-import `2.17.2` -> `2.18.2`
- eslint-plugin-jsx-a11y `6.2.1` -> `6.2.3`
- eslint-plugin-prettier `3.0.1` -> `3.1.1`
- eslint-plugin-react `7.12.4` -> `7.16.0`
- eslint-plugin-react-hooks `1.6.0` -> `2.1.2`
- git-revision-webpack-plugin `3.0.3` -> `3.0.4`
- glob `7.1.3` -> `7.1.4`
- husky `2.1.0` -> `3.0.9`
- jest `24.7.1` -> `24.9.0`
- ~~jest-dom `3.1.3`~~ -> @testing-library/jest-dom `4.1.2`
- jest-junit `6.3.0` -> `8.0.0`
- jest-styled-components `6.3.1` -> `6.3.3`
- lint-staged `8.1.5` -> `9.4.2`
- prettier `1.17.0` -> `1.18.2`
- rehype-slug `2.0.2` -> `2.0.3`
- ~~react-hooks-testing-library `0.5.0`~~ -> @testing-library/react `9.3.0`
- ~~react-testing-library `6.1.2`~~ -> @testing-library/react-hooks `2.0.3`
- remark-breaks `1.0.2` -> `1.0.3`
- remark-cli `6.0.1` -> `7.0.0`
- remark-github `7.0.6` -> `8.0.0`
- remark-preset-lint-arcticicestudio `>=0.2.0 <1.0.0` -> `>=0.3.0 <1.0.0`
- webpack-bundle-analyzer `3.3.2` -> `3.5.2`

Resolves GH-183
  • Loading branch information
arcticicestudio authored Oct 14, 2019
1 parent 8ae06b3 commit b37ec8d
Show file tree
Hide file tree
Showing 27 changed files with 7,470 additions and 4,879 deletions.
85 changes: 55 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,85 @@
*/

const { resolve } = require("path");
/* eslint-disable import/no-extraneous-dependencies */
const {
rules: { "import/no-extraneous-dependencies": noExtraneousDependencies }
} = require("eslint-config-arcticicestudio-base/rules/import/helpful-warnings");
/* eslint-enable import/no-extraneous-dependencies */

module.exports = {
extends: "arcticicestudio",
plugins: ["babel", "prettier", "react-hooks"],
parser: "babel-eslint",
extends: [
"@arcticicestudio/eslint-config",
"@arcticicestudio/eslint-config/react-hooks",
"@arcticicestudio/eslint-config/prettier"
],
plugins: ["babel"],
env: {
browser: true,
jest: true,
node: true
},
settings: {
"import/resolver": {
alias: {
map: [
["assets", resolve(__dirname, "src", "assets")],
["atoms", resolve(__dirname, "src", "components", "atoms")],
["config", resolve(__dirname, "src", "config")],
["containers", resolve(__dirname, "src", "components", "containers")],
["data", resolve(__dirname, "src", "data")],
["hooks", resolve(__dirname, "src", "hooks")],
["layouts", resolve(__dirname, "src", "components", "layouts")],
["molecules", resolve(__dirname, "src", "components", "molecules")],
["organisms", resolve(__dirname, "src", "components", "organisms")],
["pages", resolve(__dirname, "src", "pages")],
["styles", resolve(__dirname, "src", "styles")],
["templates", resolve(__dirname, "src", "components", "templates")],
["utils", resolve(__dirname, "src", "utils")]
]
},
jest: {
jestConfigFile: resolve(__dirname, "jest.config.js")
},
node: {
/* Resolve Webpack alias imports */
paths: [resolve(__dirname, "src"), resolve(__dirname, "src/components")]
paths: [resolve(__dirname, "src"), resolve(__dirname, "src", "components")]
}
}
},
rules: {
/* Prioritize format errors found by Prettier. */
"prettier/prettier": "error",

/* Support for React Hooks. */
"react-hooks/rules-of-hooks": "error",
"react/jsx-no-bind": "off",

/* Disable noisy and low priority rules. */
"no-confusing-arrow": "off",
"react/display-name": "off",

/* Also suppress errors when importing development dependencies in project specific scripts. */
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: noExtraneousDependencies[1].devDependencies.concat(["**/.gatsby/**"])
}
],
/*
* Enable support for experimental features:
*
* - `babel/camelcase` - doesn't complain about optional chaining (`let foo = bar?.a_b;`).
* - `babel/no-unused-expressions` - doesn't fail when using `do` expressions or optional chaining (`a?.b()`).
*/
"babel/camelcase": "error",
camelcase: "off",
"babel/no-unused-expressions": "error",
"no-unused-expressions": "off"
}
"babel/camelcase": "error",
"no-unused-expressions": "off",
"babel/no-unused-expressions": "error"
},
overrides: [
{
files: ["*.jsx"],
rules: {
/*
* Defining multiple components per file is common when using CSS-in-JS, especially for scoped components
* that are only used once.
*/
"react/no-multi-comp": "off",
/*
* Spreading props reduces prop cluttering and can prevent bugs due to transitive/implicit props not being
* passed to the target component
*/
"react/jsx-props-no-spreading": "off"
}
},
{
/*
* Allow to use development dependencies in Gatsby configuration files since these are necessary and will
* be provided by either Gatsby itself or another without being explicitly defined as package dependency.
*/
files: ["**/.gatsby/**/*.js"],
rules: {
"import/no-extraneous-dependencies": "off"
}
}
]
};
6 changes: 2 additions & 4 deletions .gatsby/createPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const mdxQuery = `
allMdx {
edges {
node {
code {
scope
}
fields {
${Object.keys(nodeFields).map(nf => nf.replace(",", "\n"))}
}
Expand All @@ -46,7 +43,8 @@ const mdxQuery = `
* @since 0.10.0
* @see https://next.gatsbyjs.org/docs/node-apis/#createPages
* @see https://next.gatsbyjs.org/docs/node-apis/#createPage
* @see https://github.com/ChristopherBiscardi/gatsby-mdx
* @see https://www.gatsbyjs.org/docs/mdx
* @see https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-mdx
*/
const createPages = async ({ graphql, actions }) => {
const { createPage, createRedirect } = actions;
Expand Down
3 changes: 1 addition & 2 deletions .gatsby/onCreateWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
* @since 0.1.0
*/

const { resolve: resolvePath } = require("path");
/* eslint-disable-next-line import/no-extraneous-dependencies */
const webpack = require("webpack");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const { resolve: resolvePath } = require("path");

const { BASE_DIR_BUILD_REPORTS } = require("../src/config/internal/constants");

Expand Down
5 changes: 3 additions & 2 deletions .gatsby/plugins/mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
*/

/**
* @file The configuration for the Gatsby plugin `gatsby-mdx`.
* @file The configuration for the Gatsby plugin `gatsby-plugin-mdx`.
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.10.0
* @see https://mdxjs.com
* @see https://github.com/ChristopherBiscardi/gatsby-mdx
* @see https://www.gatsbyjs.org/docs/mdx
* @see https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-mdx
*/

const remarkBreaks = require("remark-breaks");
Expand Down
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = {
options: gatsbyPluginSourceGraphQlConfig
},
{
resolve: "gatsby-mdx",
resolve: "gatsby-plugin-mdx",
options: gatsbyPluginMdxConfig
},
/* NOTE: The following plugins rely on the order in this array and must be placed at last in order work properly! */
Expand Down
Loading

0 comments on commit b37ec8d

Please sign in to comment.