Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
0fc344e6
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0fc344e6
编写于
6月 03, 2020
作者:
T
Tim Neutkens
提交者:
GitHub
6月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused variable (#13716)
Co-authored-by:
N
Joe Haddad
<
joe.haddad@zeit.co
>
上级
34f82a99
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
44 addition
and
33 deletion
+44
-33
.eslintrc.json
.eslintrc.json
+23
-10
packages/next/build/babel/plugins/jsx-pragma.ts
packages/next/build/babel/plugins/jsx-pragma.ts
+2
-2
packages/next/build/entries.ts
packages/next/build/entries.ts
+0
-1
packages/next/build/index.ts
packages/next/build/index.ts
+0
-1
packages/next/build/webpack/loaders/next-data-loader.ts
packages/next/build/webpack/loaders/next-data-loader.ts
+1
-1
packages/next/build/webpack/loaders/next-plugin-loader.ts
packages/next/build/webpack/loaders/next-plugin-loader.ts
+1
-1
packages/next/build/webpack/plugins/next-esm-plugin.ts
packages/next/build/webpack/plugins/next-esm-plugin.ts
+1
-1
packages/next/build/webpack/plugins/profiling-plugin.ts
packages/next/build/webpack/plugins/profiling-plugin.ts
+5
-3
packages/next/build/webpack/plugins/webpack-conformance-plugin/checks/duplicate-polyfills-conformance-check.ts
...ce-plugin/checks/duplicate-polyfills-conformance-check.ts
+1
-1
packages/next/build/webpack/plugins/webpack-conformance-plugin/index.ts
...build/webpack/plugins/webpack-conformance-plugin/index.ts
+1
-1
packages/next/client/dev/on-demand-entries-client.js
packages/next/client/dev/on-demand-entries-client.js
+1
-1
packages/next/client/next-dev.js
packages/next/client/next-dev.js
+1
-1
packages/next/next-server/lib/loadable.js
packages/next/next-server/lib/loadable.js
+1
-2
packages/next/next-server/server/next-server.ts
packages/next/next-server/server/next-server.ts
+2
-2
packages/next/server/hot-reloader.ts
packages/next/server/hot-reloader.ts
+0
-1
packages/next/server/next-dev-server.ts
packages/next/server/next-dev-server.ts
+1
-1
packages/next/taskfile.js
packages/next/taskfile.js
+1
-1
packages/react-dev-overlay/src/internal/ReactDevOverlay.tsx
packages/react-dev-overlay/src/internal/ReactDevOverlay.tsx
+1
-1
packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
+1
-1
未找到文件。
.eslintrc.json
浏览文件 @
0fc344e6
...
...
@@ -22,16 +22,6 @@
"import/internal-regex"
:
"^next/"
},
"overrides"
:
[
{
"files"
:
[
"packages/**"
],
"rules"
:
{
"no-shadow"
:
[
"warn"
,
{
"builtinGlobals"
:
false
}],
"import/no-extraneous-dependencies"
:
[
"error"
,
{
"devDependencies"
:
false
}
]
}
},
{
"files"
:
[
"test/**/*.test.js"
],
"extends"
:
[
"plugin:jest/recommended"
],
...
...
@@ -121,6 +111,29 @@
}
]
}
},
{
"files"
:
[
"packages/**"
],
"rules"
:
{
"no-shadow"
:
[
"warn"
,
{
"builtinGlobals"
:
false
}],
"import/no-extraneous-dependencies"
:
[
"error"
,
{
"devDependencies"
:
false
}
]
}
},
{
"files"
:
[
"packages/**/*.tsx"
,
"packages/**/*.ts"
],
"rules"
:
{
"@typescript-eslint/no-unused-vars"
:
[
"warn"
,
{
"args"
:
"all"
,
"argsIgnorePattern"
:
"^_"
,
"ignoreRestSiblings"
:
true
}
]
}
}
],
"rules"
:
{
...
...
packages/next/build/babel/plugins/jsx-pragma.ts
浏览文件 @
0fc344e6
...
...
@@ -8,13 +8,13 @@ export default function ({
return
{
inherits
:
require
(
'
babel-plugin-syntax-jsx
'
),
visitor
:
{
JSXElement
(
path
,
state
)
{
JSXElement
(
_
path
,
state
)
{
state
.
set
(
'
jsx
'
,
true
)
},
// Fragment syntax is still JSX since it compiles to createElement(),
// but JSXFragment is not a JSXElement
JSXFragment
(
path
,
state
)
{
JSXFragment
(
_
path
,
state
)
{
state
.
set
(
'
jsx
'
,
true
)
},
...
...
packages/next/build/entries.ts
浏览文件 @
0fc344e6
...
...
@@ -62,7 +62,6 @@ type Entrypoints = {
}
export
function
createEntrypoints
(
dev
:
boolean
,
pages
:
PagesMapping
,
target
:
'
server
'
|
'
serverless
'
|
'
experimental-serverless-trace
'
,
buildId
:
string
,
...
...
packages/next/build/index.ts
浏览文件 @
0fc344e6
...
...
@@ -213,7 +213,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
const
mappedPages
=
createPagesMapping
(
pagePaths
,
config
.
pageExtensions
)
const
entrypoints
=
createEntrypoints
(
/* dev */
false
,
mappedPages
,
target
,
buildId
,
...
...
packages/next/build/webpack/loaders/next-data-loader.ts
浏览文件 @
0fc344e6
import
{
loader
}
from
'
webpack
'
import
hash
from
'
next/dist/compiled/string-hash
'
import
{
basename
}
from
'
path
'
const
nextDataLoader
:
loader
.
Loader
=
function
(
source
)
{
const
nextDataLoader
:
loader
.
Loader
=
function
()
{
const
filename
=
this
.
resourcePath
return
`
import {createHook} from 'next/data'
...
...
packages/next/build/webpack/loaders/next-plugin-loader.ts
浏览文件 @
0fc344e6
...
...
@@ -12,7 +12,7 @@ export const pluginLoaderOptions: {
plugins
:
[],
}
const
nextPluginLoader
:
loader
.
Loader
=
function
(
source
)
{
const
nextPluginLoader
:
loader
.
Loader
=
function
()
{
const
{
middleware
}:
NextPluginLoaderQuery
=
typeof
this
.
query
===
'
string
'
?
parse
(
this
.
query
.
substr
(
1
))
:
this
.
query
...
...
packages/next/build/webpack/plugins/next-esm-plugin.ts
浏览文件 @
0fc344e6
...
...
@@ -368,7 +368,7 @@ export default class NextEsmPlugin implements Plugin {
setTimeout
(()
=>
{
this
.
updateOptions
(
childCompiler
)
childCompiler
.
runAsChild
((
err
,
entries
,
childCompilation
)
=>
{
childCompiler
.
runAsChild
((
err
,
_
entries
,
childCompilation
)
=>
{
if
(
err
)
{
return
reject
(
err
)
}
...
...
packages/next/build/webpack/plugins/profiling-plugin.ts
浏览文件 @
0fc344e6
...
...
@@ -137,13 +137,15 @@ const interceptAllParserHooks = (moduleFactory: any, tracer: any) => {
moduleTypes
.
forEach
((
moduleType
)
=>
{
moduleFactory
.
hooks
.
parser
.
for
(
moduleType
)
.
tap
(
'
ProfilingPlugin
'
,
(
parser
:
any
,
parserOpts
:
any
)
=>
{
.
tap
(
'
ProfilingPlugin
'
,
(
parser
:
any
)
=>
{
interceptAllHooksFor
(
parser
,
tracer
,
'
Parser
'
)
})
})
}
const
makeInterceptorFor
=
(
instance
:
any
,
tracer
:
any
)
=>
(
hookName
:
any
)
=>
({
const
makeInterceptorFor
=
(
_instance
:
any
,
tracer
:
any
)
=>
(
hookName
:
any
)
=>
({
register
:
({
name
,
type
,
context
,
fn
}:
any
)
=>
{
const
newFn
=
makeNewProfiledTapFn
(
hookName
,
tracer
,
{
name
,
...
...
@@ -172,7 +174,7 @@ const makeInterceptorFor = (instance: any, tracer: any) => (hookName: any) => ({
* @returns {PluginFunction} Chainable hooked function.
*/
const
makeNewProfiledTapFn
=
(
hookName
:
any
,
_
hookName
:
any
,
tracer
:
any
,
{
name
,
type
,
fn
}:
any
)
=>
{
...
...
packages/next/build/webpack/plugins/webpack-conformance-plugin/checks/duplicate-polyfills-conformance-check.ts
浏览文件 @
0fc344e6
...
...
@@ -154,7 +154,7 @@ export class DuplicatePolyfillsConformanceCheck
},
{
visitor
:
'
visitCallExpression
'
,
inspectNode
:
(
path
:
NodePath
,
{
request
}:
IParsedModuleDetails
)
=>
{
inspectNode
:
(
path
:
NodePath
)
=>
{
const
{
node
}:
{
node
:
types
.
namedTypes
.
CallExpression
}
=
path
if
(
!
node
.
arguments
||
node
.
arguments
.
length
<
2
)
{
return
EARLY_EXIT_SUCCESS_RESULT
...
...
packages/next/build/webpack/plugins/webpack-conformance-plugin/index.ts
浏览文件 @
0fc344e6
...
...
@@ -49,7 +49,7 @@ export default class WebpackConformancePlugin {
}
private
buildStartedHandler
=
(
compilation
:
CompilationType
.
Compilation
,
_
compilation
:
CompilationType
.
Compilation
,
callback
:
()
=>
void
)
=>
{
const
buildStartedResults
:
IConformanceTestResult
[]
=
this
.
tests
.
map
(
...
...
packages/next/client/dev/on-demand-entries-client.js
浏览文件 @
0fc344e6
...
...
@@ -13,7 +13,7 @@ export default async ({ assetPrefix }) => {
// prevent HMR connection from being closed when running tests
if
(
!
process
.
env
.
__NEXT_TEST_MODE
)
{
document
.
addEventListener
(
'
visibilitychange
'
,
(
event
)
=>
{
document
.
addEventListener
(
'
visibilitychange
'
,
(
_
event
)
=>
{
const
state
=
document
.
visibilityState
if
(
state
===
'
visible
'
)
{
setupPing
(
assetPrefix
,
()
=>
Router
.
pathname
,
true
)
...
...
packages/next/client/next-dev.js
浏览文件 @
0fc344e6
...
...
@@ -28,7 +28,7 @@ const webpackHMR = initWebpackHMR({ assetPrefix: prefix })
window
.
next
=
next
initNext
({
webpackHMR
})
.
then
(({
emitter
,
renderCtx
,
render
})
=>
{
.
then
(({
renderCtx
,
render
})
=>
{
initOnDemandEntries
({
assetPrefix
:
prefix
})
if
(
process
.
env
.
__NEXT_BUILD_INDICATOR
)
initializeBuildWatcher
()
if
(
...
...
packages/next/next-server/lib/loadable.js
浏览文件 @
0fc344e6
...
...
@@ -252,8 +252,7 @@ class LoadableSubscription {
this
.
_update
({})
this
.
_clearTimeouts
()
})
// eslint-disable-next-line handle-callback-err
.
catch
((
err
)
=>
{
.
catch
((
_err
)
=>
{
this
.
_update
({})
this
.
_clearTimeouts
()
})
...
...
packages/next/next-server/server/next-server.ts
浏览文件 @
0fc344e6
...
...
@@ -475,7 +475,7 @@ export default class Server {
type
,
match
:
getCustomRouteMatcher
(
r
.
source
),
name
:
type
,
fn
:
async
(
req
,
res
,
params
,
parsedUrl
)
=>
({
finished
:
false
}),
fn
:
async
(
_req
,
_res
,
_params
,
_
parsedUrl
)
=>
({
finished
:
false
}),
}
as
Route
&
Rewrite
&
Header
)
const
updateHeaderValue
=
(
value
:
string
,
params
:
Params
):
string
=>
{
...
...
@@ -672,7 +672,7 @@ export default class Server {
}
// Used to build API page in development
protected
async
ensureApiPage
(
pathname
:
string
):
Promise
<
void
>
{}
protected
async
ensureApiPage
(
_
pathname
:
string
):
Promise
<
void
>
{}
/**
* Resolves `API` request, in development builds on demand
...
...
packages/next/server/hot-reloader.ts
浏览文件 @
0fc344e6
...
...
@@ -265,7 +265,6 @@ export default class HotReloader {
this
.
config
.
pageExtensions
)
const
entrypoints
=
createEntrypoints
(
/* dev */
true
,
pages
,
'
server
'
,
this
.
buildId
,
...
...
packages/next/server/next-dev-server.ts
浏览文件 @
0fc344e6
...
...
@@ -135,7 +135,7 @@ export default class DevServer extends Server {
match
:
route
(
path
),
type
:
'
route
'
,
name
:
`
${
path
}
exportpathmap route`
,
fn
:
async
(
req
,
res
,
params
,
parsedUrl
)
=>
{
fn
:
async
(
req
,
res
,
_
params
,
parsedUrl
)
=>
{
const
{
query
:
urlQuery
}
=
parsedUrl
Object
.
keys
(
urlQuery
)
...
...
packages/next/taskfile.js
浏览文件 @
0fc344e6
...
...
@@ -681,7 +681,7 @@ export async function pages_document(task) {
await
task
.
source
(
'
pages/_document.tsx
'
).
babel
(
'
server
'
).
target
(
'
dist/pages
'
)
}
export
async
function
pages
(
task
,
opts
)
{
export
async
function
pages
(
task
,
_
opts
)
{
await
task
.
parallel
([
'
pages_app
'
,
'
pages_error
'
,
'
pages_document
'
])
}
...
...
packages/react-dev-overlay/src/internal/ReactDevOverlay.tsx
浏览文件 @
0fc344e6
...
...
@@ -54,7 +54,7 @@ function ReactDevOverlay({ children }) {
},
[
dispatch
])
const
onComponentError
=
React
.
useCallback
(
(
error
:
Error
,
componentStack
:
string
|
null
)
=>
{
(
_error
:
Error
,
_
componentStack
:
string
|
null
)
=>
{
// TODO: special handling
},
[]
...
...
packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
浏览文件 @
0fc344e6
...
...
@@ -11,7 +11,7 @@ function webpack4(compiler: Compiler) {
const
hookRequire
:
typeof
compilation
[
'
mainTemplate
'
][
'
hooks
'
][
'
requireExtensions
'
]
=
(
compilation
.
mainTemplate
.
hooks
as
any
).
require
hookRequire
.
tap
(
'
ReactFreshWebpackPlugin
'
,
(
source
,
chunk
,
hash
)
=>
{
hookRequire
.
tap
(
'
ReactFreshWebpackPlugin
'
,
(
source
,
_chunk
,
_
hash
)
=>
{
// Webpack 4 evaluates module code on the following line:
// ```
// modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录