Skip to content
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

Merged
merged 34 commits into from
Jun 2, 2022

Conversation

EndangeredMassa
Copy link
Contributor

@EndangeredMassa EndangeredMassa commented May 23, 2022

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

@@ -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__);
Copy link
Member

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?

Copy link
Contributor Author

@EndangeredMassa EndangeredMassa Jun 1, 2022

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)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

const imagesManifest: NextImagesManifest = require(pathImagesManifest);
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
const imagesManifest: NextImagesManifest =
eval('require')(pathImagesManifest);
Copy link
Member

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

// 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);
Copy link
Member

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

"declaration": true
"target": "ES2020",
"declaration": true,
"module": "ES2020"
Copy link
Member

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

Copy link
Contributor Author

@EndangeredMassa EndangeredMassa Jun 2, 2022

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)

@kodiakhq kodiakhq bot merged commit e090012 into main Jun 2, 2022
@kodiakhq kodiakhq bot deleted the endangeredmassa/update-node-14-tsconfig branch June 2, 2022 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli area: client semver: major PR contains breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants