Skip to content

blinkinglight/datastar-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datastar Noob Question

How can I get a ChatGPT like UI using datastar without sending the entire page in each fragment?

Setup

Install FastAPI via pip:

pip install -r requirements.txt

Start fastapi server:

fastapi dev app.py --port 8000

Then navigate to localhost:8000

You should see this:

Current UI

Where lorem ipsum is generated using server sent events powered by datastar on the frontend. The issue I have is that I could not get this to work by only sending individual words via data: merge append_element

So then on the append branch (git checkout append) I try to avoid this by using the data: merge append_element. Which sort of works in that my data being sent is much lower, however, it ends up almost crashing my browser and being very choppy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.3%
  • HTML 8.7%