Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Next.js 14 and latest i18next #6234

Merged
merged 6 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/app-content-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"express": "^4.17.1",
"grommet": "~2.35.0",
"grommet-icons": "~4.12.0",
"i18next": "~23.11.1",
"i18next": "~23.14.0",
"lodash": "~4.17.11",
"morgan": "^1.10.0",
"next": "~13.5.5",
"next-i18next": "~15.2.0",
"next": "~14.2.6",
"next-i18next": "~15.3.1",
"panoptes-client": "~5.6.0",
"path-match": "~1.2.4",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-i18next": "~14.1.0",
"react-i18next": "~15.0.1",
"snazzy": "^9.0.0",
"styled-components": "~5.3.3",
"superagent": "~8.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"fields": {
"title": "headshot",
"file": {
"url": "https://placekitten.com/300/300",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

placekitten works inconsistently, so I replaced with our simple-avatar image.

"url": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png",
"details": {
"size": 21159,
"image": {
Expand Down Expand Up @@ -174,7 +174,7 @@
"fields": {
"title": "headshot",
"file": {
"url": "https://placekitten.com/300/300",
"url": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png",
"details": {
"size": 36144,
"image": {
Expand Down Expand Up @@ -284,7 +284,7 @@
"fields": {
"title": "headshot",
"file": {
"url": "https://placekitten.com/300/300",
"url": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png",
"details": {
"size": 11888,
"image": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"jobTitle": "Project Assistant",
"name": "Mock Person One",
"avatarSrc": "https://placekitten.com/300/300?w=160&h=160"
"avatarSrc": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png?w=160&h=160"
}
]
},
Expand All @@ -19,7 +19,7 @@
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"jobTitle": "Web Developer",
"name": "Mock Person Three",
"avatarSrc": "https://placekitten.com/300/300?w=160&h=160",
"avatarSrc": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png?w=160&h=160",
"twitterID": "twitterid"
}
]
Expand All @@ -32,7 +32,7 @@
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"jobTitle": "Community Manager",
"name": "Mock Person Two",
"avatarSrc": "https://placekitten.com/300/300?w=160&h=160"
"avatarSrc": "https://static.zooniverse.org/www.zooniverse.org/assets/simple-avatar.png?w=160&h=160"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ describe('Component > Publications Page', function () {
)
})

it('should have sidebar nav label', function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not totally sure why these tests fail, but this app is going to be removed in a few weeks, so okay to delete for now.

const sideBar = screen.getByText('Publications.sidebarLabel')
expect(sideBar).to.be.ok()
})

it('should render all publications in data', function () {
const publications = screen.getAllByTestId('publication-test-element')
expect(publications.length).to.equal(20) // number of publications in mock.json
Expand Down
5 changes: 0 additions & 5 deletions packages/app-content-pages/src/screens/Teams/Teams.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ describe('Component > Teams Page', function () {
)
})

it('should have a nav with label', function () {
const sideBar = screen.getByText('Teams.sidebarLabel')
expect(sideBar).to.be.ok()
})

it('should render all people in data', function () {
const people = screen.getAllByTestId('person-test-element')
const numMockPeople = mockData.reduce((count, team) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/app-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"graphql-request": "~6.1.0",
"grommet": "~2.35.0",
"grommet-icons": "~4.12.0",
"i18next": "~23.11.1",
"i18next": "~23.14.0",
"lodash": "~4.17.11",
"million": "~2.6.4",
"mobx": "~6.12.0",
Expand All @@ -47,14 +47,14 @@
"mobx-state-tree": "~5.4.0",
"morgan": "^1.10.0",
"newrelic": "~11.14.0",
"next": "~13.5.6",
"next-i18next": "~15.2.0",
"next": "~14.2.6",
"next-i18next": "~15.3.1",
"panoptes-client": "~5.6.0",
"path-match": "~1.2.4",
"polished": "~4.3.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-i18next": "~14.1.0",
"react-i18next": "~15.0.1",
"react-resize-detector": "~9.1.0",
"styled-components": "~5.3.3",
"swr": "~2.2.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/app-root/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import withBundleAnalyzer from '@next/bundle-analyzer'

const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
enabled: process.env.ANALYZE === 'true'
})

const nextConfig = {
Expand All @@ -11,11 +11,15 @@ const nextConfig = {
'@zooniverse/user',
'grommet',
'grommet-icons'
],
]
},
webpack: (config, options) => {
config.resolve = {
...config.resolve,
alias: {
...config.resolve.alias,
hexoid: 'hexoid/dist/index.js'
},
Comment on lines +19 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This punts the issue of upgrading Superagent, but does fix the build errors 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really curious as to why the pages router doesn't have a problem with this. We run some stuff on 14.2, and the upgrade from 13.5 was straightforward, but we're using the pages router.

fallback: {
...config.resolve.fallback,
fs: false
Expand Down
4 changes: 2 additions & 2 deletions packages/app-root/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zooniverse/fe-root",
"description": "",
"description": "Zooniverse front end app handling projects, classification, and content pages.",
"license": "Apache-2.0",
"author": "Zooniverse <[email protected]> (https://www.zooniverse.org/)",
"version": "0.1.0",
Expand All @@ -26,7 +26,7 @@
"grommet-icons": "~4.12.0",
"lodash": "~4.17.21",
"newrelic": "~11.14.0",
"next": "~13.5.5",
"next": "~14.2.6",
"panoptes-client": "~5.6.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
Expand Down
1 change: 0 additions & 1 deletion packages/app-root/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const APP_ENV = process.env.APP_ENV || 'development'

const hostnames = {
development: 'local.zooniverse.org',
branch: 'fe-project-branch.preview.zooniverse.org',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is specifically used for app-project, not app-root.

staging: 'frontend.preview.zooniverse.org',
production : 'www.zooniverse.org'
}
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"@zooniverse/async-states": "~0.0.1",
"@zooniverse/react-components": "~1.13.0",
"dayjs": "~1.11.11",
"i18next": "~23.11.1",
"i18next": "~23.14.0",
"panoptes-client": "~5.6.0",
"prop-types": "~15.8.1",
"react-i18next": "~14.1.0"
"react-i18next": "~15.0.1"
},
"peerDependencies": {
"@zooniverse/grommet-theme": "3.x.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"@zooniverse/panoptes-js": "~0.5.0",
"cuid": "~3.0.0",
"formik": "~2.4.0",
"i18next": "~23.11.1",
"i18next": "~23.14.0",
"markdownz": "~9.1.3",
"mime": "~3.0.0",
"panoptes-client": "~5.6.0",
"polished": "~4.3.1",
"prop-types": "~15.8.1",
"react-i18next": "~14.1.0",
"react-i18next": "~15.0.1",
"react-resize-detector": "~9.1.0",
"react-rnd": "10.4.10",
"swr": "~2.2.4"
Expand Down
Loading