ReactPy static site generation (SSG)

Open
#1,272 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
bun, python, react

Research direction

Start by reviewing the client-side components introduced in PR #1269 and the proposed reactpy CLI and reactpy.pyscript API boundaries. Done means defining and implementing a path from *.py or Jinja-compatible *.html inputs to equivalently named static pages in the requested output directory, including the stated base URL behavior.

Written by the indexing model from the issue text.

Description

priority-2-moderate
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 ssg "glob_pattern/to/my_components_*.py" --outdir "dist/" --base_url "example/"

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/")
Dominant language
Python
Stars
8.1k
Forks
332
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactive-python/reactpy

All issues in reactive-python/reactpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.