-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[cli][client][tests] update to node14-compatible target (drop support for node12) #7865
Conversation
@@ -10,7 +10,6 @@ if (!process.env.NODE_ENV) { | |||
} | |||
|
|||
// @ts-ignore | |||
// eslint-disable-next-line @typescript-eslint/no-var-requires | |||
const page = require(__LAUNCHER_PAGE_PATH__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this one use eval()
too? Why does lint no longer complain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't need to be eval
, according to: #7865 (comment)
The linting rule is off for some reason. I enabled it and restored this opt-out line. a3c5a3d
(#7865)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that's why the rule was off: https://github.com/vercel/vercel/runs/6698194648?check_suite_focus=true
I'll mess with that in a separate PR. Turning this rule back off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 247 violations of this rule. We can discuss if we want to enforce it or not. Maybe for now we remove these comments disabling the rule on a per-line level.
packages/next/src/utils.ts
Outdated
const imagesManifest: NextImagesManifest = require(pathImagesManifest); | ||
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__` | ||
const imagesManifest: NextImagesManifest = | ||
eval('require')(pathImagesManifest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use fs.readJSON()
like we do for routes manifest above
packages/next/src/utils.ts
Outdated
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
return require(middlewareManifestPath); | ||
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__` | ||
return eval('require')(middlewareManifestPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use fs.readJSON()
like we do for routes manifest above
packages/node-bridge/tsconfig.json
Outdated
"declaration": true | ||
"target": "ES2020", | ||
"declaration": true, | ||
"module": "ES2020" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is correct. The module
should likely be commonjs
since we even changed TS files to JS in this package to preserve CJS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I updated it to commonjs
. d905a75
(#7865)
Node 12 is EOL and we're starting to reference packages that don't install on node lower than 14, such as nuxt@3 and remix. Let's update to 14 for now.
Reimplements: #7819