Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d9abbade
Commit
d9abbade
authored
Aug 13, 2019
by
JJ Kasper
Committed by
Joe Haddad
Aug 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove experimental async-to-promises code (#8353)
parent
9fe95b5c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
45 deletions
+1
-45
config.ts
packages/next-server/server/config.ts
+0
-1
webpack-config.ts
packages/next/build/webpack-config.ts
+0
-1
next-babel-loader.js
packages/next/build/webpack/loaders/next-babel-loader.js
+1
-37
package.json
packages/next/package.json
+0
-1
yarn.lock
yarn.lock
+0
-5
No files found.
packages/next-server/server/config.ts
View file @
d9abbade
...
...
@@ -38,7 +38,6 @@ const defaultConfig: { [key: string]: any } = {
terserLoader
:
false
,
profiling
:
false
,
flyingShuttle
:
false
,
asyncToPromises
:
false
,
documentMiddleware
:
false
,
granularChunks
:
false
,
publicDirectory
:
false
,
...
...
packages/next/build/webpack-config.ts
View file @
d9abbade
...
...
@@ -73,7 +73,6 @@ export default async function getBaseWebpackConfig(
distDir
,
cwd
:
dir
,
cache
:
!
selectivePageBuilding
,
asyncToPromises
:
config
.
experimental
.
asyncToPromises
,
},
},
// Backwards compat
...
...
packages/next/build/webpack/loaders/next-babel-loader.js
View file @
d9abbade
...
...
@@ -53,7 +53,6 @@ module.exports = babelLoader.custom(babel => {
customOptions
(
opts
)
{
const
custom
=
{
isServer
:
opts
.
isServer
,
asyncToPromises
:
opts
.
asyncToPromises
,
isModern
:
opts
.
isModern
,
hasModern
:
opts
.
hasModern
}
...
...
@@ -83,7 +82,6 @@ module.exports = babelLoader.custom(babel => {
)
delete
loader
.
isServer
delete
loader
.
asyncToPromises
delete
loader
.
cache
delete
loader
.
distDir
delete
loader
.
isModern
...
...
@@ -94,7 +92,7 @@ module.exports = babelLoader.custom(babel => {
cfg
,
{
source
,
customOptions
:
{
isServer
,
asyncToPromises
,
isModern
,
hasModern
}
customOptions
:
{
isServer
,
isModern
,
hasModern
}
}
)
{
const
{
cwd
}
=
cfg
.
options
...
...
@@ -158,40 +156,6 @@ module.exports = babelLoader.custom(babel => {
options
.
presets
=
[...
additionalPresets
,
presetItemModern
]
}
if
(
!
isModern
&&
asyncToPromises
)
{
const
asyncToPromisesPlugin
=
babel
.
createConfigItem
(
[
'babel-plugin-transform-async-to-promises'
,
{
inlineHelpers
:
true
}
],
{
type
:
'plugin'
}
)
options
.
plugins
=
options
.
plugins
||
[]
options
.
plugins
.
push
(
asyncToPromisesPlugin
)
const
regeneratorPlugin
=
options
.
plugins
.
find
(
plugin
=>
{
return
plugin
[
0
]
===
require
(
'@babel/plugin-transform-runtime'
)
})
if
(
regeneratorPlugin
)
{
regeneratorPlugin
[
1
].
regenerator
=
false
}
const
babelPresetEnv
=
(
options
.
presets
||
[]).
find
((
preset
=
[])
=>
{
return
preset
[
0
]
===
require
(
'@babel/preset-env'
).
default
})
if
(
babelPresetEnv
)
{
babelPresetEnv
[
1
].
exclude
=
(
options
.
presets
[
0
][
1
].
exclude
||
[]
).
concat
([
'transform-typeof-symbol'
,
'transform-regenerator'
,
'transform-async-to-generator'
])
}
}
// If the file has `module.exports` we have to transpile commonjs because Babel adds `import` statements
// That break webpack, since webpack doesn't support combining commonjs and esmodules
if
(
!
hasModern
&&
source
.
indexOf
(
'module.exports'
)
!==
-
1
)
{
...
...
packages/next/package.json
View file @
d9abbade
...
...
@@ -73,7 +73,6 @@
"babel-core"
:
"7.0.0-bridge.0"
,
"babel-loader"
:
"8.0.6"
,
"babel-plugin-react-require"
:
"3.0.0"
,
"babel-plugin-transform-async-to-promises"
:
"0.8.10"
,
"babel-plugin-transform-react-remove-prop-types"
:
"0.4.24"
,
"chalk"
:
"2.4.2"
,
"find-up"
:
"4.0.0"
,
...
...
yarn.lock
View file @
d9abbade
...
...
@@ -3214,11 +3214,6 @@ babel-plugin-syntax-jsx@6.18.0:
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=
babel-plugin-transform-async-to-promises@0.8.10:
version "0.8.10"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.10.tgz#d6b75ebcd08a27b780cc4306525e6bfc5e070303"
integrity sha512-+697AuoK7Skokmeu5MOhMP7IoOyKhhYjt73vaYUbf9PW9A0wl/NjVm2fJGVmjbjhhyYcnEqjfgRNCYuErHv1Sg==
babel-plugin-transform-react-remove-prop-types@0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment