Skip to content

Commit 61b8397

Browse files
authored
Merge pull request #279 from iodigital-com/chore/update-deps
Chore/update deps
2 parents 9079b7a + 9e6446f commit 61b8397

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+6995
-13965
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# NodeJS
2+
NODE_ENV='development'
3+
14
# YouTube
25
YOUTUBE_API_KEY=
36

.ncurc.major.cjs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const minorConfig = require('./.ncurc.minor.cjs');
2+
3+
module.exports = {
4+
...minorConfig,
5+
reject: [
6+
'mdx-bundler',
7+
'rehype-*',
8+
'remark-*',
9+
],
10+
target: 'latest',
11+
};

.ncurc.minor.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const patchConfig = require('./.ncurc.patch.cjs');
2+
3+
module.exports = {
4+
...patchConfig,
5+
target: 'minor',
6+
};

.ncurc.patch.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
dep: ['dev', 'prod'],
3+
install: 'always',
4+
reject: [],
5+
root: true,
6+
target: 'patch',
7+
upgrade: true,
8+
workspaces: false,
9+
}

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.*
1+
22.*

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
3434

3535
Check the guidelines in the [Wiki](https://github.com/iodigital-com/io-technology/wiki)
3636

37+
### Updating Dependencies
38+
39+
If you want to help by keeping our dependencies up te date, first read the [updating guide](./UPDATING.md).
40+
3741
## Contributors
3842

3943
Thank you to all our [contributors](https://github.com/iodigital-com/io-technology/graphs/contributors) ❤️

UPDATING.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Updating Dependencies
2+
3+
> Thank you for keeping the iO Techhub dependencies up-to-date. You are helping us keep up with the latest developments and security updates.
4+
5+
To keep the dependencies up-to-date we use `npm-check-updates`. Each version range (`major`.`minor`.`patch`) has its own script and configuration. Below are a few steps to take to make updating an easy task.
6+
7+
## The steps
8+
9+
1. Update Node to the latest stable version
10+
1. Make sure to update both the `package.json`'s `engines` configuration and the `.nvmrc` file
11+
1. Open the [update patch versions config](./.ncurc.patch.cjs)
12+
1. Review each dependency in the `reject` array, if available, and see if you can remove it
13+
1. Run `npm run update:patch` in the project root
14+
1. See if there are any issues with the new updates
15+
1. Fix any issues you encounter
16+
1. If you somehow can't fix it, upgrade the dependency to the highest version which doesn't have the issue
17+
Sometimes you can resolve it by updating to the next version range (`patch` -> `minor` -> `major`), if available
18+
- Add it to the `reject` array
19+
- Add a comment on why you rejected it
20+
1. Go back to step 2.2
21+
1. Repeat the above step for [minor version config](./.ncurc.minor.cjs)
22+
1. Before migrating the remaining packages to a newer `major` version, migrate [`next`](https://nextjs.org/docs/app/building-your-application/upgrading) and [`react`](https://react.dev/versions) manually first, if available. They provide convenient tools making the update easier for you
23+
1. Repeat the above step for [major version config](./.ncurc.major.cjs)
24+
1. Review this process and update when necessary
25+
26+
### Please note
27+
28+
Make sure to [comment why you didn't update](#step-reject-comment) a specific dependency so we can try again at a later time. Preferably add a link to a github issue (or similar).

components/Article.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ const Article = ({ slug, date, title, summary, tags, authors, border = true }) =
2727
width={200}
2828
height={200}
2929
alt="avatar"
30-
objectFit="cover"
31-
className="rounded-full"
30+
className="rounded-full object-cover"
3231
/>
3332
</div>
3433
))}

components/Contributor.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const InnerContributor = ({ contributor }) => {
1111
width={200}
1212
height={200}
1313
alt={`Avatar of ${contributor.name}`}
14-
objectFit="cover"
15-
className="rounded-full"
14+
className="rounded-full object-cover"
1615
/>
1716
</div>
1817
<p>{contributor.name}</p>

components/EventCalendar.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ const EventCalendar = ({ events }) => {
99
className={`relative m-0 bg-white p-4 ${
1010
isFutureEvent(event.dateTime) ? '' : ' opacity-50'
1111
}`}
12-
key={event.id}
12+
key={event.title}
1313
>
14-
<h3 className="m-0 line-clamp-2 text-lg font-medium">{event.title}</h3>
15-
<p className="m-0 line-clamp-2 text-sm">{event.description}</p>
16-
<p className="m-0 mt-auto line-clamp-2 pt-6 text-xs">
14+
<h3 className="line-clamp-2 m-0 text-lg font-medium">{event.title}</h3>
15+
<p className="line-clamp-2 m-0 text-sm">{event.description}</p>
16+
<p className="line-clamp-2 m-0 mt-auto pt-6 text-xs">
1717
<time
1818
className={`font-bold ${isFutureEvent(event.dateTime) ? 'text-io_blue-600' : ''}`}
1919
dateTime={new Intl.DateTimeFormat('en-US', {

components/EventCarousel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const EventCarousel = ({ events }) => {
66
<ul className="my-12 mb-24 flex flex-col flex-wrap items-center md:snap-x md:flex-row md:flex-nowrap md:items-stretch md:gap-12 md:overflow-x-auto md:px-12">
77
{events.map((event) => (
88
<li
9-
key={event.id}
9+
key={event.title}
1010
className={`mb-8 shrink-0 md:mb-0 md:snap-center ${
1111
isFutureEvent(event.dateTime) ? '' : ' opacity-50'
1212
}`}

components/Experiment.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Experiment = ({ title, images, demo, code, authors, content, border = true
1717
<div className="hidden md:col-span-3 md:mr-8 md:block xl:col-span-5">
1818
{images.map((image) => (
1919
<div className="responsive-image-container mb-2" key={image}>
20-
<Image src={image} alt="Image" layout="fill" />
20+
<Image src={image} alt="Image" width={100} height={100} />
2121
</div>
2222
))}
2323
</div>
@@ -35,8 +35,7 @@ const Experiment = ({ title, images, demo, code, authors, content, border = true
3535
width={50}
3636
height={50}
3737
alt="avatar"
38-
objectFit="cover"
39-
className="rounded-full"
38+
className="rounded-full object-cover"
4039
/>
4140
</div>
4241
<div className="ml-2">

components/HubspotForm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const HubspotForm = ({ portalId, formId, className, style }) => {
1717
})
1818
}
1919
})
20-
}, [])
20+
}, [portalId, formId])
2121

2222
return <div id="hubspotForm" className={`${className} hubspot`} style={style}></div>
2323
}

components/JobGrid.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { useBrandingTheme } from '@/lib/hooks/useBrandingTheme'
2+
import Link from './Link'
23

34
const JobGrid = ({ jobs }) => {
45
const { theme } = useBrandingTheme()
56

67
return (
78
<div className="grid gap-4 gap-y-10 xl:grid-cols-5">
89
{jobs.map((job) => (
9-
<a
10+
<Link
1011
key={job.id}
1112
href={job.careers_url}
1213
target="_blank"
@@ -28,9 +29,9 @@ const JobGrid = ({ jobs }) => {
2829
/>
2930
</svg>
3031
</article>
31-
</a>
32+
</Link>
3233
))}
33-
<a
34+
<Link
3435
href="https://www.iodigital.com/en/careers/jobs?expertise=Technology"
3536
target="_blank"
3637
rel="noreferrer"
@@ -45,7 +46,7 @@ const JobGrid = ({ jobs }) => {
4546
d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"
4647
/>
4748
</svg>
48-
</a>
49+
</Link>
4950
</div>
5051
)
5152
}

components/LayoutWrapper.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
'use client'
2+
13
import { useEffect, useRef, useState } from 'react'
24
import siteMetadata from '@/data/siteMetadata'
35
import headerNavLinks from '@/data/headerNavLinks'
46
import Link from './Link'
57
import Footer from './Footer'
68
import MobileNav from './MobileNav'
9+
import { Player } from './LottiePlayer'
710
import { useBrandingTheme } from '@/lib/hooks/useBrandingTheme'
8-
import { Player } from '@lottiefiles/react-lottie-player'
911

1012
const LayoutWrapper = ({ children }) => {
1113
const [navigationIsOpen, setNavigationIsOpen] = useState(false)

components/Link.js

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable jsx-a11y/anchor-has-content */
2-
import Link from 'next/link'
2+
import NextLink from 'next/link'
33
import { useBrandingTheme } from '@/lib/hooks/useBrandingTheme'
44

55
// TODO: add these classes to the safelist
@@ -8,34 +8,42 @@ import { useBrandingTheme } from '@/lib/hooks/useBrandingTheme'
88
// !text-io_blue-600
99
// !text-io_pink-600
1010

11-
const CustomLink = ({ href, ...rest }) => {
11+
const Link = ({ href, ...rest }) => {
1212
const isInternalLink = href && href.startsWith('/')
1313
const isAnchorLink = href && href.startsWith('#')
1414

1515
const { theme } = useBrandingTheme()
1616
const classNames = `!text-io_${theme}-600`
1717

1818
if (isInternalLink) {
19-
return (
20-
<Link href={href} className={classNames}>
21-
<a {...rest} />
22-
</Link>
23-
)
19+
return <NextLink href={href} {...rest} />
2420
}
2521

2622
if (isAnchorLink) {
2723
const isFootnoteRef = !!rest['data-footnote-ref']
2824

2925
if (isFootnoteRef) {
30-
return <a href={href} className={`${classNames} ml-1 font-semibold no-underline`} {...rest} />
26+
return (
27+
<NextLink
28+
href={href}
29+
className={`${classNames} ml-1 font-semibold no-underline`}
30+
{...rest}
31+
/>
32+
)
3133
}
3234

33-
return <a href={href} className={classNames} {...rest} />
35+
return <NextLink href={href} className={classNames} {...rest} />
3436
}
3537

3638
return (
37-
<a target="_blank" rel="noopener noreferrer" href={href} className={classNames} {...rest} />
39+
<NextLink
40+
target="_blank"
41+
rel="noopener noreferrer"
42+
href={href}
43+
className={classNames}
44+
{...rest}
45+
/>
3846
)
3947
}
4048

41-
export default CustomLink
49+
export default Link

components/LottiePlayer.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import dynamic from 'next/dynamic'
2+
3+
/**
4+
* Dynamically load the ReactLottiePlayer. It resolves an issue which was introduced when updating NodeJS to v22.
5+
*
6+
* @see https://github.com/LottieFiles/lottie-react/issues/149#issuecomment-2203978157
7+
*/
8+
export const Player = dynamic(
9+
async () => {
10+
const LottiePlayer = await import('@lottiefiles/react-lottie-player')
11+
return LottiePlayer.Player
12+
},
13+
{ ssr: false }
14+
)

components/MDXComponents.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
import { useMemo } from 'react'
33
import { getMDXComponent } from 'mdx-bundler/client'
44
import Image from './Image'
5-
import CustomLink from './Link'
5+
import Link from './Link'
66
import TOCInline from './TOCInline'
77
import Pre from './Pre'
88
import Heading from './Heading'
99

1010
export const MDXComponents = {
1111
Image,
1212
TOCInline,
13-
a: CustomLink,
13+
a: Link,
1414
pre: Pre,
1515
h1: Heading(1),
1616
h2: Heading(2),

components/Pagination.js

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from 'next/link'
1+
import Link from './Link'
22
import Arrow from '@/data/arrow.svg'
33

44
export default function Pagination({ totalPages, currentPage, subpath = 'articles' }) {
@@ -20,11 +20,11 @@ export default function Pagination({ totalPages, currentPage, subpath = 'article
2020
{prevPage && (
2121
<Link
2222
href={currentPage - 1 === 1 ? `/${subpath}/` : `/${subpath}/page/${currentPage - 1}`}
23+
rel="previous"
24+
className={btnClasses}
2325
>
24-
<a rel="previous" className={btnClasses}>
25-
<Arrow className="mr-4 w-6 rotate-180" />
26-
<span>Previous</span>
27-
</a>
26+
<Arrow className="mr-4 w-6 rotate-180" />
27+
<span>Previous</span>
2828
</Link>
2929
)}
3030
<span className="py-4 text-base font-bold leading-none">
@@ -37,11 +37,9 @@ export default function Pagination({ totalPages, currentPage, subpath = 'article
3737
</button>
3838
)}
3939
{nextPage && (
40-
<Link href={`/${subpath}/page/${currentPage + 1}`}>
41-
<a rel="next" className={btnClasses}>
42-
<span>Next</span>
43-
<Arrow className="ml-4 w-6" />
44-
</a>
40+
<Link href={`/${subpath}/page/${currentPage + 1}`} rel="next" className={btnClasses}>
41+
<span>Next</span>
42+
<Arrow className="ml-4 w-6" />
4543
</Link>
4644
)}
4745
</nav>

components/Serie.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,18 @@ const Serie = ({ slug, date, title, tags, authors, border = true, subpath = 'art
2828
width={200}
2929
height={200}
3030
alt="avatar"
31-
objectFit="cover"
32-
className="rounded-full"
31+
className="rounded-full object-cover"
3332
/>
3433
</div>
3534
))}
3635
</div>
3736
<div className="text-body-xs">
3837
<p className="mb-0">
39-
<Link>
40-
<a
41-
href={`/authors/${authors[0].slug[0]}`}
42-
className={`text-io_${theme}-600 hover:text-io_${theme}-700`}
43-
>
44-
{authors[0].name}
45-
</a>
38+
<Link
39+
href={`/authors/${authors[0].slug[0]}`}
40+
className={`text-io_${theme}-600 hover:text-io_${theme}-700`}
41+
>
42+
{authors[0].name}
4643
</Link>
4744
</p>
4845
<p className="mb-0">{authors[0].occupation}</p>

0 commit comments

Comments
 (0)