Skip to content

ReactPy static site generation (SSG) #1272

Open
@Archmonger

Description

@Archmonger

Current Situation

Now that we have client side components, it is now technologically possible for ReactPy to be compiled into a static site / flatpage(s).

Proposed Actions

Create some sort of reactpy CLI (or maybe a Bun plugin?) that allows ReactPy to be compiled down into flatpage(s).

This function should compile client-side components *.py files into equivalently named *.html files. Alternatively, if the user provides a glob pattern with *.html, these templates are assumed to be Jinja compatible.

For example, a CLI command might looks like this:

reactpy staticsite "glob_pattern/to/my_components_*.py" --outdir "dist/"

We should also have a Python API equivalent for people wanting to perform SSG via scripts. It might look like this:

from reactpy.pyscript import compile_static_site

compile_static_site( "glob_pattern/to/my_components_*.py", outdir="dist/")

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-2-moderateShould be resolved on a reasonable timeline.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions