Skip to content

Component Initial HTML - #27

Closed
Archmonger wants to merge 3 commits into
reactive-python:mainfrom
Archmonger:add-loader
Closed

Archmonger wants to merge 3 commits into
reactive-python:mainfrom
Archmonger:add-loader

Conversation

@Archmonger

@Archmonger Archmonger commented Nov 17, 2021 •

Copy link
Copy Markdown
Contributor

The idea of this PR is to allow for customizable initial HTML.

This is useful for...

  • Showing a simple loader/message in situations where a websocket connection could not be formed (Message display can be delayed via CSS).
  • Can be used to run simple scripts on the component div.

This is different than an IDOM Core idom.component fallback=... that we have discussed due to the fact that this implementation fallback has no WS reliance.

@Archmonger

Archmonger commented Nov 17, 2021 •

Copy link
Copy Markdown
Contributor Author

I want to mention that this PR is currently nonfunctional due to mountViewToElement wiping the inner contents of the component div on WS connect. In order for this PR to work, this behavior in IDOM Core would need to be changed to clear the HTML on first render instead.

Mostly opening this PR as a discussion as whether or not this concept can/should be pursued.

There are several situations where it'd be useful to have a fallback that is not reliant on websockets.

@Archmonger Archmonger changed the title Component HTML Fallback Component Initial HTML Nov 17, 2021
@Archmonger Archmonger self-assigned this Nov 17, 2021
@rmorshea

rmorshea commented Jan 12, 2022 •

Copy link
Copy Markdown
Contributor

I think this can be addressed once reactive-python/reactpy#581 is completed.

@Archmonger

Copy link
Copy Markdown
Contributor Author

I'm going to close this in prioritization of SSR within IDOM v3

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