Skip to content

ReactPy static site generation (SSG) #1272

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

Open
Archmonger opened this issue Feb 11, 2025 · 0 comments
Open

ReactPy static site generation (SSG) #1272

Archmonger opened this issue Feb 11, 2025 · 0 comments
Labels
priority-2-moderate Should be resolved on a reasonable timeline.

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Feb 11, 2025

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/")
@Archmonger Archmonger added priority-2-moderate Should be resolved on a reasonable timeline. type-feature labels Feb 11, 2025
@Archmonger Archmonger changed the title Allow ReactPy to compile to a client-side flatpage Allow ReactPy to compile to raw HTML (flatpage) Feb 11, 2025
@Archmonger Archmonger changed the title Allow ReactPy to compile to raw HTML (flatpage) Allow ReactPy to compile to raw HTML Mar 14, 2025
@Archmonger Archmonger changed the title Allow ReactPy to compile to raw HTML ReactPy static site generation (SSG) Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline.
Projects
None yet
Development

No branches or pull requests

1 participant