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

Notify that a new version is available #109

Closed
nvh95 opened this issue May 18, 2022 · 2 comments · Fixed by #129
Closed

Notify that a new version is available #109

nvh95 opened this issue May 18, 2022 · 2 comments · Fixed by #129
Labels
feature request Request a new feature

Comments

@nvh95
Copy link
Owner

nvh95 commented May 18, 2022

Is your feature request related to a problem? Please describe.
Jest Preview is currently at version < 1.0.0. That means versions with bug fixes and features come pretty frequently. However, once users install a package, they rarely update to a newer version. So we need a way to encourage them to update to the latest version.

Describe the solution you'd like
Display a banner to users when they run jest-preview. The idea is from docusaurus:
image

Describe how should jest-preview implements this feature
Not sure. Digging docusaurus source code at https://github.com/facebook/docusaurus

Describe alternatives you've considered
npm can do the same thing. How does it do?

@nvh95 nvh95 added the feature request Request a new feature label May 18, 2022
@nvh95 nvh95 changed the title Notice that a new version is available Notify that a new version is available May 18, 2022
@duongleh
Copy link

duongleh commented May 27, 2022

Hi @nvh95, I would love to take on this task. As I can see, Docusaurus uses a 3rd party package called update-notifier for handling new version notifications. This package is also previously used by the famous npm CLI, but they drop them in the v7 release and choose to go with their in-house solution. I can see that the package has already provided some basic customization and if we don't need anything other than that then it is good to go.

Here is something you also need to consider:

  1. Should we make a config so the user can choose to disable the notification? (in some cases, the user cannot upgrade for some reasons, and they will be bothered every time they run the app)
  2. The way this package works is a little bit different. It will check for updates on the first run and the notification will only be displayed in the 2nd run to avoid blocking the CLI usage. If this is not what we want then we need to find another solution.
  3. There is a bug that the notification is not displayed consistently. Docusaurus has already provided a workaround.
  4. The update checking interval. I know it is a background check and it does not slow down the app but what is the reasonable value we should set? Should we go with the default config (1 day)?
  5. If we have pre-release (canary release/release candidate/next), should we display the notification?
  6. If the node version needs to be updated, should we notify the user?

Other than that I think it is a great fit solution. What is your thought?

@nvh95
Copy link
Owner Author

nvh95 commented May 27, 2022

Hello @duong-le. It's great to see you again and we have a chance to work with each other together.

I love to have you work on this feature. It's super thoughtful of you to design a feature with user-centric mindset and potential hidden issues in the future.

I can review your comment one more time tomorrow to better understand what you are concerning and give you my thoughts. In the mean time, just proceed with any solution you have in mind. Create a draft PR as soon as possible so I can follow your work and easily support if needed.

Cheers. I can't wait to welcome you to contributors!

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

Successfully merging a pull request may close this issue.

2 participants