toasty
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
We should check if content-length > 0 before trying to read the body, and we should also skip any leading \r\n before reading the body. There was a leading \r\n that consumed 2 bytes that was expected in the body itself, so that's why you saw
go
truncated off the end.367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I think I fixed the bug, I will open a PR for it
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I was mistaken, HTTPrequest does not implement repr at the moment, but I'm trying to run
print(repr(req.get_body()))
to check on the newlines present. I ran it with no body and it looks fine, I see 2 CRLF (\r\n\r\n) which is correct, but I need to test it with a request that has a body. I don't think we have an unit tests for request parsing that includes a body yet.367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
If you repr the request, are there 3 \r\n before the request body?
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Usually if I want to print bytes I’ll make it a stringslice
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
The last one is truncated because body_raw is a list of bytes that are not null terminated. So you lose the last character
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
At most I have 3 servers I use for my k8s cluster haha. Definitely not in the distributed DB realm outside of work stuff
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@Owen Hilyard If you're open to sending out invites, I'd love to see what you're working on!
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
In my experience it was like every 1-3 nightly versions. So, trying to maintain a nightly version of any lib is quite time consuming.
367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Mojo versions become incompatible fairly quickly
367 replies
MModular
•Created by duck_tape on 12/10/2024 in #community-showcase
ExtraMojo
That’s kind of what stopped me from poking at it myself. Wasn’t sure if the general direction was to make the default buffered r/w or to separate that out
83 replies
MModular
•Created by duck_tape on 12/10/2024 in #community-showcase
ExtraMojo
Have you considered adding your buffered read logic to the FileHandle struct in the stdlib? Would be nice to get readline and iteration over lines added to it!
83 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Alternatively,
Headers
is also writable, so you can print req.headers
as well367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Can you try printing the request object? HTTPRequest implements
Writable
so you should be able to print it and see what headers you received367 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I don’t think it’s in the modular-community channel yet. But it is in the mojo-community one
367 replies
MModular
•Created by eggsquad on 10/16/2024 in #community-showcase
EmberJson: High level JSON library
No rush! Just curious. Was thinking about handling json payloads for the client in
lightbug_http
🙂55 replies
MModular
•Created by eggsquad on 10/16/2024 in #community-showcase
EmberJson: High level JSON library
Any thoughts on when it’ll make it to a version that works with stable max? 😄
55 replies
MModular
•Created by Ivo Balbaert on 1/7/2025 in #questions
Try finally when opening a file
You could fail to open the file within the try block, so you reach finally with an uninitialized ‘file’ variable
13 replies
MModular
•Created by toasty on 5/12/2024 in #community-showcase
Prism: CLI Library (inspired by Golang's Cobra)
Hello everyone!
Prism
has been updated to 0.3.0
and now supports Mojo 24.6.
The command api has been changed fairly substantially and now looks a bit more like urfave/cli
. Rather than adding flags and subcommands functionally after creating the command, it's all set up during the command creation.
Unfortunately, I had to remove the ability to include persistent flags in flag groups of children commands. That is because the children commands are now being created before the root command, and the persistent ancestor flags are not inherited by the children until the command is executed. I will work on a way to readd this feature in the near future.
If you would like to contribute, please let me know! there are plenty of smaller features that need to be worked on. 🙂
7 replies
MModular
•Created by toasty on 5/12/2024 in #community-showcase
Mog: Style definitions for nice terminal layouts (inspired by charmbracelet/lipgloss)
mog
has been updated for Mojo 24.6!
Lots of bug fixes and the readme has been cleaned up to correct any incorrect examples. The rendering speed has improved by 50-60% with all the changes to String
in 24.6, along with the removal of as many additional allocations as I could.
Happy to see the drastic performance improvement from 140-150ms to render the example layout image in 24.4, to 5-6ms in 24.6.5 replies