Skip to content

[NOT YET FOR REVIEW] Refactor block.tsx and friends#3583

Closed
tvst wants to merge 14 commits intostreamlit:developfrom
tvst:block-refactor
Closed

[NOT YET FOR REVIEW] Refactor block.tsx and friends#3583
tvst wants to merge 14 commits intostreamlit:developfrom
tvst:block-refactor

Conversation

@tvst
Copy link
Copy Markdown
Contributor

@tvst tvst commented Jul 21, 2021

As promised, here's a cleanup of block.tsx and related files!

More info:

  1. I did a refactor of the code into several React components, rather than 1 component plus several bespoke functions. This makes better use of React's DOM diffing, React keys, and so on. Plus it's easier to read.
  2. For performance and code cleanliness, I made it so the autosizer in only used when we have a vertical Block, because that's the only block that holds actual Elements (which need to know their widths). Nothing else needs to know their widths now.
  3. I fixed a bug where there was a random parenthesis lying around in ThemedApp.tsx
  4. I cleaned up the way we added vertical padding between consecutive elements in an app. This vertical space used to live all over the place but now it's been unified to only live at StyledVerticalBlock.

NOTE: The commit history looks messy because this work came from the Cards project Karen was working on. But I have since pulled out all Card-related code, so the actual diff should be pretty clean.

kajarenc and others added 14 commits May 19, 2021 02:17
* Add container/block type `Card`

* Use `margin` and `padding` instead of `marginTop`, ... and `paddingTop` ...
* Add container/block type `Card`

* Update change log

* Up version to 0.82.0

* pin click to < 8.0 (streamlit#3256)

Click 8.0 has breaking API changes

* Use `margin` and `padding` instead of `marginTop`, ... and `paddingTop` ...

* Remove tag from PR template (streamlit#3284)

* * Prevent nested cards

Co-authored-by: Ken McGrady <[email protected]>
Co-authored-by: Tim Conkling <[email protected]>
Co-authored-by: Ken McGrady <[email protected]>
…rs, Forms, and basically everything vertical.
@tvst tvst requested a review from a team July 21, 2021 01:31
@stale
Copy link
Copy Markdown

stale bot commented Aug 7, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 7, 2021
@tconkling tconkling removed the stale label Aug 7, 2021
@stale
Copy link
Copy Markdown

stale bot commented Aug 21, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 21, 2021
@stale stale bot closed this Aug 28, 2021
@tvst tvst deleted the block-refactor branch November 10, 2021 21:22
@tvst tvst mentioned this pull request Nov 10, 2021
7 tasks
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.

3 participants