Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit eab4e48

Browse files
authored
refactor: try next 13 & refactor (#1386)
* chore: upgrade & rm no react-18 compatiable pkgs * chore: provoider wip * chore: rm providers from pages * chore: type for buildlog * chore: type for buildlog
1 parent ae0ee52 commit eab4e48

Some content is hidden

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

77 files changed

+18816
-14842
lines changed

.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// .env
1+
# .env
22
SERVE_PORT=3000
3-
// google analysis
3+
# google analysis
44
NEXT_PUBLIC_GA_TRACING_ID=UA-39874160-3
5-
// github
5+
# github
66
NEXT_PUBLIC_GITHUB_CLIENT_ID=3b4281c5e54ffd801f85
77

.jest.setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable */
22
import { configure } from 'enzyme'
3-
import Adapter from 'enzyme-adapter-react-16'
3+
import Adapter from '@cfaester/enzyme-adapter-react-18'
44

55
configure({ adapter: new Adapter() })

config/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const APP_VERSION = '1.0.13'
1+
export const APP_VERSION = "1.0.13"

next.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const nextConfig = {
1919
exclude: ['error'],
2020
},
2121
},
22+
// experimental: { appDir: true },
23+
2224
// pwa: {
2325
// dest: 'public',
2426
// disable: process.env.NODE_ENV !== 'production',

package-lock.json

