英文:
What is a best practice for showing the version information in a web app?
问题
I'm devloping a web app.
我正在开发一个Web应用。
What are the best practices for showing the version information in a web app?
在Web应用中显示版本信息的最佳实践是什么?
I'm using semantic versioning, and I already have the semver e.g. 1.2.0
我正在使用语义化版本控制,我已经有了语义版本号,例如1.2.0。
But I'm curious where is the best way to display it and how to manage it. I am thinking to:
但我好奇最佳的显示和管理方式在哪里。我正在考虑:
-
store the version in a "version" file.
-
将版本信息存储在一个名为 "version" 的文件中。
-
when starting the app, read the content from the version file, and present it in a field Version in the "About" tab.
-
在启动应用程序时,从版本文件中读取内容,并在 "关于" 选项卡中的 "版本" 字段中显示它。
Is this reasonable approach?
这种做法合理吗?
Is there any example in jsfiddle or codepen that shows how to do this?
是否有在jsfiddle或codepen中的示例展示如何实现这一点?
Thanks,
谢谢,
Avner
Avner
英文:
I'm devloping a web app.
What are the best practices for showing the version information in a web app?
I'm using semantic versioning, and I already have the semver e.g. 1.2.0
But I'm curious where is the best way to display it and how to manage it. I am thinking to:
- store the version in a "version" file.
- when starting the app, read the content from the version file, and present it in a field Version in the "About" tab.
Is this reasonable approach?
Is there any example in jsfiddle or codepen that shows how to do this?
Thanks,
Avner
答案1
得分: 0
是的,你可以按照你的方法进行。另一种方法是从你的 package.json 文件中读取版本号:
import {version} from './package.json';
然后在你的关于页面中使用它。
英文:
Yes, you could follow your approach. Another way would be to read the version from your package.json file
import {version} from './package.json';
and use it in your about page.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论