Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
Empty file modified .babelrc
100755 → 100644
Empty file.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ cypress//integration/examples
.eslintcache

cypress/videos/*
tsconfig.tsbuildinfo
tsconfig.tsbuildinfopublic/sw.js
public/sw.js
public/sw.js.map
public/workbox-*
tsconfig.tsbuildinfo
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
8 changes: 8 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({

// if move pwa config to witPlugins, it will not work
const nextConfig = withPWA({
// swcMinify: true,
productionBrowserSourceMaps: false,
pwa: {
dest: 'public',
Expand All @@ -21,6 +22,13 @@ const nextConfig = withPWA({
// scope: '/cp',
sw: 'sw.js',
},
compiler: {
// ssr and displayName are configured by default
styledComponents: true,
},
// experimental: {
// outputStandalone: true,
// },
})

module.exports = withPlugins([withBundleAnalyzer, withSourceMaps], nextConfig)
4,103 changes: 877 additions & 3,226 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
}
},
"dependencies": {
"@babel/core": "^7.13.14",
"@groupher/react-editor": "^1.1.30",
"@next-boost/hybrid-disk-cache": "^0.3.0",
"@next-boost/next-boost": "^0.15.1",
Expand All @@ -54,7 +53,7 @@
"accepts": "^1.3.4",
"ali-oss": "^5.3.2",
"babel-plugin-add-react-displayname": "^0.0.5",
"babel-plugin-styled-components": "^1.12.0",
"babel-plugin-styled-components": "^2.0.3",
"cacheable-response": "^2.0.9",
"chalk": "^2.4.1",
"compatible-debug": "^1.0.0",
Expand All @@ -77,7 +76,7 @@
"mobx-state-tree": "5.0.2",
"module-alias": "^2.0.1",
"nanoid": "^3.1.12",
"next": "^12.0.1",
"next": "^12.1.0",
"next-compose-plugins": "^2.2.0",
"next-i18next": "4.4.1",
"next-offline": "4.0.6",
Expand All @@ -92,13 +91,13 @@
"pubsub-js": "^1.9.3",
"qrcode.react": "^1.0.1",
"ramda": "0.26.1",
"react": "17.0.2",
"react": "^17.0.2",
"react-animation": "^1.2.2",
"react-calendar-heatmap": "1.8.1",
"react-content-loader": "3.4.2",
"react-copy-to-clipboard": "^5.0.3",
"react-device-detect": "^2.1.2",
"react-dom": "17.0.2",
"react-dom": "^17.0.2",
"react-highlight-words": "^0.16.0",
"react-lazy-load-image-component": "1.5.0",
"react-masonry-component": "^6.0.1",
Expand Down Expand Up @@ -143,8 +142,6 @@
"@types/styled-components": "^5.1.8",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^23.6.0",
"bundlewatch": "^0.2.7",
"commitizen": "3.1.2",
"coveralls": "3.0.14",
Expand Down
42 changes: 30 additions & 12 deletions src/containers/tool/Drawer/dynamics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import dynamic from 'next/dynamic'

import { LavaLampLoading } from '@/widgets/dynamic'
import EditorLoading from '@/widgets/Loading/EditorLoading'
// import EditorLoading from '@/widgets/Loading/EditorLoading'

import { LavaLoadingWrapper } from './styles'

Expand All @@ -21,38 +21,53 @@ const commonConfig = {
}

// editor style loading config
const editorConfig = {
// @ts-ignore
loading: () => <EditorLoading />,
ssr: false,
}
// const editorConfig = {
// // @ts-ignore
// loading: () => <EditorLoading />,
// ssr: false,
// }

// viewers
export const ArticleViewer = dynamic(
() => import('@/containers/viewer/ArticleViewer'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)

export const MailsViewer = dynamic(
() => import('@/containers/viewer/MailsViewer'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)

export const RepoViewer = dynamic(
() => import('@/containers/viewer/RepoViewer'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)

// editors
export const AccountEditor = dynamic(
() => import('@/containers/editor/AccountEditor'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)

// user lister
export const UserLister = dynamic(
() => import('@/containers/user/UserLister'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)

// export const RepoEditor = dynamic(
Expand All @@ -63,5 +78,8 @@ export const UserLister = dynamic(
// utils
export const C11NSettingPanel = dynamic(
() => import('@/containers/tool/C11NSettingPanel'),
commonConfig,
{
loading: () => <CommonLoading />,
ssr: false,
},
)
12 changes: 7 additions & 5 deletions src/widgets/PostItem/DesktopView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ const DigestView: FC<TProps> = ({ curCommunity, entry }) => {
// 尤其是在 Tab 切换的时候。手机端因为目前没有这些组件,性能暂无问题。
// 本不应该存在的无聊问题,蛋疼的解决办法,
useEffect(() => {
const cfg = { ssr: false }

Upvote = dynamic(() => import('@/widgets/Upvote'), cfg)
ArticleReadLabel = dynamic(() => import('@/widgets/ArticleReadLabel'), cfg)
ArticlePinLabel = dynamic(() => import('@/widgets/ArticlePinLabel'), cfg)
Upvote = dynamic(() => import('@/widgets/Upvote'), { ssr: false })
ArticleReadLabel = dynamic(() => import('@/widgets/ArticleReadLabel'), {
ssr: false,
})
ArticlePinLabel = dynamic(() => import('@/widgets/ArticlePinLabel'), {
ssr: false,
})

setTimeout(() => {
setLoaded(true)
Expand Down