-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Add globals
URL param and remove from sessionStorage
#15056
Conversation
Nx Cloud ReportCI ran the following commands for commit b0919fa. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
Nx Cloud ReportWe didn't find any information for the current pull request with the commit 7dc469c. Check the Getting started section to configure the app. Sent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great w/ one suggestion! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
globals
URL param and remove globals from sessionStorageglobals
URL param and remove from sessionStorage
@ghengeveld @shilman is there a way to hide or prevent global params from syncing to the url? I initially thought this was a good idea but after building my own addon, this locks-in the global variable for all stories. Say I have a story that has a background color as a global parameter. Say the parameter default is only set in the I DO think the hierarchy is correct and the url param value should override any other defined value. But syncing the global values to the URL creates issues. Looking at the old knobs addon, the knob values where never written to the url but you could still copy the current knob state via the I think the capture state method used with the knobs would be a better approach in the case of the globals. Is there a reason this was done this way and would you consider changing this? |
cc @MichaelArestad ☝️ |
The rationale is that we wanted to make it super easy and obvious to share stories and their state with others. Syncing the URL makes it easy to just copy the URL from the address bar, regardless of how they got there. A separate I think a short-term improvement would be to enable addon authors to opt-out their globals from URL syncing. Some globals aren't worth syncing with the URL, such as the measure addon state. |
Yes this would be greatly appreciated |
Issue: #11604
What I did
Added
globals
URL query param that tracks any globals that have a value that deviates from their initial/default value.Removed session storage for globals.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.