在Web应用程序中显示版本信息的最佳做法是什么?

huangapple go评论56阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年1月9日 05:12:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75051336.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定