Skip to content

fix: convert all content values to strings#303

Merged
ramedina86 merged 2 commits intowriter:devfrom
mmikita95:fix-content-str-cast
Mar 12, 2024
Merged

fix: convert all content values to strings#303
ramedina86 merged 2 commits intowriter:devfrom
mmikita95:fix-content-str-cast

Conversation

@mmikita95
Copy link
Contributor

Adds a _prepare_value for StreamsyncUIManager class, to utilize inside _create_component. For dict, it uses json.dumps, and casts to str for the rest of the types. Allows to use Python types when defining content for CMCs, for example:

ui.SliderInput({"minValue": 0, "maxValue": 300, "stepSize": 1}) # uses int literals

By default, this triggers TypeError: template.replace is not a function on the frontend; this fix allows to avoid it.

@ramedina86 ramedina86 merged commit 8d3801a into writer:dev Mar 12, 2024
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