Lines changed: 18287 additions & 13873 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.0.13",
44
"license": "Apache License 2.0",
55
"scripts": {
6-
"dev": "cross-env NODE_ENV=dev next dev",
7-
"dev.boost": "next-boost",
6+
"dev": "next dev",
7+
"dev2": "next dev --turbo",
88
"ci": "cross-env NODE_ENV=ci node server",
99
"update.version": "node -p \"'export const APP_VERSION = ' + JSON.stringify(require('./package.json').version)\" > config/version.ts",
1010
"build": "next build",
@@ -16,7 +16,6 @@
1616
"serve": "cross-env NODE_ENV=production next start -p ${SERVE_PORT}",
1717
"serve.dev": "cross-env NODE_ENV=dev next start -p ${SERVE_PORT}",
1818
"serve.prod.server": "cross-env NODE_ENV=production SERVE_PORT=${SERVE_PORT} node server",
19-
"serve.prod.boost": "cross-env NODE_ENV=production next-boost -p ${SERVE_PORT}",
2019
"serve.prod": "cross-env NODE_ENV=production next start -p ${SERVE_PORT}",
2120
"dist": "next build && next export -o \"build\"",
2221
"start": "NODE_ENV=production node server.js",
@@ -42,8 +41,6 @@
4241
},
4342
"dependencies": {
4443
"@groupher/react-editor": "^1.1.30",
45-
"@next-boost/hybrid-disk-cache": "^0.3.0",
46-
"@next-boost/next-boost": "^0.15.1",
4744
"@next/bundle-analyzer": "^12.2.5",
4845
"@sentry/browser": "5.17.0",
4946
"@sentry/node": "5.17.0",
@@ -65,15 +62,14 @@
6562
"glob": "^7.1.2",
6663
"graphql": "^15.5.1",
6764
"graphql-request": "3.5.0",
68-
"graphql-voyager": "^1.0.0-rc.31",
6965
"izitoast": "^1.4.0",
7066
"mastani-codehighlight": "0.0.7",
7167
"mobx": "^6.6.2",
7268
"mobx-react": "^7.5.3",
7369
"mobx-state-tree": "^5.1.6",
7470
"module-alias": "^2.0.1",
7571
"nanoid": "^3.1.12",
76-
"next": "^12.2.5",
72+
"next": "^13.0.0",
7773
"next-compose-plugins": "^2.2.0",
7874
"next-i18next": "4.4.1",
7975
"next-pwa": "^5.4.4",
@@ -85,31 +81,29 @@
8581
"promise-timeout": "^1.3.0",
8682
"prop-types": "^15.5.10",
8783
"pubsub-js": "^1.9.3",
88-
"qrcode.react": "^1.0.1",
84+
"qrcode.react": "^3.1.0",
8985
"ramda": "0.26.1",
9086
"react": "^18.2.0",
91-
"react-animation": "^1.2.2",
92-
"react-calendar-heatmap": "1.8.1",
93-
"react-content-loader": "3.4.2",
87+
"@groupher/react-animation": "^1.2.3",
88+
"react-calendar-heatmap": "1.9.0",
89+
"react-content-loader": "6.2.0",
9490
"react-copy-to-clipboard": "^5.0.3",
9591
"react-device-detect": "^2.1.2",
9692
"react-dom": "^18.2.0",
97-
"react-highlight-words": "^0.16.0",
98-
"react-lazy-load-image-component": "1.5.0",
99-
"react-masonry-component": "^6.0.1",
93+
"react-highlight-words": "^0.18.0",
94+
"react-lazy-load-image-component": "1.5.5",
10095
"react-masonry-css": "^1.0.14",
101-
"react-pin-field": "1.0.6",
102-
"react-resize-detector": "4.2.3",
103-
"react-select": "^3.1.0",
104-
"react-sortable-hoc": "1.7.1",
105-
"react-svg": "11.1.2",
106-
"react-swipeable": "^5.5.1",
96+
"react-pin-field": "3.0.16",
97+
"react-resize-detector": "7.1.2",
98+
"react-select": "^5.5.7",
99+
"react-svg": "15.1.10",
100+
"react-swipeable": "^7.0.0",
107101
"react-textarea-autosize": "^8.3.0",
108102
"react-tooltip": "^4.2.21",
109103
"react-trend": "^1.2.4",
110-
"react-use": "15.1.1",
111-
"react-useportal": "^1.0.13",
112-
"react-waypoint": "9.0.2",
104+
"react-use": "17.4.0",
105+
"react-portal": "^4.2.2",
106+
"react-waypoint": "^10.3.0",
113107
"remarkable": "2.0.0",
114108
"remarkable-emoji": "^0.1.3",
115109
"remarkable-mentions": "^0.1.0",
@@ -145,17 +139,17 @@
145139
"cypress": "^8.1.0",
146140
"cz-conventional-changelog": "^3.0.0",
147141
"enzyme": "3.11.0",
148-
"enzyme-adapter-react-16": "1.15.2",
142+
"@cfaester/enzyme-adapter-react-18": "0.5.1",
149143
"enzyme-to-json": "^3.3.4",
150144
"eslint": "^8.23.0",
151-
"eslint-config-next": "^12.2.5",
145+
"eslint-config-next": "^13.0.0",
152146
"husky": "^3.0.0",
153147
"jest": "26.2.2",
154148
"npm-run-all": "^4.1.1",
155149
"plop": "2.7.4",
156150
"prettier": "2.3.2",
157151
"pretty-quick": "^1.10.0",
158-
"react-test-renderer": "16.10.0",
152+
"react-test-renderer": "18.2.0",
159153
"shelljs": "0.8.4",
160154
"standard-version": "^8.0.1",
161155
"start-server-and-test": "1.12.1",

server/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const express = require('express')
1111
const cookieParser = require('cookie-parser')
1212
const responseTime = require('response-time')
1313
const mobxReact = require('mobx-react')
14-
// inspect graphql model
15-
const { express: voyagerMiddleware } = require('graphql-voyager/middleware')
1614
// i18n setup
1715
// const nextI18NextMiddleware = require('next-i18next/middleware').default
1816
// const nextI18next = require('../i18n')
@@ -42,10 +40,6 @@ mobxReact.enableStaticRendering(true)
4240
// redirect all the www request to non-www addr
4341
server.use(redirectToNakedUrl)
4442
server.use(express.static('public'))
45-
server.use(
46-
'/model-graphs',
47-
voyagerMiddleware({ endpointUrl: CONFIG.GRAPHQL_ENDPOINT }),
48-
)
4943

5044
// await nextI18next.initPromise
5145
// server.use(nextI18NextMiddleware(nextI18next))

src/containers/content/ExploreContent/SloganText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Fragment, memo, useEffect, useState } from 'react'
2-
import { AnimateOnChange } from 'react-animation'
2+
import { AnimateOnChange } from '@groupher/react-animation'
33

44
import { SloganTextWrapper } from './styles/banner'
55

src/containers/content/FriendsContent/store.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ import { types as T, getParent, Instance } from 'mobx-state-tree'
66
// import {} from 'ramda'
77

88
import type { TCommunity, TRootStore } from '@/spec'
9-
import { buildLog } from '@/utils/logger'
109
import { markStates, toJS } from '@/utils/mobx'
1110

12-
/* eslint-disable-next-line */
13-
const log = buildLog('S:FriendsContent')
14-
1511
const FriendsContent = T.model('FriendsContent', {})
1612
.views((self) => ({
1713
get curCommunity(): TCommunity {

src/containers/content/HaveADrinkContent/Body/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { FC, memo } from 'react'
8-
import { AnimateOnChange } from 'react-animation'
8+
import { AnimateOnChange } from '@groupher/react-animation'
99

1010
import type { TView, TDrinkItem, TSettingOption } from '../spec'
1111
import { VIEW } from '../constant'

0 commit comments

Comments
 (0)