Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Nov 30, 2023
1 parent ab691ea commit b901e5c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/fastui-bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# FastUI Bootstrap

Bootstrap components for FastUI.
Bootstrap components for [FastUI](https://github.com/samuelcolvin/FastUI).
1 change: 1 addition & 0 deletions packages/fastui-prebuilt/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default () => {
}

return defineConfig({
// @ts-expect-error - no need to type check this file
plugins: [react()],
resolve: {
alias: {
Expand Down
7 changes: 1 addition & 6 deletions packages/fastui/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# FastUI

[![CI](https://github.com/samuelcolvin/FastUI/actions/workflows/ci.yml/badge.svg)](https://github.com/samuelcolvin/FastUI/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![pypi](https://img.shields.io/pypi/v/fastui.svg)](https://pypi.python.org/pypi/fastui)
[![versions](https://img.shields.io/pypi/pyversions/fastui.svg)](https://github.com/samuelcolvin/FastUI)
[![license](https://img.shields.io/github/license/samuelcolvin/FastUI.svg)](https://github.com/samuelcolvin/FastUI/blob/main/LICENSE)

WIP
[FastUI](https://github.com/samuelcolvin/FastUI) React library.
4 changes: 2 additions & 2 deletions python/demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ async def sse_generator() -> AsyncIterable[str]:
await asyncio.sleep(0.09)


@router.get('/sse', response_class=StreamingResponse)
async def sse_experiment():
@router.get('/sse')
async def sse_experiment() -> StreamingResponse:
return StreamingResponse(sse_generator(), media_type='text/event-stream')
13 changes: 13 additions & 0 deletions python/fastui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@


class FastUI(pydantic.RootModel):
"""
The root component of a FastUI application.
"""

root: list[AnyComponent]


Expand All @@ -15,6 +19,15 @@ class FastUI(pydantic.RootModel):


def prebuilt_html(title: str = ''):
"""
Returns a very simple HTML page which includes the FastUI react frontend, loaded from https://www.jsdelivr.com/.
Arguments:
title: page title
Returns:
HTML string which can be returned by an endpoint to serve the FastUI frontend.
"""
# language=HTML
return f"""\
<!doctype html>
Expand Down

0 comments on commit b901e5c

Please sign in to comment.