-
Notifications
You must be signed in to change notification settings - Fork 255
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
add easy to use chunked transfer extension header #346
Conversation
Found 1 changed notebook. Review the changes at https://gitnotebooks.com/AnswerDotAI/fasthtml/pull/346 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brevity and clarity of this PR is admirable. Offsetting the HTMX into a node package is also a bonus.
@@ -439,7 +440,7 @@ def __str__(self): return p | |||
class FastHTML(Starlette): | |||
def __init__(self, debug=False, routes=None, middleware=None, exception_handlers=None, | |||
on_startup=None, on_shutdown=None, lifespan=None, hdrs=None, ftrs=None, | |||
before=None, after=None, ws_hdr=False, | |||
before=None, after=None, ws_hdr=False, ct_hdr=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does ct_hdr
stand for? Chunked Transfer Header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we rename it? i wasn't able to come up with something clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the name. Just wanted to be explicit for when I document it. 😄
if ws_hdr: hdrs = [htmxwsscr] + hdrs | ||
if htmx: hdrs = [htmxscr] + hdrs | ||
if ws_hdr: hdrs = [htmxwssrc] + hdrs | ||
if ct_hdr: hdrs = [htmxctsrc] + hdrs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ What does ct_hdr
stand for?
" if ws_hdr: hdrs = [htmxwsscr] + hdrs\n", | ||
" if htmx: hdrs = [htmxscr] + hdrs\n", | ||
" if ws_hdr: hdrs = [htmxwssrc] + hdrs\n", | ||
" if ct_hdr: hdrs = [htmxctsrc] + hdrs\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ What does ct_hdr
stand for?
Thank you, this looks good! Sorry I renamed the vars the other day, so there's a conflict now. Do you mind taking a look? |
Many thanks for this. Would you mind taking a look at the conflict please @fabge ? |
name: add easy to use header for transfer encoding chunked htmx extension
labels: chunked transfer
Related Issue
Issue 1911 in htmx repo
Proposed Changes
HTMX handles chunked transfer encoding of a response differently than in vanilla HTML. It waits for the complete response before displaying the response, instead of displaying already received chunks of content.
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply:Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.