im-perativa / streamlit-calendar

A Streamlit component to show calendar view using FullCalendar
https://calendar-component.streamlit.app/
Apache License 2.0
101 stars 10 forks source link

Component Value Payload Improvements #7

Closed rahadi23 closed 7 months ago

rahadi23 commented 7 months ago

Purpose

This PR is mainly aimed to resolve #5.

What's Changed

Currently, the component value payload is created by relying on JSON.parse(JSON.stringify(arg)) which suffers from cyclic properties issue. This issue is mainly caused by some properties that contain values that are actually have no meaningful importance when passed/returned to the streamlit or python environment, such as the js event and DOM elements.

Therefore, this PR is focused on removing these properties, keeping only selected properties that have a good significance to be used in streamlit environment. Some highlighted changes are as follows:

Expose component value payload only as needed

This is the main focus of this PR. Please be mindful that there will be a breaking change, which is if anyone was consuming the now omitted properties in their projects, they should also adapt to that change.

Rewrite Calendar as functional component

This is to ensure that the component is future proof, as class component is generally avoided nowadays.

Add new typings

This is to ensure that the typings of the frontend code would be typesafe.

Thank you!

im-perativa commented 7 months ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on PyPI and GitHub.