Open-source updates - 04 October 2021
Published by Patrick Arminio on
Last two weeks have been intense! I've been working on improvements for our website and as usual I've been reviewing some PRs. I also did a bit of cleanup for Hacktobterfest ๐ Oh and we now also support Python 3.10 ๐
Last two weeks have been intense! Iโve been working on improvements for our website and as usual Iโve been reviewing some PRs. I also did a bit of cleanup for Hacktobterfest ๐ Oh and we now also support Python 3.10 ๐
Issues cleanup
Itโs Hacktoberfest ๐ time! This means we will get some new people wanting to contribute to Strawberry this month! So I spent a bit of time cleaning up old issues and checking if labels were alright ๐
If you want to help feel free to take a look at the issues label as โgood-first-issueโ.
Python 3.10
Python 3.10 is going to be released this month, so we made a PR to add support for it. I had this open for quite a few months, but was waiting for dependencies to fix some issues. Now all of them seems to be working fine on Python 3.10, so Iโve update the PR to fix a couple of issues with Python 3.10 and to also add support for the new union syntax, which allows you to declare unions like so:
import strawberry
@strawberry.type
class User:
name: str
@strawberry.type
class Error:
code: str
@strawberry.type
class Query:
find_user: User | Error
Release is available here.
Website improvements
I honestly canโt fully remember why I did start working on this, but I always wanted a better code block for our website. I always liked Stripeโs docs and always wanted to copy some of their code block features, for example being able to add inline notes to parts of the code.
This is something Iโve now implemented in this PR. You can see an example in action here.
Basically we are now able to highlight individual lines, individual words and add notes to parts of the code.
The code for the notes is a bit fragile, but for now it works. I have some ideas on how to improve it, but it would probably require using/writing a different syntax highlighter.
# Search support
I almost forgot about this, not having search on the website was something that came up during our monthly meeting. So I applied for Algoliaโs doc search and in a couple of days we got the request approved and so I implemented it in our website. Itโs so fast and useful, I wish I did this a while ago!
PR reviews
Marcelo Trylesinski added a PR to better document how to use Strawberry and Starlette. We already supported Starlette using our ASGI integration, but it does make sense to have a dedicated page for this!
Michael Ossareh submitted two PRs to improve the Open Tracing support, I definitely appreciate being able to get better traces out for Strawberry!
Guillaume Andreu Sabater made a PR to fix a typo in a docstring. Always nice to see when people take time to improve things, even if it is just a tiny typo.
Jon Kim made a very useful PR to document all our extensions. We think extensions are going to make Strawberry much more flexible and powerful. Go and check the extensions out!
Fin
Iโm not doing well at doing this every week, I hope thatโs ok ๐
Anyway, Iโm so excited about Hacktoberfest, Iโm sure weโll get some nice contributions. Also canโt wait to start doing some contribution to other projects myself, if I manage to make time ๐
Written at home ๐