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

render_jsx() Function #577

Closed
Archmonger opened this issue Jan 10, 2022 · 5 comments
Closed

render_jsx() Function #577

Archmonger opened this issue Jan 10, 2022 · 5 comments
Labels
flag-triage Not prioritized.

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Jan 10, 2022

Current Situation

In order to render JSX, currently custom components are needed.

Proposed Actions

Create an idom.jsx.render function that can output JSX to VDOM.

See python-react for design inspiration.

Implementation Details

The interface would look something like this...

@idom.component
def my_component():
    return idom.jsx.render("/path/to/component.jsx", {"foo":"bar"})

@idom.component
def my_second_component():
    # Also, we should try to make it play nicely with standard IDOM templating
    return h1(
        "Hello World",
         idom.jsx.render("/path/to/component.jsx",
         {"foo":"bar"},
         ),    
    )
@Archmonger Archmonger added the flag-triage Not prioritized. label Jan 10, 2022
@Archmonger
Copy link
Contributor Author

Archmonger commented Jan 10, 2022

This would be an amazingly useful developer utility that would effectively make custom components obsolete.
But as of right now is not a MVP feature. So I think this should get developed during v1 -> v2

@Archmonger
Copy link
Contributor Author

Archmonger commented Jan 10, 2022

@rmorshea Also I'm realizing the awkwardness of the GitHub projects titles.

It's hard to tell if 1.x Release means that all of those features are required to reach V1, or if those tasks will be developed while in V1.

Maybe rename sections to v0 to v1.0 Milestone, v1.0 to v2.0 Milestone, and v2.0 to v3.0 Milestone

@rmorshea
Copy link
Collaborator

rmorshea commented Jan 10, 2022

I think this can probably be wrapped up in the #578 issue. Ultimately there may be different ways of doing server-side rendering in IDOM, but at least to start, we'll probably want to just pick one to start.

@Archmonger
Copy link
Contributor Author

JSX rendering can be done in multiple ways, and can possibly be server side render or client side.

I'm thinking of this specific ticket as a "custom components 2.0"

@rmorshea
Copy link
Collaborator

rmorshea commented Jan 10, 2022

The custom components interface is a bit more general than this. It doesn't make assumptions about how the components are implemented - it might be React, but it doesn't have to be. Thus, a feature like this would probably be implemented as a custom component that reaches out to a react render server endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag-triage Not prioritized.
Projects
None yet
Development

No branches or pull requests

2 participants