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: use localstorage instead of url params for yarn checkbox #22

Conversation

Sacquer
Copy link

@Sacquer Sacquer commented Jan 24, 2025

Summary

Make use of localstorage to save state for the yarn checkbox.
In an earlier revision the state for the yarn checkbox was making use of url params - that part has been removed.

Test Plan

What are the steps to reproduce?

Open up your devtools and check the values getting toggled under the key backstage:upgrade-helper:settings in localstorage. The changes will also be reflected in the ui.

Checklist

  • I tested this thoroughly
  • I added the documentation in README.md (if needed)

@Sacquer Sacquer requested review from vinzscam and a team as code owners January 24, 2025 18:56
@Sacquer
Copy link
Author

Sacquer commented Jan 24, 2025

Changes originated from this discord thread

Copy link
Member

@vinzscam vinzscam left a comment

Choose a reason for hiding this comment

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

mmm then state won't persist when the link is shared and also this in the cli bump command will break

@Sacquer
Copy link
Author

Sacquer commented Jan 25, 2025

mmm then state won't persist when the link is shared and also this in the cli bump command will break

Thanks for replying so quickly!
I see it's not as straightforward as I thought it'd be ☺️ - or rather it might not make much sense to remove the url params way of persisting things.

I guess the question is if we should scrap it or check localstorage for value and populate url params?

@Sacquer Sacquer closed this Jan 28, 2025
@Sacquer Sacquer deleted the feat-use-localstorage-for-yarn-checkbox branch January 28, 2025 16:42
@vinzscam
Copy link
Member

vinzscam commented Feb 3, 2025

mmm then state won't persist when the link is shared and also this in the cli bump command will break

Thanks for replying so quickly! I see it's not as straightforward as I thought it'd be ☺️ - or rather it might not make much sense to remove the url params way of persisting things.

I guess the question is if we should scrap it or check localstorage for value and populate url params?

I think it's pretty straightforward @Sacquer if you wanna have a look again! What we basically want is that if no yarnPlugin query param is defined, we read the preference localstorage and add the missing queryParam to the url. The preferences are already stored in localStorage.

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.

2 participants