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

Define node.js version for the dashboard project #1008

Closed
shivam-sharma7 opened this issue Sep 27, 2023 · 4 comments · Fixed by #1359
Closed

Define node.js version for the dashboard project #1008

shivam-sharma7 opened this issue Sep 27, 2023 · 4 comments · Fixed by #1359
Labels
enhancement New feature or request feature

Comments

@shivam-sharma7
Copy link
Contributor

shivam-sharma7 commented Sep 27, 2023

Is your feature request related to a problem? Please describe.
.nvmrc file a simple string representing the version of Node.js the project requires. As we know lot of depreciation comming with new node 20 LTS and we need to make sure which version we are using for our dashboard.

@shivam-sharma7 shivam-sharma7 added enhancement New feature or request feature labels Sep 27, 2023
@Traxmaxx
Copy link
Contributor

Traxmaxx commented Sep 27, 2023

Heya, thanks a lot for the recommendation. Having a .nvmrc is a great idea!

Enforcing the node version is done via package.json though. There should be an engines entry.

The benefit of having both is, if someone is using node-env or asdf-vm insted of NVM they receive an warning when running npm install:

~/S/t/k/dashboard > npm install                                                                                                                                                                                                           
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'komiser-dashboard@3.1.0',
npm WARN EBADENGINE   required: { node: '20.0.7' },
npm WARN EBADENGINE   current: { node: 'v18.16.1', npm: '9.5.1' }
npm WARN EBADENGINE }

If we would just go with the .nvmrc everyone without NVM would never know what version is actually required and can potentially submit invalid code.

@shivam-sharma7
Copy link
Contributor Author

Heya, thanks a lot for the recommendation. Having a .nvmrc is a great idea!

Enforcing the node version is done via package.json though. There should be an engines entry.

The benefit of having both is, if someone is using node-env or asdf-vm insted of NVM they receive an warning when running npm install:

~/S/t/k/dashboard > npm install                                                                                                                                                                                                           
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'komiser-dashboard@3.1.0',
npm WARN EBADENGINE   required: { node: '20.0.7' },
npm WARN EBADENGINE   current: { node: 'v18.16.1', npm: '9.5.1' }
npm WARN EBADENGINE }

I'm not agree with the above thing because we don't want to create any restriction for the development side, having .nvmrc would be good enough, defining following thing is for project like- buiilding npm packages, cli tools and stuff not for this project.

{
"engines": {
"node": ">=0.10.3 <15"
}
}

@Traxmaxx
Copy link
Contributor

Heya @shivam-sharma7

Thank you for your feedback. I agree that this practice is typically associated with npm packages. However, there is a notable concern to consider IMHO. There is a possibility of encountering disruptive changes in the package-lock file when utilizing a different Node.js version than the one employed in the build pipeline.

I observed various unusual package resolution issues arising in the past when different team members were employing distinct Node.js versions locally. While I believe it would be impractical to mandate that contributors adhere to a specific Node.js manager, introducing the engines entry to the package.json file generates a warning, albeit still allowing compilation. This approach, however, ensures that contributors are at least made aware of the version disparity.

It proves to be quite challenging to verify whether a contributor has constructed the package-lock.json with the correct Node.js version when reviewing a pull request. Adding engines might help. What do you think?

@shivam-sharma7
Copy link
Contributor Author

shivam-sharma7 commented Sep 29, 2023

@Traxmaxx Okay

I know that komiser never should be static so we don't care about node.js version and we are building dashboard not the thing what I mentioned above, we are going to adopt every new tech stack what make komiser better from design wise and develepment wise as well. This would be a concern if we used Node for the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants