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

feat: all up to data do not show select and add fetch cache #61

Merged
merged 17 commits into from
May 26, 2024

Conversation

winchesHe
Copy link
Member

@winchesHe winchesHe commented May 9, 2024

📝 Description

  1. Fix https://linear.app/nextui-inc/issue/ENG-709/all-components-up-to-date-message
  2. Fetch cache and loading

When first run when fetch latest version, next time run will check whether cache data expired(30min) and using cache data

CleanShot 2024-05-09 at 22 37 33

Upgrade

CleanShot 2024-05-10 at 14 05 17

Remove

CleanShot 2024-05-10 at 14 07 04

  1. Add display about disabled pkg when select omponents

Every up to date pkg show in bottom

image

✅ Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Improvement (non-breaking change which improves an existing feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Copy link

linear bot commented May 9, 2024

@winchesHe winchesHe changed the title feat: all up to data do not show select feat: all up to data do not show select and add fetch cache May 9, 2024
src/scripts/cache/cache.ts Outdated Show resolved Hide resolved
src/scripts/helpers.ts Outdated Show resolved Hide resolved
* feat: add sort disabled pkg when select compoents

* feat: optimize display
* feat: optimize log and less color

* feat(doctor): add peerDependencies check
* feat: optimize log and less color

* feat(doctor): add peerDependencies check

* docs: update README
Copy link
Member

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've one question about the cache.

  • lets say i run the cli and fetch the versions. now there is a cache in my local. next time when i run again, it will have a cache hit (within 30 mins).
  • now NextUI releases a bug fix release
  • if i run it again (still within 30 mins), does it still have a cache hit or it will invalidate the cache and re-fetch again?

@winchesHe
Copy link
Member Author

It still uses cached data unless 30 minutes have passed

@wingkwong
Copy link
Member

but what if i need to upgrade? users may not know they need to wait for 30 mins. is there any way to invalidate by themselves? ideally if there is a new release, it shouldn't use the cache.

@winchesHe
Copy link
Member Author

I think we could add a option to run without cache, and add notes in docs, usually, this scenario should occur relatively infrequently

@wingkwong
Copy link
Member

second thought - i think we just need to handle it on our side. it doesn't make sense to invalidate cache from user side.

@winchesHe
Copy link
Member Author

winchesHe commented May 21, 2024

But if that's the case, we need to send requests every time run, or only keep fetching component's data every time

@wingkwong
Copy link
Member

That's a good point. If so we may add a option like you said to run without cache so that users don't need to wait for the cache expiry time in order to perform some actions like upgrade.

@jrgarciadev
Copy link
Member

@winchesHe why don't we validate the cached version vs the latest version and rewrite the cache only when the latest version changes? (only for globally installed cli)

@winchesHe
Copy link
Member Author

winchesHe commented May 22, 2024

@jrgarciadev It's because we need to send a request every time we run a command to validate whether it is latest version, that's why I added a default cache of 30 minutes, so that within 30 minutes, if we run the command again, we won't send the same request, therefore, it can improve the running speed

* feat: add vite init template

* docs: update init command
@jrgarciadev jrgarciadev merged commit d4a1ecc into main May 26, 2024
3 checks passed
@jrgarciadev jrgarciadev deleted the feature-upgrade-all-up-to-data branch May 26, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants