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

Change the fragmentId to be a required property in WidgetStateManager #8533

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

LukasMasuch
Copy link
Collaborator

@LukasMasuch LukasMasuch commented Apr 18, 2024

Describe your changes

The fragmentId is currently an optional property for all the set state methods in the WidgetStateManager. The reason here is that it sometimes has a value and sometimes is just undefined. But this makes it a bit too easy to forget to add it -> which can lead to features that are not compatible with fragments.

This PR changes the property to required by changing from fragmentId?: string to fragmentId: string | undefined. This also uncovered a potentially existing issue with form submission & fragments, which will be fixed via this PR, e.g.:

https://github.com/streamlit/streamlit/pull/8533/files#diff-b6b2b8d7411dc40d04d4dc0442572c4835e84a79844cd2e299a469b7b2ec1a1cR309

Testing Plan

  • Update tests

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@LukasMasuch LukasMasuch marked this pull request as ready for review April 18, 2024 17:04
@raethlein raethlein mentioned this pull request Apr 19, 2024
@vdonato
Copy link
Collaborator

vdonato commented Apr 25, 2024

Hm, so I think it'd probably be a good idea to convert this PR into a draft for now and pick up the work again when removing the experimental_ prefix from the fragment decorator. We'll need to do some coordination work with other teams to ensure that this doesn't end up resulting in any backwards compatibility issues, and it'll be easy to focus on that when working on other fragment-relate tasks.

Happy to take this PR over once I start working on fragment de-experimentalization in about a month or so.

@vdonato vdonato marked this pull request as draft April 25, 2024 20:19
@vdonato vdonato self-assigned this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants